| | |
| | | #define MSG_WTAG 6 |
| | | #define MSG_PWTAG 8 |
| | | #define MSG_REGTAGRESPONSE 0x0b |
| | | #define MSG_TAGPOS 0x0D |
| | | |
| | | #define CMD_READ 1 |
| | | #define CMD_WRITE 2 |
| | |
| | | |
| | | UART_PushFrame(send_frame, data_length+9); |
| | | } |
| | | u8 remotetag_para[30],remotetag_paralen; |
| | | u8 remotetag_para[30],remotetag_paralen,userdatasend_flag[TAG_NUM_IN_SYS]; |
| | | u8 remotesend_state=0; |
| | | uint16_t configremotetagID,rec_times1,rec_times2; |
| | | struct regtag_structure regtag_map; |
| | | extern u16 taglist_pos; |
| | | struct tagpos_structure tagpos[30]; |
| | | void UsartParseDataHandler(uint8_t data) |
| | | { |
| | | static UsartRecvPackState usart_receive_state = UsartReceiveWaitHead0; |
| | |
| | | { |
| | | switch(pack_msgtype) |
| | | { |
| | | uint16_t serial_tag_id_recv; |
| | | case MSG_RW: |
| | | pack_cmd = mUsartReceivePack[0]; |
| | | pack_index = mUsartReceivePack[1]; |
| | |
| | | memcpy(®tag_map.tag_frequency[regtag_map.index],&mUsartReceivePack[2],2); |
| | | memcpy(®tag_map.tag_slotpos[regtag_map.index],&mUsartReceivePack[4],2); |
| | | break; |
| | | case MSG_TAGPOS: |
| | | memcpy(&serial_tag_id_recv,&mUsartReceivePack[0],2); |
| | | taglist_pos=CmpTagInList(serial_tag_id_recv); |
| | | tagpos[taglist_pos].tagid = serial_tag_id_recv; |
| | | tagpos[taglist_pos].datalen = mUsartReceivePack[2]; |
| | | if(mUsartReceivePack[2]<=MAX_FRAME_LEN&&taglist_pos<30) |
| | | { |
| | | userdatasend_flag[taglist_pos] = 1; |
| | | memcpy(&tagpos[taglist_pos].data,&mUsartReceivePack[3],mUsartReceivePack[2]); |
| | | } |
| | | break; |
| | | } |
| | | SendConfigConfirm(pack_msgtype,pack_length); |
| | | } |