ProductPara.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /********************************************************************************
  2. * File Name: ProductPara.h
  3. * Function Describe: Header file for ProductPara.c
  4. * Explain:
  5. * Writer: ShiLiangWen
  6. * Date: 2015-7-6
  7. *******************************************************************************/
  8. #ifndef __PRODUCT_PARA_H
  9. #define __PRODUCT_PARA_H
  10. /*=============================================================================*/
  11. //产品相关
  12. #define PRODUCT_NAME "HS121LG1" //产品型号名,字符串长度不能大于13个字符
  13. #define PRODUCT_VERSION 1302 //114以后版本参数区有很大变动,IAP也变化了,使用IAP_V2.0
  14. //IAP相关
  15. #define STM32_FLASH_SIZE 128 //所选STM32的FLASH容量大小(单位为K)
  16. #define STM32_RAM_SIZE 16
  17. #define STM32_FLASH_BASE 0x08000000 //STM32 FLASH的起始地址
  18. #define MCU_FLAG 144 // //MCU标志 128+16
  19. #define APP_CONFIG_ADDR 0x08003C00 //0x08003C00~0x0804000 为系统参数区 1K
  20. #define NEW_CONFIG_ADDR 0x0801FC00 //APP的最后1K,第127K,除去IAP+参数区1共16K后,APP只能有111K(1BC00),在工程配置里要限制防止代码溢出
  21. //使能空中升级
  22. #define FOTA_ENABLE
  23. //通讯模块相关
  24. enum {MODEM_TYPE_NONE=0,MODEM_TYPE_MG2639,MODEM_TYPE_MC8332,MODEM_TYPE_EVDO,MODEM_TYPE_WCDMA,MODEM_TYPE_M9507};
  25. enum {GPS_TYPE_NULL=0,GPS_TYPE_GP,GPS_TYPE_BD,GPS_TYPE_GPBD,GPS_TYPE_GPGL,GPS_TYPE_BDGL,GPS_TYPE_GPBDGL,GPS_TYPE_MODE};
  26. #define MODEM_ENABLE
  27. #define MODEM_TYPE MODEM_TYPE_MC8332
  28. //GPS相关
  29. #define GPS_VIRTUAL_VALUE 0 //GPS将产生假定位信号
  30. #define GPS_TYPE GPS_TYPE_GP
  31. //服务器相关 默认
  32. #define POC_SERVER_PORT 1390
  33. #define FOTA_SERVER_PORT 1393
  34. #define GPS_SERVER_PORT 1395//布标口
  35. //VPN
  36. #define APN_APN "ctnet"
  37. #define APN_NAME "card"
  38. #define APN_PASSWORD "card"
  39. #define FOTA_IAP_IP0 120
  40. #define FOTA_IAP_IP1 77
  41. #define FOTA_IAP_IP2 66
  42. #define FOTA_IAP_IP3 129
  43. #define FOTA_IAP_PORT 9137
  44. //集群
  45. #define DEFAULT_LOAD_PORT 2003
  46. //配置服务器
  47. #define DEFAULT_CONFIG_PORT 2005
  48. //芯片大小检验标识
  49. #define FLASH_FIXED_WORD 0x29D4
  50. //----------------------------------------------------------
  51. #define SPECALL_CTR 1 //增强按PTT体验
  52. #define USE_HIGOS_PRO 0 //是否使用负载均衡功能
  53. #define USE_CONFIG_FUN 0 //是否使用配置服务器功能
  54. #define APN_LEN 30
  55. #define APNNAME_LEN 15 //不能修改 除非改IAP
  56. #define APNPASS_LEN 15 //不能修改 除非改IAP
  57. typedef struct SUT_PRODUCT_PARA
  58. {//相对静态变量:只有串口配置时有可能修改,正常运行过程中不修改的参数
  59. //IAP通用段
  60. char FoTaMark[4];//空中升级标识符,当为"FoTa"时执行空中升级,IAP需要从外部FLASH拷贝APP到MCU中,并修改Mark为"FTOK"后运行APP
  61. unsigned char MD5[16];//APP程序数据的MD5
  62. unsigned long ExAddr;//外部FLASH中APP数据存储的开始地址
  63. unsigned long AppLen;//App数据长度
  64. unsigned char Rand;//在使用串口进行加密时会用到
  65. unsigned long PSN;
  66. char ProductName[14];//项目名
  67. unsigned short ProductVersion; //版本号
  68. /////以下为App自定义使用段,前面的不能修改
  69. unsigned char McuFlag; //MCU标识 101 --STM32F101CB
  70. unsigned char ModemType; //Modem类型:0-无Modem 1-GSM 2-CDMA
  71. unsigned char GpsType; //GPS类型:0-无GPS 1-GP 2-BD 4-GL 3-GP+BD 5-GP+GL 6-BD+GL 7-GP+BD+GL (GP=Gps,BD=Beidou,GL=Glonass)
  72. char IMEI[16];
  73. char MEID[16];
  74. char APNName[APNNAME_LEN+1]; //APN
  75. char APNPass[APNPASS_LEN+1]; //APN Password
  76. char APNApn[APN_LEN+1];
  77. unsigned char g_net;
  78. }__attribute__((packed)) SUT_PRODUCT_PARA;
  79. //以下参数是改布标新增的
  80. //另外开辟1K来保存
  81. //因为此软件对应该的IAP参数区就限制了上面参数区大小
  82. //后面增加的都会在更新APP后刷成ff
  83. typedef struct
  84. {//相对动太量,运行过程中会被修改的
  85. unsigned char ManagerIP[4];
  86. unsigned short ManagerPort;
  87. unsigned char ConfigSerIP[4];
  88. unsigned short ConfigSerPort;
  89. unsigned short PocPort;
  90. unsigned short GpsPort;
  91. unsigned char PIP[4];
  92. unsigned char GIP[4];
  93. /////////////鉴权部分//////////////
  94. unsigned char Select;
  95. char AutH[7];
  96. unsigned short proID;//省域ID 16byte
  97. unsigned short CityID;//市域ID 16byte
  98. char Manufacturers[10];//制造商
  99. char TerMod[42];//终端型号 不足补0x00
  100. char TerID[28];//终端ID 不足补0x00 本来7个字节 为了跟星安一致 取4个字节 4 8 16
  101. unsigned char PlateColor;//车牌颜色
  102. char Plate[18];
  103. char SIM[12];
  104. unsigned char SIMFlag;
  105. //////////////////////////////////////
  106. unsigned short flashCheckWord;//用来检测此芯片是否有128K内容
  107. unsigned char HARDID[16];
  108. unsigned char SendGpsTime;
  109. //unsigned char dummy;//用来确定是偶数用的
  110. }__attribute__((packed)) SUT_NEW_SEGMENT_PARA;
  111. extern SUT_PRODUCT_PARA sutProductPara;
  112. extern SUT_NEW_SEGMENT_PARA sutNewSegmentPara;
  113. extern unsigned char startFlashPro;
  114. void ReadProductParaFromFlash(void);
  115. void SaveProductParaToFlash(void);
  116. void SaveNewSegmentToFlash();
  117. /*=============================================================================*/
  118. #endif
  119. /************************************file begin*******************************/