123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- /********************************************************************************
- * File Name: ProductPara.h
- * Function Describe: Header file for ProductPara.c
- * Explain:
- * Writer: ShiLiangWen
- * Date: 2015-7-6
- *******************************************************************************/
- #ifndef __PRODUCT_PARA_H
- #define __PRODUCT_PARA_H
- /*=============================================================================*/
- //产品相关
- #define PRODUCT_NAME "HS121LG1" //产品型号名,字符串长度不能大于13个字符
- #define PRODUCT_VERSION 1302 //114以后版本参数区有很大变动,IAP也变化了,使用IAP_V2.0
- //IAP相关
- #define STM32_FLASH_SIZE 128 //所选STM32的FLASH容量大小(单位为K)
- #define STM32_RAM_SIZE 16
- #define STM32_FLASH_BASE 0x08000000 //STM32 FLASH的起始地址
- #define MCU_FLAG 144 // //MCU标志 128+16
- #define APP_CONFIG_ADDR 0x08003C00 //0x08003C00~0x0804000 为系统参数区 1K
- #define NEW_CONFIG_ADDR 0x0801FC00 //APP的最后1K,第127K,除去IAP+参数区1共16K后,APP只能有111K(1BC00),在工程配置里要限制防止代码溢出
- //使能空中升级
- #define FOTA_ENABLE
- //通讯模块相关
- enum {MODEM_TYPE_NONE=0,MODEM_TYPE_MG2639,MODEM_TYPE_MC8332,MODEM_TYPE_EVDO,MODEM_TYPE_WCDMA,MODEM_TYPE_M9507};
- 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};
- #define MODEM_ENABLE
- #define MODEM_TYPE MODEM_TYPE_MC8332
- //GPS相关
- #define GPS_VIRTUAL_VALUE 0 //GPS将产生假定位信号
- #define GPS_TYPE GPS_TYPE_GP
- //服务器相关 默认
- #define POC_SERVER_PORT 1390
- #define FOTA_SERVER_PORT 1393
- #define GPS_SERVER_PORT 1395//布标口
- //VPN
- #define APN_APN "ctnet"
- #define APN_NAME "card"
- #define APN_PASSWORD "card"
- #define FOTA_IAP_IP0 120
- #define FOTA_IAP_IP1 77
- #define FOTA_IAP_IP2 66
- #define FOTA_IAP_IP3 129
- #define FOTA_IAP_PORT 9137
- //集群
- #define DEFAULT_LOAD_PORT 2003
- //配置服务器
- #define DEFAULT_CONFIG_PORT 2005
- //芯片大小检验标识
- #define FLASH_FIXED_WORD 0x29D4
- //----------------------------------------------------------
- #define SPECALL_CTR 1 //增强按PTT体验
- #define USE_HIGOS_PRO 0 //是否使用负载均衡功能
- #define USE_CONFIG_FUN 0 //是否使用配置服务器功能
- #define APN_LEN 30
- #define APNNAME_LEN 15 //不能修改 除非改IAP
- #define APNPASS_LEN 15 //不能修改 除非改IAP
- typedef struct SUT_PRODUCT_PARA
- {//相对静态变量:只有串口配置时有可能修改,正常运行过程中不修改的参数
- //IAP通用段
- char FoTaMark[4];//空中升级标识符,当为"FoTa"时执行空中升级,IAP需要从外部FLASH拷贝APP到MCU中,并修改Mark为"FTOK"后运行APP
- unsigned char MD5[16];//APP程序数据的MD5
- unsigned long ExAddr;//外部FLASH中APP数据存储的开始地址
- unsigned long AppLen;//App数据长度
-
- unsigned char Rand;//在使用串口进行加密时会用到
- unsigned long PSN;
- char ProductName[14];//项目名
- unsigned short ProductVersion; //版本号
- /////以下为App自定义使用段,前面的不能修改
- unsigned char McuFlag; //MCU标识 101 --STM32F101CB
- unsigned char ModemType; //Modem类型:0-无Modem 1-GSM 2-CDMA
- 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)
- char IMEI[16];
- char MEID[16];
- char APNName[APNNAME_LEN+1]; //APN
- char APNPass[APNPASS_LEN+1]; //APN Password
- char APNApn[APN_LEN+1];
- unsigned char g_net;
-
- }__attribute__((packed)) SUT_PRODUCT_PARA;
- //以下参数是改布标新增的
- //另外开辟1K来保存
- //因为此软件对应该的IAP参数区就限制了上面参数区大小
- //后面增加的都会在更新APP后刷成ff
- typedef struct
- {//相对动太量,运行过程中会被修改的
- unsigned char ManagerIP[4];
- unsigned short ManagerPort;
- unsigned char ConfigSerIP[4];
- unsigned short ConfigSerPort;
- unsigned short PocPort;
- unsigned short GpsPort;
- unsigned char PIP[4];
- unsigned char GIP[4];
- /////////////鉴权部分//////////////
- unsigned char Select;
- char AutH[7];
- unsigned short proID;//省域ID 16byte
- unsigned short CityID;//市域ID 16byte
- char Manufacturers[10];//制造商
- char TerMod[42];//终端型号 不足补0x00
- char TerID[28];//终端ID 不足补0x00 本来7个字节 为了跟星安一致 取4个字节 4 8 16
- unsigned char PlateColor;//车牌颜色
- char Plate[18];
- char SIM[12];
- unsigned char SIMFlag;
- //////////////////////////////////////
- unsigned short flashCheckWord;//用来检测此芯片是否有128K内容
- unsigned char HARDID[16];
- unsigned char SendGpsTime;
- //unsigned char dummy;//用来确定是偶数用的
- }__attribute__((packed)) SUT_NEW_SEGMENT_PARA;
- extern SUT_PRODUCT_PARA sutProductPara;
- extern SUT_NEW_SEGMENT_PARA sutNewSegmentPara;
- extern unsigned char startFlashPro;
- void ReadProductParaFromFlash(void);
- void SaveProductParaToFlash(void);
- void SaveNewSegmentToFlash();
- /*=============================================================================*/
- #endif
- /************************************file begin*******************************/
|