diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym index fe6327b..ef194f5 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab index a470386..757863e 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad index 6b3c0f3..6d965aa 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc index f232641..8370ee8 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf index f397539..9976250 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr index c2bdb18..dc7312f 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb index af87b0c..bb93458 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd index 55c8804..c34416d 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.siproj b/si4/soft_gsm_main.si4project/soft_gsm_main.siproj index 86b2e37..23bc7ba 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.siproj and b/si4/soft_gsm_main.si4project/soft_gsm_main.siproj differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.siwork b/si4/soft_gsm_main.si4project/soft_gsm_main.siwork index 8ac5ae0..b71bf04 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.siwork and b/si4/soft_gsm_main.si4project/soft_gsm_main.siwork differ diff --git a/source/app/app_common.c b/source/app/app_common.c index 6fe471d..23fab30 100644 --- a/source/app/app_common.c +++ b/source/app/app_common.c @@ -15,19 +15,21 @@ U32 code key_rfid_map[KEY_RFID_MAP_SIZE] = /// key, rfid //0x01,1, ///S1 ///key_map[0] key_map[1] //0x02,11, ///S2 ///key_map[n] key_map[n+1] - 0x03,0x01000001, ///呼叫 - 0x04,0x02000001, ///分诊 - 0x08,0x01000003, ///一线 - 0x09,0x01000004, ///采血 - 0x0a,0x01000005, ///心电 - 0x0B,0x02000003, ///CT - 0x0f,0x01000007, ///二线 - 0x10,0x01000008, ///谈话 - 0x11,0x01000009, ///签字 - 0x12,0x0100000A, ///团注 - 0x16,0x02000005, ///介入 - 0x17,0x0100000C, ///置鞘(穿刺) - 0x18,0x0100000D, ///病房 + 0x02,0x02000020, ///呼叫 S2 + 0x12,0x02000001, ///分诊 S12 + 0x03,0x03010301, ///一线 S3 医生1 + 0x03,0x03010302, ///一线 S3 医生2 + 0x16,0x02000059, ///采血 S13 + 0x04,0x02000025, ///心电 S4 + 0x17,0x02000003, ///CT S14 + 0x08,0x03020301, ///二线 S5 医生1 + 0x08,0x03020302, ///二线 S5 医生2 + 0x18,0x01000008, ///谈话 S15 + 0x09,0x01000009, ///签字 S6 + 0x1D,0x02000060, ///团注 S16 + 0x0A,0x02000005, ///介入 S7 + 0x1F,0x0100000C, ///置鞘(穿刺) S17 + 0x0B,0x02000023, ///病房 S8 //0x1d,9, ///S16 //0x1f,10, ///S17 //0x1e,0 /// 清零按键,无需亮灯 @@ -64,7 +66,7 @@ void L2_register_init() { U8 i = 0; G.p.slaverId = 0x10; - G.p.wisdom_car_no = 0x92; //第一台车91,第二台车92 + G.p.wisdom_car_no = 0x93; //第一台车91,第二台车92 G.p.thrombolytic_ratio = 9; //0.9 G.p.bolus_ratio = 1; //0.9 G.p.hold_ratio = 9; //0.1 @@ -76,9 +78,9 @@ void L2_register_init() G.asga.xaxis = G.asga.yaxis = G.asga.zaxis = 0; G.rfidval = G.rfidHospitalNo = 0; - for(i=0;i<4;i++) + for(i=0;i<6;i++) { - G.weight[i] = 0; + G.rfid[i] = 0; } for(i=0;iok ) //收到消息 + { + if(L3_checkCrc16(&p->ts_ccmodbus)) //CRC校验 + { + if(p->ts_ccmodbus.slaver == G.p.wisdom_car_no ) //平车ID + { + switch(p->ts_ccmodbus.oper) //操作码0x10 + case MODBUS_OPER_WRITE_M: + + + L3_protocol_handler_uart4_fun(&p->ts_ccmodbus); + } + } + g_at_send_status.gprs_last_recv_stmp = s_nos_tick.t_1s; + L3_protocol_handler_uart4_fun(p->buf+1); + p->ok = 0; + + } +} + //FF FE 05 00 00 28 FC CC 从FF开始校验 int L3_checkCrc16(TS_PH3_ccmodbus *ccmodbus) diff --git a/source/app/app_task_485.c b/source/app/app_task_485.c index 30eeaa0..c235678 100644 --- a/source/app/app_task_485.c +++ b/source/app/app_task_485.c @@ -98,7 +98,7 @@ void L3_task_485_handle(TS_485 *s) //G.rfid = G._keyled; U32 rfid = key_rfid_map_out(G._keyled); G.rfid[0] = D_CAR_HOSPITAL_NO >> 8 & 0xFF; - G.rfid[0] = D_CAR_HOSPITAL_NO >> 0 & 0xFF;; + G.rfid[1] = D_CAR_HOSPITAL_NO >> 0 & 0xFF;; G.rfid[2] = rfid >> 24 & 0xFF; G.rfid[3] = rfid >> 16 & 0xFF; G.rfid[4] = rfid >> 8 & 0xFF; diff --git a/source/app/app_task_gm35.h b/source/app/app_task_gm35.h index 17de300..affd0d3 100644 --- a/source/app/app_task_gm35.h +++ b/source/app/app_task_gm35.h @@ -24,9 +24,8 @@ #define AT_INS_CCID "AT+CCID\r\n" //SIM卡查询指令 #define AT_INS_CREG "AT+CREG?\r\n" //网络查询指令 #define AT_INS_GPRS "AT+CGATT=1;+CGDCONT=1,\"IP\",\"CMNET\";+CGACT=1,1\r\n" //GPRS操作指令 -#define AT_INS_CIPSTART "AT+CIPSTART=\"TCP\",\"www.tall.wiki\",8195\r\n" -//#define AT_INS_CIPSTART "AT+CIPSTART=\"TCP\",\"weizezhao.imwork.net\",49809\r\n" //连接服务器 -//#define AT_INS_CIPSTART "AT+CIPSTART=\"TCP\",\"test.tall.wiki\",49000\r\n" //连接服务器 +//#define AT_INS_CIPSTART "AT+CIPSTART=\"TCP\",\"www.tall.wiki\",8195\r\n" +#define AT_INS_CIPSTART "AT+CIPSTART=\"TCP\",\"test.tall.wiki\",38195\r\n" //连接服务器 #define AT_INS_CIPSEND "AT+CIPSEND\r\n" //发送数据 #define AT_INS_CLOSED "AT+CIPCLOSE\r\n" //主动关闭连接 #define AT_INS_CIPSTATUS "AT+CIPSTATUS\r\n" //查询连接状态 diff --git a/source/app/app_task_rfid.c b/source/app/app_task_rfid.c index cb1408f..da28d5e 100644 --- a/source/app/app_task_rfid.c +++ b/source/app/app_task_rfid.c @@ -14,8 +14,8 @@ void L3_task_rfid_init(void) U8 rfid_start_pkg[] = {0xBB,0x00,0x27,0x00,0x03,0x22,0xFF,0xFF,0x4A,0x7E}; U8 rfid_stop_pkg[] = {0xBB,0x00,0x28,0x00,0x00,0x28,0x7E}; -U8 newrfid_start_pkg[] = {0xA0,0x0D,0x01,0x8A,0x00,0x32,0x01,0x32,0x02,0x32,0x03,0x32,0x00,0xFA,0x00}; -U8 newrfid_stop_pkg[] = {0xA0,0x04,0x01,0x74,0x00,0xE7}; +//U8 newrfid_start_pkg[] = {0xA0,0x0D,0x01,0x8A,0x00,0x32,0x01,0x32,0x02,0x32,0x03,0x32,0x00,0xFA,0x00}; +//U8 newrfid_stop_pkg[] = {0xA0,0x04,0x01,0x74,0x00,0xE7}; void L1_enable_rfid() @@ -23,7 +23,7 @@ void L1_enable_rfid() //L0_uart0_sendArray(rfid_start_pkg,10); //L0_uart3_sendArray(rfid_start_pkg,10); //L0_uart0_sendArray(newrfid_start_pkg,15); - L0_uart3_sendArray(newrfid_start_pkg,15); + L0_uart3_sendArray(rfid_start_pkg,15); } void L1_disable_rfid() @@ -31,7 +31,7 @@ void L1_disable_rfid() //L0_uart0_sendArray(rfid_stop_pkg,7); //L0_uart3_sendArray(rfid_stop_pkg,7); //L0_uart0_sendArray(newrfid_stop_pkg,6); - L0_uart3_sendArray(newrfid_stop_pkg,6); + L0_uart3_sendArray(rfid_stop_pkg,6); } #define D_task_rfid_send 0x51 diff --git a/source/app/app_task_tcp.c b/source/app/app_task_tcp.c index 9a31f01..e23134d 100644 --- a/source/app/app_task_tcp.c +++ b/source/app/app_task_tcp.c @@ -40,11 +40,14 @@ void L3_task_tcp_handle(TS_tcp *s) } else { + P55 = 0; L2_task_go(D_task_tcp_switch_next_slaver); } TTSS_Task_step(D_task_tcp_send_modbus_pkg) //发送包 - L3_gm35_send_data((U8*)&s->loopPkg,s->pkglen); + //L3_gm35_send_data((U8*)&s->loopPkg,s->pkglen); + L0_uart4_sendArray((U8*)&s->loopPkg, s->pkglen); + L0_uart0_sendArray((U8*)&s->loopPkg, s->pkglen); s->sendStamp = s_nos_tick.t_1s; if(G.ccmd_slaver_info[s->slaverIndex].mask == 1) { diff --git a/source/app/app_task_tcp_control.c b/source/app/app_task_tcp_control.c index ee9d007..6825915 100644 --- a/source/app/app_task_tcp_control.c +++ b/source/app/app_task_tcp_control.c @@ -32,7 +32,7 @@ void L3_task_tcp_control_handle(TS_tcp_control *s) L2_task_go(D_task_tcp_control_02); TTSS_Task_step(D_task_tcp_control_02) - if(g_at_send_status.conn_ok) + if(/*g_at_send_status.conn_ok*/1) { //3s一次发送数据包 if(s_nos_tick.t_1s - ts_tcp_control.tcp_send_stmp >= 3) diff --git a/source/app/main.c b/source/app/main.c index e834cd3..c81b5ca 100644 --- a/source/app/main.c +++ b/source/app/main.c @@ -125,7 +125,7 @@ void main(void) //----------------------------------------------- //系统主循环 //----------------------------------------------- - + P55 = 1; while(9) { if(1 == s_nos_tick.t1s_heatbeart) @@ -160,7 +160,7 @@ void main(void) L3_UARTcom3_exp_protocol(&s_uart3_rec); //gm35维持连接 - L3_task_gm35_core_handle(); + //L3_task_gm35_core_handle(); //解析串口4协议(gsm模块收到的at响应消息+服务器发送消息) L3_UARTcom4_exp_protocol(&s_uart4_at_rec); diff --git a/source/bsp/bsp_config.c b/source/bsp/bsp_config.c index 10bdc53..0b39d1f 100644 --- a/source/bsp/bsp_config.c +++ b/source/bsp/bsp_config.c @@ -230,7 +230,7 @@ void L1_s2b_gm35(unsigned char sbufreg) { s_uart4_tcp_rec.reg = sbufreg; L1_s2b_PH3(&s_uart4_tcp_rec); - +#if 0 if(0 == s_uart4_tcp_rec.head) { s_uart4_at_rec.reg = sbufreg; @@ -240,6 +240,7 @@ void L1_s2b_gm35(unsigned char sbufreg) { s_uart4_at_rec.head = 0; } +#endif } void L1_uart_tpc_config(void)