Browse Source

增加域名解析和GPS累计里程上报。测试-

CHENJIE-PC\QiXiang_CHENJIE 3 years ago
parent
commit
b7a8a86406
4 changed files with 15 additions and 7 deletions
  1. 1 1
      inc/GpsTask.h
  2. 6 3
      inc/TcpTask.h
  3. 6 1
      src/GpsTask.c
  4. 2 2
      src/MainTask.c

+ 1 - 1
inc/GpsTask.h

@@ -7,6 +7,6 @@
  *
  ****************************************************************************/
 //
-extern UINT8 GpsData[16];
+extern UINT8 GpsData[20];
 extern osMutexId_t GpsMutex;
 INT32 GpsTaskInit(void);

+ 6 - 3
inc/TcpTask.h

@@ -21,13 +21,16 @@ extern UINT32 TcpService;
 #define CHRG_END_DELAY    (300)
 #define RUN_END_DELAY    (100)
 
-#define QX_TCP_IPADRRES				"47.97.127.222"
+
+#define QX_TCP_ADD              "iotp.fast-fun.cn"
 #define QX_TCP_PORT					8712
+// #define QX_TCP_IPADRRES				"47.97.127.222"
+// #define QX_TCP_PORT					8712
 /*---------------测试IP地址-----------------------------------*/
 // #define QX_TCP_IPADRRES				"39.103.177.126"
 // #define QX_TCP_PORT					8712
-// #define QX_TCP_IPADRRES				"120.26.68.165"
-// #define QX_TCP_PORT					14319
+// #define QX_TCP_ADD 				"rpi.it5000.com"
+// #define QX_TCP_PORT					8812
 /*---------------测试IP地址END-----------------------------------*/
 #define BATT_SN_LEN             17
 #define TCP_START_SYM1			0x23

+ 6 - 1
src/GpsTask.c

@@ -34,7 +34,7 @@ extern volatile BOOL Sleep_flag;
 extern AppDataBody AppDataInfo;
 extern UINT8 WorkFlag;
 //全局变量区输出
-UINT8 GpsData[16];
+UINT8 GpsData[20];
 osMutexId_t GpsMutex = NULL;
 //线程定义区
 #define GPS_TASK_STACK_SIZE   								 (512)
@@ -109,6 +109,7 @@ static void GpsTask(void* arg)
                     GpsData[13] = longitude>>16;
                     GpsData[14] = longitude>>8;
                     GpsData[15] = longitude;
+
                     GpsData[6] = 0x03;
                     GpsData[7] = 0xE8;
                     if(speedtemp>=50)//大于5km/h才输出方位
@@ -132,6 +133,10 @@ static void GpsTask(void* arg)
                         }
 
                     }
+                    GpsData[16] = AppDataInfo.AccMileage>>24;
+                    GpsData[17] = AppDataInfo.AccMileage>>16;
+                    GpsData[18] = AppDataInfo.AccMileage>>8;
+                    GpsData[19] = AppDataInfo.AccMileage;
                 }
             }
         osMutexRelease(GpsMutex);

+ 2 - 2
src/MainTask.c

@@ -36,7 +36,7 @@
 extern UINT8 	UDSSwitch;
 extern volatile bool NB_Fota_update_flag;
 extern volatile bool BMS_Fota_update_flag;
-CHAR defaultBattSN[BATT_SN_LEN] = "00000000000000000";//未进行下线检测的默认SN
+CHAR defaultBattSN[BATT_SN_LEN] = "RLTEST00000000001";//未进行下线检测的默认SN
 //全局变量
 UINT32 Timer_count;//每100ms加1
 volatile BOOL Sleep_flag = false;//睡眠标志位
@@ -793,7 +793,7 @@ static void setDefaultAppDataInfo(void)
     AppDataInfo.GpsDisChrgInfoSendFreq = 5;
     AppDataInfo.BattCurrentNegFlag = 1;
     AppDataInfo.CumulativeCapacity = 0;
-    AppDataInfo.AccMileage = 0;
+    AppDataInfo.AccMileage = 65535;
     return;
 }