|
@@ -29,7 +29,7 @@
|
|
|
#include "md5c.h"
|
|
|
#include "cmsis_os.h"
|
|
|
#include "func_ram_record.h"
|
|
|
-#include "func_fatfs_record.h"
|
|
|
+#include "func_queue_record.h"
|
|
|
/* Private macro------------------------------------------------------------------------------*/
|
|
|
/* Private typedef----------------------------------------------------------------------------*/
|
|
|
#pragma pack(1)
|
|
@@ -48,6 +48,7 @@ typedef struct JT808_DATA_OBJ
|
|
|
uint32_t back_cnt; //接收超时计数
|
|
|
uint32_t link_cnt; //连接计数器
|
|
|
uint32_t link_ok; //连接标志位
|
|
|
+
|
|
|
|
|
|
SEND_DATA_UNIT_STC send_data;
|
|
|
}JT808_DATA_OBJ;
|
|
@@ -667,11 +668,23 @@ void jt808_recv_func_DataBack(uint8_t * buf ,uint8_t len)
|
|
|
memset((void *)&(jt808_obj.send_data), 0x00, sizeof(jt808_obj.send_data));
|
|
|
|
|
|
|
|
|
+#if USE_QUEUE_RECORD==1
|
|
|
+ if(func_record_queue_flash_get() == true)
|
|
|
+ {
|
|
|
+ read_len = func_record_queue_read((void *)&(jt808_obj.send_data), (uint32_t)DATA_UNIT_SIZE);
|
|
|
+ }
|
|
|
+ else
|
|
|
+#endif
|
|
|
+
|
|
|
#if USE_RAM_RECORD==1
|
|
|
- //从内存数据栈中读取缓冲数据
|
|
|
- read_len = func_ram_record_delete((void *)&(jt808_obj.send_data), DATA_UNIT_SIZE);
|
|
|
-#elif USE_QUEUE_RECORD==1
|
|
|
- //read_len = func_record_queue_read((void *)&(jt808_obj.send_data), (uint32_t)DATA_UNIT_SIZE);
|
|
|
+ {
|
|
|
+ //从内存数据栈中读取缓冲数据
|
|
|
+ read_len = func_ram_record_delete((void *)&(jt808_obj.send_data), DATA_UNIT_SIZE);
|
|
|
+ }
|
|
|
+#else
|
|
|
+ {
|
|
|
+ ;
|
|
|
+ }
|
|
|
#endif
|
|
|
|
|
|
if( read_len != DATA_UNIT_SIZE)
|
|
@@ -726,11 +739,23 @@ void jt808_save_send_data(uint8_t * buf ,uint16_t len)
|
|
|
|
|
|
if(jt808_obj.send_data.flowID != 0)
|
|
|
{
|
|
|
-#if USE_RAM_RECORD==1
|
|
|
- func_ram_record_write((uint8_t *)&(jt808_obj.send_data) , DATA_UNIT_SIZE);
|
|
|
-#elif USE_QUEUE_RECORD==1
|
|
|
- //func_record_queue_write((uint8_t *)&(jt808_obj.send_data) , DATA_UNIT_SIZE);
|
|
|
-#endif
|
|
|
+
|
|
|
+#if USE_QUEUE_RECORD==1
|
|
|
+ if(func_record_queue_flash_get() == true)
|
|
|
+ {
|
|
|
+ func_record_queue_write((uint8_t *)&(jt808_obj.send_data) , DATA_UNIT_SIZE);
|
|
|
+ }
|
|
|
+ else
|
|
|
+#endif
|
|
|
+#if USE_RAM_RECORD==1
|
|
|
+ {
|
|
|
+ func_ram_record_write((uint8_t *)&(jt808_obj.send_data) , DATA_UNIT_SIZE);
|
|
|
+ }
|
|
|
+#else
|
|
|
+ {
|
|
|
+ ;
|
|
|
+ }
|
|
|
+#endif
|
|
|
|
|
|
memset((void *)&(jt808_obj.send_data), 0x00, sizeof(jt808_obj.send_data));
|
|
|
}
|