| | |
| | | |
| | | #define FIRST_DATA_SHIFT_SIZHU sizeof(SIZHU_V4_PROTOCOL_HEAD_T)//26 |
| | | |
| | | #define FRAME_DATA_MAX 4 //Ò»Ö¡Êý¾Ý×î¶à°üº¬µÄÊý¾ÝÌõÊý |
| | | #define ONCE_REPORT_MAX_NUM 360 //ÏÞÖÆÒ»´ÎÉϱ¨×î¶àÉϱ¨ÌõÊý£¬ 15Ìì*24Ìõ |
| | | #define FRAME_DATA_MAX 6 //Ò»Ö¡Êý¾Ý×î¶à°üº¬µÄÊý¾ÝÌõÊý |
| | | #define DATA_PACKET_HEAD_LENGTH sizeof(SIZHU_V4_PROTOCOL_NORMAL_DATA_HEAD_T) |
| | | #define DATA_PACKET_LENGTH sizeof(SIZHU_V4_PROTOCOL_NORMAL_DATA_PACK_T) |
| | | #define FRAME_TAIL_LENGTH sizeof(SIZHU_V4_PROTOCOL_TAIL_T) |
| | | |
| | | ///////////////ÐÒé¿ØÖÆÂë///////////////////////////////////////////////////////////////////// |
| | | //ÒµÎñ |
| | | #define SIZHU_CONTROL_CODE_DATAUP 0x0101 |
| | | #define SIZHU_CONTROL_CODE_END 0x0102 |
| | | #define SIZHU_CONTROL_CODE_MODIFY_KEY 0x0103 |
| | | #define SIZHU_CONTROL_CODE_PUSH_TERMINAL_INFO 0x0104 |
| | | #define SIZHU_CONTROL_CODE_PUSH_SETTLEMENT_INFO 0x0104 |
| | | |
| | | //¹¦ÄÜ |
| | | #define SIZHU_CONTROL_CODE_ACCOUNT_STATUS 0x0201 |
| | |
| | | uint8_t net_info; // ÍøÂçÐÅÏ¢ |
| | | uint8_t software_version[4]; // Èí¼þ°æ±¾ºÅ |
| | | uint8_t account_state; // ¿ª»§×´Ì¬ |
| | | uint16_t alarm_word[14]; // ±¨¾¯×Ö |
| | | uint16_t alarm_word[7]; // ±¨¾¯×Ö |
| | | uint16_t valve_close_reason; // ¹Ø·§ÔÒò×Ö |
| | | uint8_t reserve[8]; // ±£Áô |
| | | uint8_t data_package_format; // Êý¾Ý°ü¸ñʽ |
| | |
| | | int8_t lith_vcc_per; // ï®µç³Øµçѹ°Ù·Ö±È |
| | | uint8_t alka_vcc; // ¼îµç³Øµçѹ |
| | | int8_t alka_vcc_per; // ¼îµç³Øµçѹ°Ù·Ö±È |
| | | uint16_t status[12]; // ״̬×Ö |
| | | uint16_t status[6]; // ״̬×Ö |
| | | //uint8_t reserved[40]; |
| | | } SIZHU_V4_PROTOCOL_NORMAL_DATA_PACK_T; |
| | | |
| | | |
| | | typedef struct |
| | | { |
| | | uint16_t current_report_data_num; //µ±Ç°Ô¶´«µÄ×ÜÌõÊý£¬²»ÊÇÒ»Ö¡µÄÌõÊý |
| | | uint16_t last_frame_data_num; //×îºóÒ»Ö¡ÌõÊý |
| | | uint32_t report_data_read_addr; //Êý¾Ý¶ÁÈ¡µØÖ· |
| | | |
| | | }SIZHU_V4_REPORT_CTRL_PARA_T; |
| | | |
| | | #pragma pack() |
| | | |
| | | void SizhuV4SendParaInit(void); |
| | | extern ErrorStatus wrc_sizhuV4_result_flag; //×îÖÕµÄͨѶ½á¹ûÅжϣ¬³õʼÖÃFAIL£¬×îÖÕ¸ù¾ÝÐÒéÈ·Èϱ¾´ÎͨѶÊÇ·ñ³É¹¦£¬±ÈÈç˼ÖþµÄÐÒéͨ¹ý½áÊøÖ¡ÅжÏÊÇ·ñ×îÖճɹ¦ |
| | | extern ErrorStatus report_sizhuV4_result_flag; //Éϱ¨ÊÇ·ñ³É¹¦±êÖ¾£¬ÓÃÓÚÒ»ÌìÖ®ÄÚÓÐûÓÐÉÏ´«³É¹¦¹ý£¬¸úwrc_sizhuV4_result_flagͨѶÊÇ·ñ³É¹¦²»Ò»Ñù£¬¿íËÉÒ»µã£¬Ö»ÒªÊý¾ÝÉϱ¨ÏìÓ¦³É¹¦¼´´ú±íÉϱ¨³É¹¦£¬ÊÕµ½½áÊøÖ¡Ò²´ú±í³É¹¦¡£ |
| | | |
| | | WRC_STATUS SizhuV4ProtocolDataAnalysis(uint8_t *receive_buf); |
| | | void SizhuV4SendParaInit(void); |
| | | uint16_t SizhuV4SendNormalData2buf(uint8_t * send_buf); |
| | | WRC_STATUS SizhuV4ProtocolDataAnalysis(uint8_t *receive_buf,uint8_t *ack_buf,uint16_t *ack_buf_length); |
| | | |
| | | #endif |