*****************************************
修改日期:2025-04-15 修改版本 V0.00037 1-根据大连金海的协议修改 2-根据大连金海的逻辑修改 *******************************************
This commit is contained in:
parent
bf00e32fee
commit
079d590934
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,53 +0,0 @@
|
|||
#MyEclipse Usage Data
|
||||
#Wed May 07 16:02:08 CST 2025
|
||||
bundle/com.genuitec.eclipse.theming.css=-1
|
||||
view/org.eclipse.debug.ui.MemoryView=1
|
||||
misc/ws=win32
|
||||
misc/core_version=<unknown>
|
||||
misc/eclipseVersion/4.10.0.v20211027-1200=1
|
||||
misc/timestamp=2025-5-7 8\:02\:08
|
||||
view/org.eclipse.tm.terminal.view.ui.TerminalsView=1
|
||||
editor/org.rt-thread.studio.lds.edit.editor=2
|
||||
bundle/com.genuitec.eclipse.theming.base.win=-1
|
||||
misc/productType/devstyle=1
|
||||
misc/arch=x86_64
|
||||
view/org.eclipse.search.ui.views.SearchView=79
|
||||
perspective/org.eclipse.debug.ui.DebugPerspective=4
|
||||
perspective/org.eclipse.cdt.ui.CPerspective=8
|
||||
editor/org.eclipse.cdt.ui.editor.CEditor=70
|
||||
bundle/com.genuitec.eclipse.inlinesearch=16
|
||||
bundle/com.genuitec.eclipsecolortheme.api=20
|
||||
misc/installmode/standalone=0
|
||||
view/org.eclipse.cdt.debug.ui.executablesView=1
|
||||
bundle/com.genuitec.eclipse.startup=16
|
||||
view/org.eclipse.ui.internal.introview=1
|
||||
misc/workspace_hash=-2110056900
|
||||
bundle/com.genuitec.eclipse.core.common.platform=20
|
||||
devstyle/state/workbenchColor/Dark_Gray=1
|
||||
bundle/com.genuitec.eclipse.monitor=16
|
||||
misc/product/org.rt-thread.studio.application.product=1
|
||||
bundle/com.genuitec.eclipse.ui.common.platform=20
|
||||
misc/count=20
|
||||
devstyle/state/inlinesearch=1
|
||||
devstyle/state/editorColor/Darkest_Dark=1
|
||||
view/org.eclipse.ui.views.ProblemView=4
|
||||
bundle/com.genuitec.eclipse.theming.scrollbar=16
|
||||
misc/locale=zh_CN
|
||||
bundle/com.genuitec.eclipse.theming.scrollbar.win=-1
|
||||
misc/os=win32
|
||||
bundle/com.genuitec.eclipse.theming.base=16
|
||||
devstyle/state/enabled=1
|
||||
misc/period=26133854
|
||||
view/org.eclipse.ui.console.ConsoleView=9
|
||||
bundle/com.genuitec.eclipse.theming.epl=-1
|
||||
devstyle/state/iconsColor/primary=1
|
||||
bundle/com.genuitec.eclipse.theming.core=16
|
||||
view/org.eclipse.cdt.debug.ui.debuggerConsoleView=1
|
||||
bundle/com.genuitec.eclipse.webclipse.evergreen=16
|
||||
bundle/com.genuitec.eclipse.theming.ui=16
|
||||
bundle/com.genuitec.eclipse.meexplorer=16
|
||||
misc/installmode/stable=0
|
||||
view/org.eclipse.ui.navigator.ProjectExplorer=32
|
||||
bundle/com.genuitec.eclipse.startup.workspace=16
|
||||
bundle/com.genuitec.eclipse.patches=20
|
||||
bundle/com.genuitec.eclipse.webicons=20
|
|
@ -1,14 +0,0 @@
|
|||
*** SESSION 4月 09, 2025 16:56:20.78 --------------------------------------------
|
||||
*** SESSION 4月 10, 2025 09:36:59.16 --------------------------------------------
|
||||
*** SESSION 4月 15, 2025 11:08:06.07 --------------------------------------------
|
||||
*** SESSION 4月 15, 2025 15:04:53.10 --------------------------------------------
|
||||
*** SESSION 4月 16, 2025 08:56:31.27 --------------------------------------------
|
||||
*** SESSION 4月 23, 2025 15:16:52.20 --------------------------------------------
|
||||
*** SESSION 4月 23, 2025 15:17:28.55 --------------------------------------------
|
||||
*** SESSION 4月 24, 2025 13:10:33.34 --------------------------------------------
|
||||
*** SESSION 4月 25, 2025 08:54:06.80 --------------------------------------------
|
||||
*** SESSION 4月 27, 2025 09:30:48.13 --------------------------------------------
|
||||
*** SESSION 4月 28, 2025 14:14:55.04 --------------------------------------------
|
||||
*** SESSION 4月 29, 2025 15:45:21.98 --------------------------------------------
|
||||
*** SESSION 5月 06, 2025 16:52:29.39 --------------------------------------------
|
||||
*** SESSION 5月 07, 2025 15:50:41.33 --------------------------------------------
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="org.eclipse.cdt.ui.text.hover.CMacroExpansionExploration.internal">
|
||||
<item value="180" key="size.height"/>
|
||||
<item value="814" key="size.width"/>
|
||||
</section>
|
||||
<section name="org.eclipse.cdt.ui.text.hover.CMacroExpansionExploration">
|
||||
</section>
|
||||
<section name="completion_proposal_size">
|
||||
</section>
|
||||
</section>
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -1,112 +0,0 @@
|
|||
#ifndef __APP_IOT_AT_H
|
||||
#define __APP_IOT_AT_H
|
||||
|
||||
#include "app_user.h"
|
||||
#include "app_iot_ctl.h"
|
||||
|
||||
//AT任务事件
|
||||
typedef enum
|
||||
{
|
||||
I_AT_IDLE = 1 << 0,
|
||||
I_AT_SEND = 1 << 1,
|
||||
I_AT_WAIT = 1 << 2,
|
||||
I_AT_TIMEOUT = 1 << 3,
|
||||
I_AT_FINISH = 1 << 4,
|
||||
I_AT_FAIL = 1 << 5,
|
||||
}IOT_AT_EVENT_T;
|
||||
|
||||
|
||||
/*
|
||||
* 命令MB26A
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
I_AT_NULL = 0,
|
||||
I_AT,
|
||||
I_ATE,
|
||||
I_BAND,
|
||||
I_URC,
|
||||
I_CSCON,
|
||||
I_ATQ0,
|
||||
I_CGSN,
|
||||
I_CGMR,
|
||||
I_CCID,
|
||||
I_CEREG,
|
||||
I_CSQ,
|
||||
I_CGPADDR,
|
||||
I_BCINFO,
|
||||
I_ECCESQS,
|
||||
//I_DNS,
|
||||
I_NTP,
|
||||
I_CREATE,
|
||||
I_CONNECT,
|
||||
//I_STATUS,
|
||||
I_SEND,
|
||||
//I_DELETE,
|
||||
I_FINISH
|
||||
|
||||
}iot_cmd_list_t;
|
||||
|
||||
|
||||
/*
|
||||
* ML307R
|
||||
*/
|
||||
//typedef enum
|
||||
//{
|
||||
// I_AT_NULL = 0,
|
||||
// I_AT,
|
||||
// I_ATE,
|
||||
// I_BAND,
|
||||
// I_BAND1,
|
||||
//
|
||||
// I_ATI,
|
||||
// I_CGSN,
|
||||
// I_CCID,
|
||||
// I_CEREG,
|
||||
// I_CSQ,
|
||||
// I_CGPADDR,
|
||||
// I_CESQ,
|
||||
// I_PCI,
|
||||
// I_NTP,
|
||||
// I_ENCOD,
|
||||
//
|
||||
// I_CONNECT,
|
||||
// I_SEND,
|
||||
// I_FINISH
|
||||
//
|
||||
//}iot_cmd_list_t;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 控制
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
iot_cmd_list_t i_cur_cmd;//当前指令
|
||||
uint8_t* i_send;//发送指令
|
||||
uint8_t* i_ack;//应答数据
|
||||
int i_wait_time;//等待时间
|
||||
int i_try_cnt;//重试次数
|
||||
uint8_t (*i_recv_deal)(uint8_t* data, uint8_t len);//处理数据
|
||||
}iot_dev_state_t;
|
||||
|
||||
|
||||
uint8_t i_default_deal(char* data, uint8_t len);
|
||||
uint8_t i_send_buff_deal(char* data, uint8_t len);
|
||||
uint8_t i_csq_deal(char* data, uint8_t len);
|
||||
uint8_t i_rtc_deal(char* data, uint8_t len);
|
||||
uint8_t i_rtc_deal_1(char* data, uint8_t len);
|
||||
uint8_t i_ciinfo_deal(char* data, uint8_t len);
|
||||
uint8_t i_snr_deal(char* data, uint8_t len);
|
||||
uint8_t i_ccid_deal(char* data, uint8_t len);
|
||||
uint8_t i_imei_deal(char* data, uint8_t len);
|
||||
uint8_t iot_at_imei_gain(void);
|
||||
uint8_t i_connect_deal(char* data, uint8_t len);
|
||||
uint8_t i_cesq_deal(char* data, uint8_t len);
|
||||
uint8_t i_pci_deal(char* data, uint8_t len);
|
||||
|
||||
|
||||
uint8_t i_socket_creat_deal(char* data, uint8_t len);
|
||||
|
||||
#endif
|
|
@ -1,128 +0,0 @@
|
|||
#ifndef __APP_IOT_CTL_H
|
||||
#define __APP_IOT_CTL_H
|
||||
|
||||
#include "app_user.h"
|
||||
|
||||
#define IOT_USE_MB26A (1)
|
||||
#define IOT_USE_ML307 (0)
|
||||
|
||||
#define IOT_IP_MAX_LENGTH (45)
|
||||
#define IOT_IP_LENGTH (6)
|
||||
|
||||
#define NB_OPEN_ERR (10) //NB失败重试次数
|
||||
#define NB_OPEN_SUCC (100) //NB启动成功
|
||||
|
||||
#define NB_OTA_REQUEST_CNT (0) //升级请求
|
||||
#define NB_OTA_REQUEST_SUCC (10) //升级请求成功
|
||||
|
||||
#define NB_TEMPERATURE_LOW (-400)
|
||||
#define NB_TEMPERATURE_HIGH (700)
|
||||
|
||||
#define NB_METHANE_FILTRATION (50)
|
||||
|
||||
#define NB_SOCKET_FILE_D (0)
|
||||
typedef enum
|
||||
{
|
||||
CMD_COLLECT = 0,
|
||||
CMD_DOWN_ACK,
|
||||
CMD_VERSION,
|
||||
CMD_OTA_MESSAGE,
|
||||
CMD_OTA_STATE,
|
||||
CMD_OTA_LOSE,
|
||||
}IOT_UP_CMD_T;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
I_POWERON = 0,
|
||||
I_WORK,
|
||||
I_SLEEP,
|
||||
I_ALARM
|
||||
}IOT_RUN_STATE_T;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
I_CMD_IDLE = 0,
|
||||
I_CMD_POWER ,
|
||||
I_CMD_SEND ,
|
||||
I_CMD_SEND_ALARM,
|
||||
I_CMD_WAIT ,
|
||||
I_CMD_OTA_MESSAGE ,
|
||||
I_CMD_OTA_READY ,
|
||||
}IOT_SEND_CMD_T;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
I_LWM2M = 0,
|
||||
I_TCP_IP,
|
||||
}I_MODULE_TYPE_T;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
IOT_RUN_STATE_T i_run_ste;//推送AT状态
|
||||
IOT_SEND_CMD_T i_send_cmd;//发送命令
|
||||
|
||||
uint8_t i_alarm_up_flag;//报警上传
|
||||
uint8_t i_alarm_flag;//报警
|
||||
|
||||
uint16_t i_w_packet;//累积包数
|
||||
uint16_t i_w_packet_alarm;//累计报警的包数
|
||||
uint16_t i_w_packet_alarm_save;//累计报警的包数保存
|
||||
|
||||
|
||||
uint8_t i_w_flag;//写入标志
|
||||
|
||||
uint8_t i_module;//云平台
|
||||
|
||||
uint8_t i_rtc_up_flag;//rtc上传
|
||||
|
||||
uint8_t i_dev_work;//传感器工作
|
||||
uint8_t i_bt_work;//BT触发传感器
|
||||
|
||||
uint8_t i_nb_err;//NB启动异常计数
|
||||
uint8_t i_ota_request;//升级请求
|
||||
|
||||
}iot_control_t;
|
||||
|
||||
|
||||
|
||||
//EVT任务事件
|
||||
typedef enum
|
||||
{
|
||||
I_EVT_IDLE = 0,//空闲
|
||||
I_EVT_POWERON = 1,//电源上电事件
|
||||
|
||||
I_EVT_RET_SUCC = 2,//返回成功事件
|
||||
I_EVT_RET_FAIL = 3,//返回失败事件
|
||||
|
||||
I_EVT_UPDATA_SUCC = 4,//上传成功事件
|
||||
I_EVT_UPDATA_FAIL = 5,//上传失败事件
|
||||
|
||||
I_EVT_RTC = 6,//RTC触发事件
|
||||
I_EVT_SEND_ONCE = 7,//单次事件
|
||||
I_EVT_SEND_MORE = 8,//多次事件
|
||||
I_EVT_SEND_ALARM = 9,//报警事件
|
||||
|
||||
I_EVT_DOEN_ACK = 10,//下行应答
|
||||
I_EVT_VERSION = 11,//版本信息
|
||||
|
||||
I_EVT_SENSOR_REC = 12,//传感器反馈结果事件
|
||||
I_EVT_SENSOR_SEND = 13,//传感器控制参数事件
|
||||
|
||||
I_EVT_OTA_SEND = 14,//升级请求
|
||||
I_EVT_OTA_START = 15,//升级开始
|
||||
|
||||
I_EVT_SLEEP = 16,//休眠
|
||||
I_EVT_WAIT_NETWORK = 17,//等待NB入网
|
||||
|
||||
}IOT_EVT_EVENT_T;
|
||||
|
||||
|
||||
|
||||
|
||||
extern iot_control_t iot_ctl;
|
||||
void iot_parameter_init(void);
|
||||
|
||||
|
||||
#endif
|
|
@ -1,434 +0,0 @@
|
|||
#include "app_dev.h"
|
||||
|
||||
|
||||
/*
|
||||
* 设备参数
|
||||
*/
|
||||
device_parameter_t dev_par ={0};
|
||||
/*
|
||||
* 设备参数
|
||||
*/
|
||||
iot_device_message_t i_dev_mess = {0};
|
||||
/*
|
||||
* 设置参数
|
||||
*/
|
||||
iot_device_set_message_t i_set_mess = {0};
|
||||
/*
|
||||
* 下行应答
|
||||
*/
|
||||
iot_down_ack_t i_down_ack = {0};
|
||||
/*
|
||||
* 版本信息
|
||||
*/
|
||||
iot_ver_message_t i_ver_mess = {0};
|
||||
|
||||
extern sensor_data_t sensor_data;
|
||||
|
||||
/*
|
||||
* 十进制ID
|
||||
*/
|
||||
uint32_t device_id_dec(void)
|
||||
{
|
||||
|
||||
#if USER_VIRTUAL_ID
|
||||
|
||||
memset(dev_par.id_hex, 0x00, 4);
|
||||
mcu_eeprom_read(BOOT_MESSAGE_ADDRESS+4, (uint8_t *)dev_par.id_hex, 4);
|
||||
LOG_OUT("id[%x %x %x %x]\r\n",dev_par.id_hex[0],dev_par.id_hex[1],dev_par.id_hex[2],dev_par.id_hex[3] );
|
||||
|
||||
if ((dev_par.id_hex[0] == 0x00 && dev_par.id_hex[1] == 0x00 && dev_par.id_hex[2] == 0x00 && dev_par.id_hex[3] == 0x00) ||
|
||||
(dev_par.id_hex[0] == 0xFF && dev_par.id_hex[1] == 0xFF && dev_par.id_hex[2] == 0xFF && dev_par.id_hex[3] == 0xFF) )
|
||||
{
|
||||
//默认设备ID
|
||||
uint32_t dev_id = 240400000;
|
||||
|
||||
dev_par.id_hex[0] = (dev_id>>24)&0xFF;
|
||||
dev_par.id_hex[1] = (dev_id>>16)&0xFF;
|
||||
dev_par.id_hex[2] = (dev_id>>8)&0xFF;
|
||||
dev_par.id_hex[3] = dev_id & 0xFF;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
//默认设备ID
|
||||
uint32_t dev_id = 250400003;
|
||||
|
||||
dev_par.id_hex[0] = (dev_id>>24)&0xFF;
|
||||
dev_par.id_hex[1] = (dev_id>>16)&0xFF;
|
||||
dev_par.id_hex[2] = (dev_id>>8)&0xFF;
|
||||
dev_par.id_hex[3] = dev_id & 0xFF;
|
||||
|
||||
#endif
|
||||
|
||||
dev_par.id_dec = dev_par.id_hex[0]<<24 |
|
||||
dev_par.id_hex[1]<<16 |
|
||||
dev_par.id_hex[2]<<8 |
|
||||
dev_par.id_hex[3];
|
||||
|
||||
device_id_char();
|
||||
|
||||
return dev_par.id_dec;
|
||||
}
|
||||
/*
|
||||
* 16进展ID
|
||||
*/
|
||||
void device_id_hex(uint8_t *data)
|
||||
{
|
||||
memcpy(data, dev_par.id_hex, 4);
|
||||
}
|
||||
/*
|
||||
* 字符串ID
|
||||
*/
|
||||
void device_id_char(void)
|
||||
{
|
||||
user_num_tran_char(dev_par.id_dec, dev_par.id_char, 0x0D);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 本地数据
|
||||
*/
|
||||
void iot_device_message_update(uint8_t *data_p)
|
||||
{
|
||||
sensor_data_t *sensor_p = (sensor_data_t *)data_p;
|
||||
|
||||
//清空
|
||||
memset(&i_dev_mess, 0x00, sizeof(i_dev_mess));
|
||||
|
||||
i_dev_mess.logo = IOT_DATA_LOGO;
|
||||
i_dev_mess.head = IOT_DATA_HEAD;
|
||||
i_dev_mess.length = IOT_DATA_LENGTH;
|
||||
i_dev_mess.packs_all = IOT_DATA_PACK_ALL;
|
||||
i_dev_mess.packs_num = IOT_DATA_PACK_NUM;
|
||||
|
||||
memcpy(i_dev_mess.dev_id, dev_par.id_hex, 4);
|
||||
|
||||
// 他处获取
|
||||
// i_dev_mess.collect_time[0] = (sensor_p->timestamp >>24) & 0xFF;
|
||||
// i_dev_mess.collect_time[1] = (sensor_p->timestamp >>16) & 0xFF;
|
||||
// i_dev_mess.collect_time[2] = (sensor_p->timestamp >>8) & 0xFF;
|
||||
// i_dev_mess.collect_time[3] = (sensor_p->timestamp ) & 0xFF;
|
||||
// 他处获取
|
||||
// i_dev_mess.csq = 100;
|
||||
|
||||
i_dev_mess.voltage[0] = sensor_p->battery >>8;
|
||||
i_dev_mess.voltage[1] = sensor_p->battery &0xFF;
|
||||
|
||||
i_dev_mess.temperature[0] = sensor_p->temper >>8;
|
||||
i_dev_mess.temperature[1] = sensor_p->temper &0XFF;
|
||||
|
||||
i_dev_mess.methane[0] = sensor_p->methane >> 8;
|
||||
i_dev_mess.methane[1] = sensor_p->methane & 0XFF;
|
||||
|
||||
i_dev_mess.methane_state[0] = 0X00;
|
||||
|
||||
#if GUANGGAN_DEVICE
|
||||
switch(sensor_p->err)
|
||||
{
|
||||
case 0x00:
|
||||
i_dev_mess.methane_state[1] = 0X00;
|
||||
break;
|
||||
|
||||
case 0x01:
|
||||
i_dev_mess.methane_state[1] = 0X01;
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
i_dev_mess.methane_state[1] = 0X02;
|
||||
break;
|
||||
|
||||
case 0x04:
|
||||
i_dev_mess.methane_state[1] = 0X04;
|
||||
break;
|
||||
|
||||
case 0x08:
|
||||
i_dev_mess.methane_state[1] = 0X05;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if QINGXIN_DEVICE
|
||||
switch(sensor_p->err)
|
||||
{
|
||||
case 0x00:
|
||||
i_dev_mess.methane_state[1] = 0X00;
|
||||
break;
|
||||
|
||||
case 0x01:
|
||||
i_dev_mess.methane_state[1] = 0X04;
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
i_dev_mess.methane_state[1] = 0X02;
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
i_dev_mess.methane_state[1] = 0X05;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if YINGFULAI_DEVICE
|
||||
|
||||
if((sensor_p->err & 0x01) == 0x01)
|
||||
{
|
||||
i_dev_mess.methane_state[1] = 0X01;
|
||||
}
|
||||
else if((sensor_p->err & 0x02) == 0x02)
|
||||
{
|
||||
i_dev_mess.methane_state[1] = 0X02;
|
||||
}
|
||||
else if((sensor_p->err & 0x04) == 0x04)
|
||||
{
|
||||
i_dev_mess.methane_state[1] = 0X04;
|
||||
}
|
||||
else if((sensor_p->err & 0x08) == 0x08)
|
||||
{
|
||||
i_dev_mess.methane_state[1] = 0X03;
|
||||
}
|
||||
else if((sensor_p->err & 0x10) == 0x10)
|
||||
{
|
||||
i_dev_mess.methane_state[1] = 0X05;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
i_dev_mess.water[0] = (sensor_p->water) >> 1 & 0x01 ;
|
||||
i_dev_mess.water[1] = (sensor_p->water) & 0x01;
|
||||
|
||||
if(i_dev_mess.water[1] == 0x01)
|
||||
{
|
||||
i_dev_mess.distance[0] = 0;
|
||||
i_dev_mess.distance[1] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
i_dev_mess.distance[0] = sensor_p->distance >> 8;
|
||||
i_dev_mess.distance[1] = sensor_p->distance & 0XFF;
|
||||
}
|
||||
|
||||
// 他处获取
|
||||
// i_dev_mess.pci[0] = 0X00;
|
||||
// i_dev_mess.pci[1] = 0X00;
|
||||
|
||||
if(i_set_mess.steal_flag == true)
|
||||
{
|
||||
if(sensor_p->direction_x >= X_Y_Z_ANGLE ||
|
||||
sensor_p->direction_y >= X_Y_Z_ANGLE )
|
||||
{
|
||||
i_dev_mess.turn = 0x01;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(sensor_p->shake == 1)
|
||||
{
|
||||
i_dev_mess.turn = 0x02;
|
||||
}
|
||||
else
|
||||
{
|
||||
i_dev_mess.turn = 0x00;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i_dev_mess.turn = 0x00;
|
||||
}
|
||||
|
||||
// 他处获取
|
||||
// i_dev_mess.rsrp[0] = 0x00;
|
||||
// i_dev_mess.rsrp[1] = 0x00;
|
||||
//
|
||||
// i_dev_mess.snr[0] = 0x00;
|
||||
// i_dev_mess.snr[1] = 0x00;
|
||||
|
||||
if(i_set_mess.gps_flag == true)
|
||||
{
|
||||
i_dev_mess.gps_latitude[0] = (sensor_p->latitude >>24) & 0xFF;
|
||||
i_dev_mess.gps_latitude[1] = (sensor_p->latitude >>16) & 0xFF;
|
||||
i_dev_mess.gps_latitude[2] = (sensor_p->latitude >>8) & 0xFF;
|
||||
i_dev_mess.gps_latitude[3] = (sensor_p->latitude ) & 0xFF;
|
||||
|
||||
i_dev_mess.gps_longitude[0] = (sensor_p->longitude >>24) & 0xFF;
|
||||
i_dev_mess.gps_longitude[1] = (sensor_p->longitude >>16) & 0xFF;
|
||||
i_dev_mess.gps_longitude[2] = (sensor_p->longitude >>8) & 0xFF;
|
||||
i_dev_mess.gps_longitude[3] = (sensor_p->longitude ) & 0xFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(i_dev_mess.gps_longitude, i_set_mess.app_longitude, 4);
|
||||
memcpy(i_dev_mess.gps_latitude, i_set_mess.app_latitude, 4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 设备默认
|
||||
*/
|
||||
void iot_device_message_update_default(void)
|
||||
{
|
||||
//甲烷浓度限值
|
||||
i_set_mess.methane_low = 100;
|
||||
i_set_mess.methane_high = 300;
|
||||
//采集周期
|
||||
|
||||
//开GPS采集周期不能小于5
|
||||
i_set_mess.collect_period = 3;
|
||||
//上报周期
|
||||
i_set_mess.up_period = 3;
|
||||
|
||||
i_set_mess.collect_period_save = i_set_mess.collect_period;
|
||||
i_set_mess.up_period_save = i_set_mess.up_period;
|
||||
|
||||
//时间戳
|
||||
memset(i_set_mess.utc, 0x00, 4);
|
||||
//防盗开关
|
||||
i_set_mess.steal_flag = false;
|
||||
//使用设备GPS
|
||||
i_set_mess.gps_flag = false;
|
||||
//手机GPS
|
||||
memset(i_set_mess.app_longitude, 0X00, 4);
|
||||
memset(i_set_mess.app_latitude, 0X00, 4);
|
||||
|
||||
//激活
|
||||
i_set_mess.activate = true;
|
||||
|
||||
//ip地址
|
||||
i_set_mess.ip_port[0] = 39;
|
||||
i_set_mess.ip_port[1] = 101;
|
||||
i_set_mess.ip_port[2] = 67;
|
||||
i_set_mess.ip_port[3] = 14;
|
||||
|
||||
i_set_mess.ip_port[4] = 7113 >> 8;
|
||||
i_set_mess.ip_port[5] = 7113 & 0xFF;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 设备默认
|
||||
*/
|
||||
void iot_device_default(void)
|
||||
{
|
||||
//设备信息
|
||||
const uint8_t name[8] = {"ZNFJ2405"};
|
||||
const uint8_t software[4] = {"1.5 "};
|
||||
const uint8_t hardware[4] = {"1.5 "};
|
||||
|
||||
#if IOT_USE_MB26A
|
||||
const uint8_t module[6] = {"MB26A "};
|
||||
#endif
|
||||
#if IOT_USE_ML307
|
||||
const uint8_t module[6] = {"ML307R"};
|
||||
#endif
|
||||
|
||||
i_down_ack.logo = DOWN_ACK_LOGO;
|
||||
i_down_ack.head = DOWN_ACK_HEAD;
|
||||
i_down_ack.len = DOWN_ACK_LEN;
|
||||
|
||||
memcpy(i_down_ack.id, dev_par.id_hex, 4);
|
||||
|
||||
i_ver_mess.logo = DEV_MESS_LOGO;
|
||||
i_ver_mess.head = DEV_MESS_HEAD;
|
||||
i_ver_mess.len = DEV_MESS_LEN;
|
||||
|
||||
memcpy(i_ver_mess.id, dev_par.id_hex, 4);
|
||||
|
||||
memcpy(i_ver_mess.name, name, 8);
|
||||
memcpy(i_ver_mess.software, software, 4);
|
||||
memcpy(i_ver_mess.hardware, hardware, 4);
|
||||
memcpy(i_ver_mess.module, module, 6);
|
||||
|
||||
LOG_OUT("software:%c%c%c%c\r\n",i_ver_mess.software[0], i_ver_mess.software[1], i_ver_mess.software[2], i_ver_mess.software[3]);
|
||||
LOG_OUT("hardware:%c%c%c%c\r\n",i_ver_mess.hardware[0], i_ver_mess.hardware[1], i_ver_mess.hardware[2], i_ver_mess.hardware[3]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 生产数据输出
|
||||
*/
|
||||
void device_production_log_output(void)
|
||||
{
|
||||
uint8_t log_buff[20] ={0};
|
||||
uint16_t log_len = 0;
|
||||
uint32_t number = 0;
|
||||
|
||||
uart_send_lp((uint8_t *)"工厂数据:", 13);
|
||||
uart_send_lp((uint8_t *)"\n设备ID:", 10);
|
||||
uart_send_lp(dev_par.id_char, 10);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n设备型号:", 14);
|
||||
uart_send_lp(i_ver_mess.name, 8);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n硬件版本:", 14);
|
||||
uart_send_lp(i_ver_mess.hardware, 4);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n软件版本:", 14);
|
||||
uart_send_lp(i_ver_mess.software, 4);
|
||||
|
||||
uart_send_lp((uint8_t *)"\nSIM:", 5);
|
||||
uart_send_lp(i_ver_mess.qccid, 20);
|
||||
|
||||
uart_send_lp((uint8_t *)"\nIMEI:", 6);
|
||||
uart_send_lp(i_ver_mess.imei, 15);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n电池电压:", 14);
|
||||
log_len = user_num_tran_char(sensor_data.battery, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
uart_send_lp((uint8_t *)" mV", 3);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n温度:", 8);
|
||||
log_len = user_num_tran_char(sensor_data.temper/10, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
uart_send_lp((uint8_t *)" 度",4);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n甲烷浓度:", 14);
|
||||
log_len = user_num_tran_char(sensor_data.methane/10, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
uart_send_lp((uint8_t *)" LEL",4);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n水浸状态:", 14);
|
||||
if(sensor_data.water == 0x01)
|
||||
uart_send_lp((uint8_t *)"浸水", 6);
|
||||
else
|
||||
uart_send_lp((uint8_t *)"未浸水", 9);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n测距:", 8);
|
||||
log_len = user_num_tran_char(sensor_data.distance, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
uart_send_lp((uint8_t *)" mm",3);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n侧翻状态:", 14);
|
||||
if(i_dev_mess.turn == 0x01)
|
||||
uart_send_lp((uint8_t *)"侧翻", 6);
|
||||
else
|
||||
uart_send_lp((uint8_t *)"未侧翻", 9);
|
||||
|
||||
|
||||
uart_send_lp((uint8_t *)"\n振动状态:", 14);
|
||||
if(sensor_data.shake == 0x01)
|
||||
uart_send_lp((uint8_t *)"振动", 6);
|
||||
else
|
||||
uart_send_lp((uint8_t *)"未振动", 9);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n信号接收功率:", 20);
|
||||
number = i_dev_mess.rsrp[0] >>8 | i_dev_mess.rsrp[1];
|
||||
log_len = user_num_tran_char(number, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
|
||||
uart_send_lp((uint8_t *)"\nGPS经度:", 11);
|
||||
number = i_dev_mess.gps_longitude[0]<<24 |
|
||||
i_dev_mess.gps_longitude[1]<<16 |
|
||||
i_dev_mess.gps_longitude[2]<<8 |
|
||||
i_dev_mess.gps_longitude[3];
|
||||
log_len = user_num_tran_char(number, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
|
||||
uart_send_lp((uint8_t *)"\nGPS纬度:", 11);
|
||||
number = i_dev_mess.gps_latitude[0]<<24 |
|
||||
i_dev_mess.gps_latitude[1]<<16 |
|
||||
i_dev_mess.gps_latitude[2]<<8 |
|
||||
i_dev_mess.gps_latitude[3];
|
||||
log_len = user_num_tran_char(number, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
}
|
|
@ -1,433 +0,0 @@
|
|||
#include "app_dev.h"
|
||||
|
||||
|
||||
/*
|
||||
* 设备参数
|
||||
*/
|
||||
device_parameter_t dev_par ={0};
|
||||
/*
|
||||
* 设备参数
|
||||
*/
|
||||
iot_device_message_t i_dev_mess = {0};
|
||||
/*
|
||||
* 设置参数
|
||||
*/
|
||||
iot_device_set_message_t i_set_mess = {0};
|
||||
/*
|
||||
* 下行应答
|
||||
*/
|
||||
iot_down_ack_t i_down_ack = {0};
|
||||
/*
|
||||
* 版本信息
|
||||
*/
|
||||
iot_ver_message_t i_ver_mess = {0};
|
||||
|
||||
extern sensor_data_t sensor_data;
|
||||
|
||||
/*
|
||||
* 十进制ID
|
||||
*/
|
||||
uint32_t device_id_dec(void)
|
||||
{
|
||||
#if USER_VIRTUAL_ID
|
||||
|
||||
memset(dev_par.id_hex, 0x00, 4);
|
||||
mcu_eeprom_read(BOOT_MESSAGE_ADDRESS+4, (uint8_t *)dev_par.id_hex, 4);
|
||||
LOG_OUT("id[%x %x %x %x]\r\n",dev_par.id_hex[0],dev_par.id_hex[1],dev_par.id_hex[2],dev_par.id_hex[3] );
|
||||
|
||||
if ((dev_par.id_hex[0] == 0x00 && dev_par.id_hex[1] == 0x00 && dev_par.id_hex[2] == 0x00 && dev_par.id_hex[3] == 0x00) ||
|
||||
(dev_par.id_hex[0] == 0xFF && dev_par.id_hex[1] == 0xFF && dev_par.id_hex[2] == 0xFF && dev_par.id_hex[3] == 0xFF) )
|
||||
{
|
||||
//默认设备ID
|
||||
uint32_t dev_id = 240400000;
|
||||
|
||||
dev_par.id_hex[0] = (dev_id>>24)&0xFF;
|
||||
dev_par.id_hex[1] = (dev_id>>16)&0xFF;
|
||||
dev_par.id_hex[2] = (dev_id>>8)&0xFF;
|
||||
dev_par.id_hex[3] = dev_id & 0xFF;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
//默认设备ID
|
||||
uint32_t dev_id = 250400003;
|
||||
|
||||
dev_par.id_hex[0] = (dev_id>>24)&0xFF;
|
||||
dev_par.id_hex[1] = (dev_id>>16)&0xFF;
|
||||
dev_par.id_hex[2] = (dev_id>>8)&0xFF;
|
||||
dev_par.id_hex[3] = dev_id & 0xFF;
|
||||
|
||||
#endif
|
||||
|
||||
dev_par.id_dec = dev_par.id_hex[0]<<24 |
|
||||
dev_par.id_hex[1]<<16 |
|
||||
dev_par.id_hex[2]<<8 |
|
||||
dev_par.id_hex[3];
|
||||
|
||||
device_id_char();
|
||||
|
||||
return dev_par.id_dec;
|
||||
}
|
||||
/*
|
||||
* 16进展ID
|
||||
*/
|
||||
void device_id_hex(uint8_t *data)
|
||||
{
|
||||
memcpy(data, dev_par.id_hex, 4);
|
||||
}
|
||||
/*
|
||||
* 字符串ID
|
||||
*/
|
||||
void device_id_char(void)
|
||||
{
|
||||
user_num_tran_char(dev_par.id_dec, dev_par.id_char, 0x0D);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 本地数据
|
||||
*/
|
||||
void iot_device_message_update(uint8_t *data_p)
|
||||
{
|
||||
sensor_data_t *sensor_p = (sensor_data_t *)data_p;
|
||||
|
||||
//清空
|
||||
memset(&i_dev_mess, 0x00, sizeof(i_dev_mess));
|
||||
|
||||
i_dev_mess.logo = IOT_DATA_LOGO;
|
||||
i_dev_mess.head = IOT_DATA_HEAD;
|
||||
i_dev_mess.length = IOT_DATA_LENGTH;
|
||||
i_dev_mess.packs_all = IOT_DATA_PACK_ALL;
|
||||
i_dev_mess.packs_num = IOT_DATA_PACK_NUM;
|
||||
|
||||
memcpy(i_dev_mess.dev_id, dev_par.id_hex, 4);
|
||||
|
||||
// 他处获取
|
||||
// i_dev_mess.collect_time[0] = (sensor_p->timestamp >>24) & 0xFF;
|
||||
// i_dev_mess.collect_time[1] = (sensor_p->timestamp >>16) & 0xFF;
|
||||
// i_dev_mess.collect_time[2] = (sensor_p->timestamp >>8) & 0xFF;
|
||||
// i_dev_mess.collect_time[3] = (sensor_p->timestamp ) & 0xFF;
|
||||
// 他处获取
|
||||
// i_dev_mess.csq = 100;
|
||||
|
||||
i_dev_mess.voltage[0] = sensor_p->battery >>8;
|
||||
i_dev_mess.voltage[1] = sensor_p->battery &0xFF;
|
||||
|
||||
i_dev_mess.temperature[0] = sensor_p->temper >>8;
|
||||
i_dev_mess.temperature[1] = sensor_p->temper &0XFF;
|
||||
|
||||
i_dev_mess.methane[0] = sensor_p->methane >> 8;
|
||||
i_dev_mess.methane[1] = sensor_p->methane & 0XFF;
|
||||
|
||||
i_dev_mess.methane_state[0] = 0X00;
|
||||
|
||||
#if GUANGGAN_DEVICE
|
||||
switch(sensor_p->err)
|
||||
{
|
||||
case 0x00:
|
||||
i_dev_mess.methane_state[1] = 0X00;
|
||||
break;
|
||||
|
||||
case 0x01:
|
||||
i_dev_mess.methane_state[1] = 0X01;
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
i_dev_mess.methane_state[1] = 0X02;
|
||||
break;
|
||||
|
||||
case 0x04:
|
||||
i_dev_mess.methane_state[1] = 0X04;
|
||||
break;
|
||||
|
||||
case 0x08:
|
||||
i_dev_mess.methane_state[1] = 0X05;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if QINGXIN_DEVICE
|
||||
switch(sensor_p->err)
|
||||
{
|
||||
case 0x00:
|
||||
i_dev_mess.methane_state[1] = 0X00;
|
||||
break;
|
||||
|
||||
case 0x01:
|
||||
i_dev_mess.methane_state[1] = 0X04;
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
i_dev_mess.methane_state[1] = 0X02;
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
i_dev_mess.methane_state[1] = 0X05;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if YINGFULAI_DEVICE
|
||||
|
||||
if((sensor_p->err & 0x01) == 0x01)
|
||||
{
|
||||
i_dev_mess.methane_state[1] = 0X01;
|
||||
}
|
||||
else if((sensor_p->err & 0x02) == 0x02)
|
||||
{
|
||||
i_dev_mess.methane_state[1] = 0X02;
|
||||
}
|
||||
else if((sensor_p->err & 0x04) == 0x04)
|
||||
{
|
||||
i_dev_mess.methane_state[1] = 0X04;
|
||||
}
|
||||
else if((sensor_p->err & 0x08) == 0x08)
|
||||
{
|
||||
i_dev_mess.methane_state[1] = 0X03;
|
||||
}
|
||||
else if((sensor_p->err & 0x10) == 0x10)
|
||||
{
|
||||
i_dev_mess.methane_state[1] = 0X05;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
i_dev_mess.water[0] = (sensor_p->water) >> 1 & 0x01 ;
|
||||
i_dev_mess.water[1] = (sensor_p->water) & 0x01;
|
||||
|
||||
if(i_dev_mess.water[1] == 0x01)
|
||||
{
|
||||
i_dev_mess.distance[0] = 0;
|
||||
i_dev_mess.distance[1] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
i_dev_mess.distance[0] = sensor_p->distance >> 8;
|
||||
i_dev_mess.distance[1] = sensor_p->distance & 0XFF;
|
||||
}
|
||||
|
||||
// 他处获取
|
||||
// i_dev_mess.pci[0] = 0X00;
|
||||
// i_dev_mess.pci[1] = 0X00;
|
||||
|
||||
if(i_set_mess.steal_flag == true)
|
||||
{
|
||||
if(sensor_p->direction_x >= X_Y_Z_ANGLE ||
|
||||
sensor_p->direction_y >= X_Y_Z_ANGLE )
|
||||
{
|
||||
i_dev_mess.turn = 0x01;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(sensor_p->shake == 1)
|
||||
{
|
||||
i_dev_mess.turn = 0x02;
|
||||
}
|
||||
else
|
||||
{
|
||||
i_dev_mess.turn = 0x00;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i_dev_mess.turn = 0x00;
|
||||
}
|
||||
|
||||
// 他处获取
|
||||
// i_dev_mess.rsrp[0] = 0x00;
|
||||
// i_dev_mess.rsrp[1] = 0x00;
|
||||
//
|
||||
// i_dev_mess.snr[0] = 0x00;
|
||||
// i_dev_mess.snr[1] = 0x00;
|
||||
|
||||
if(i_set_mess.gps_flag == true)
|
||||
{
|
||||
i_dev_mess.gps_latitude[0] = (sensor_p->latitude >>24) & 0xFF;
|
||||
i_dev_mess.gps_latitude[1] = (sensor_p->latitude >>16) & 0xFF;
|
||||
i_dev_mess.gps_latitude[2] = (sensor_p->latitude >>8) & 0xFF;
|
||||
i_dev_mess.gps_latitude[3] = (sensor_p->latitude ) & 0xFF;
|
||||
|
||||
i_dev_mess.gps_longitude[0] = (sensor_p->longitude >>24) & 0xFF;
|
||||
i_dev_mess.gps_longitude[1] = (sensor_p->longitude >>16) & 0xFF;
|
||||
i_dev_mess.gps_longitude[2] = (sensor_p->longitude >>8) & 0xFF;
|
||||
i_dev_mess.gps_longitude[3] = (sensor_p->longitude ) & 0xFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(i_dev_mess.gps_longitude, i_set_mess.app_longitude, 4);
|
||||
memcpy(i_dev_mess.gps_latitude, i_set_mess.app_latitude, 4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 设备默认
|
||||
*/
|
||||
void iot_device_message_update_default(void)
|
||||
{
|
||||
//甲烷浓度限值
|
||||
i_set_mess.methane_low = 100;
|
||||
i_set_mess.methane_high = 300;
|
||||
//采集周期
|
||||
|
||||
//开GPS采集周期不能小于5
|
||||
i_set_mess.collect_period = 3;
|
||||
//上报周期
|
||||
i_set_mess.up_period = 3;
|
||||
|
||||
i_set_mess.collect_period_save = i_set_mess.collect_period;
|
||||
i_set_mess.up_period_save = i_set_mess.up_period;
|
||||
|
||||
//时间戳
|
||||
memset(i_set_mess.utc, 0x00, 4);
|
||||
//防盗开关
|
||||
i_set_mess.steal_flag = false;
|
||||
//使用设备GPS
|
||||
i_set_mess.gps_flag = false;
|
||||
//手机GPS
|
||||
memset(i_set_mess.app_longitude, 0X00, 4);
|
||||
memset(i_set_mess.app_latitude, 0X00, 4);
|
||||
|
||||
//激活
|
||||
i_set_mess.activate = true;
|
||||
|
||||
//ip地址
|
||||
i_set_mess.ip_port[0] = 39;
|
||||
i_set_mess.ip_port[1] = 101;
|
||||
i_set_mess.ip_port[2] = 67;
|
||||
i_set_mess.ip_port[3] = 14;
|
||||
|
||||
i_set_mess.ip_port[4] = 7113 >> 8;
|
||||
i_set_mess.ip_port[5] = 7113 & 0xFF;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 设备默认
|
||||
*/
|
||||
void iot_device_default(void)
|
||||
{
|
||||
//设备信息
|
||||
const uint8_t name[8] = {"ZNFJ2405"};
|
||||
const uint8_t software[4] = {"1.5 "};
|
||||
const uint8_t hardware[4] = {"1.5 "};
|
||||
|
||||
#if IOT_USE_MB26A
|
||||
const uint8_t module[6] = {"MB26A "};
|
||||
#endif
|
||||
#if IOT_USE_ML307
|
||||
const uint8_t module[6] = {"ML307R"};
|
||||
#endif
|
||||
|
||||
i_down_ack.logo = DOWN_ACK_LOGO;
|
||||
i_down_ack.head = DOWN_ACK_HEAD;
|
||||
i_down_ack.len = DOWN_ACK_LEN;
|
||||
|
||||
memcpy(i_down_ack.id, dev_par.id_hex, 4);
|
||||
|
||||
i_ver_mess.logo = DEV_MESS_LOGO;
|
||||
i_ver_mess.head = DEV_MESS_HEAD;
|
||||
i_ver_mess.len = DEV_MESS_LEN;
|
||||
|
||||
memcpy(i_ver_mess.id, dev_par.id_hex, 4);
|
||||
|
||||
memcpy(i_ver_mess.name, name, 8);
|
||||
memcpy(i_ver_mess.software, software, 4);
|
||||
memcpy(i_ver_mess.hardware, hardware, 4);
|
||||
memcpy(i_ver_mess.module, module, 6);
|
||||
|
||||
LOG_OUT("software:%c%c%c%c\r\n",i_ver_mess.software[0], i_ver_mess.software[1], i_ver_mess.software[2], i_ver_mess.software[3]);
|
||||
LOG_OUT("hardware:%c%c%c%c\r\n",i_ver_mess.hardware[0], i_ver_mess.hardware[1], i_ver_mess.hardware[2], i_ver_mess.hardware[3]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 生产数据输出
|
||||
*/
|
||||
void device_production_log_output(void)
|
||||
{
|
||||
uint8_t log_buff[20] ={0};
|
||||
uint16_t log_len = 0;
|
||||
uint32_t number = 0;
|
||||
|
||||
uart_send_lp((uint8_t *)"工厂数据:", 13);
|
||||
uart_send_lp((uint8_t *)"\n设备ID:", 10);
|
||||
uart_send_lp(dev_par.id_char, 10);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n设备型号:", 14);
|
||||
uart_send_lp(i_ver_mess.name, 8);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n硬件版本:", 14);
|
||||
uart_send_lp(i_ver_mess.hardware, 4);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n软件版本:", 14);
|
||||
uart_send_lp(i_ver_mess.software, 4);
|
||||
|
||||
uart_send_lp((uint8_t *)"\nSIM:", 5);
|
||||
uart_send_lp(i_ver_mess.qccid, 20);
|
||||
|
||||
uart_send_lp((uint8_t *)"\nIMEI:", 6);
|
||||
uart_send_lp(i_ver_mess.imei, 15);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n电池电压:", 14);
|
||||
log_len = user_num_tran_char(sensor_data.battery, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
uart_send_lp((uint8_t *)" mV", 3);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n温度:", 8);
|
||||
log_len = user_num_tran_char(sensor_data.temper/10, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
uart_send_lp((uint8_t *)" 度",4);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n甲烷浓度:", 14);
|
||||
log_len = user_num_tran_char(sensor_data.methane/10, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
uart_send_lp((uint8_t *)" LEL",4);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n水浸状态:", 14);
|
||||
if(sensor_data.water == 0x01)
|
||||
uart_send_lp((uint8_t *)"浸水", 6);
|
||||
else
|
||||
uart_send_lp((uint8_t *)"未浸水", 9);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n测距:", 8);
|
||||
log_len = user_num_tran_char(sensor_data.distance, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
uart_send_lp((uint8_t *)" mm",3);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n侧翻状态:", 14);
|
||||
if(i_dev_mess.turn == 0x01)
|
||||
uart_send_lp((uint8_t *)"侧翻", 6);
|
||||
else
|
||||
uart_send_lp((uint8_t *)"未侧翻", 9);
|
||||
|
||||
|
||||
uart_send_lp((uint8_t *)"\n振动状态:", 14);
|
||||
if(sensor_data.shake == 0x01)
|
||||
uart_send_lp((uint8_t *)"振动", 6);
|
||||
else
|
||||
uart_send_lp((uint8_t *)"未振动", 9);
|
||||
|
||||
uart_send_lp((uint8_t *)"\n信号接收功率:", 20);
|
||||
number = i_dev_mess.rsrp[0] >>8 | i_dev_mess.rsrp[1];
|
||||
log_len = user_num_tran_char(number, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
|
||||
uart_send_lp((uint8_t *)"\nGPS经度:", 11);
|
||||
number = i_dev_mess.gps_longitude[0]<<24 |
|
||||
i_dev_mess.gps_longitude[1]<<16 |
|
||||
i_dev_mess.gps_longitude[2]<<8 |
|
||||
i_dev_mess.gps_longitude[3];
|
||||
log_len = user_num_tran_char(number, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
|
||||
uart_send_lp((uint8_t *)"\nGPS纬度:", 11);
|
||||
number = i_dev_mess.gps_latitude[0]<<24 |
|
||||
i_dev_mess.gps_latitude[1]<<16 |
|
||||
i_dev_mess.gps_latitude[2]<<8 |
|
||||
i_dev_mess.gps_latitude[3];
|
||||
log_len = user_num_tran_char(number, log_buff, '\n');
|
||||
uart_send_lp(log_buff, log_len);
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,2 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
last.upload.time=1745824570897
|
|
@ -1,4 +0,0 @@
|
|||
approved.defs.file.last.changed.time=1693315978000
|
||||
codemix.dont.show.upsell.until=1900800000
|
||||
eclipse.preferences.version=1
|
||||
last.download.attempt.time=1746604248402
|
|
@ -1,7 +0,0 @@
|
|||
columnOrderKeyEXE=0,1,2,3,4,5
|
||||
columnOrderKeySF=0,1,2,3,4,5
|
||||
columnSortDirectionKeyEXE=128
|
||||
columnSortDirectionKeySF=128
|
||||
eclipse.preferences.version=1
|
||||
visibleColumnsKeyEXE=1,1,1,0,0,0
|
||||
visibleColumnsKeySF=1,1,0,0,0,0
|
|
@ -1,3 +0,0 @@
|
|||
buildConsole/keepLog=true
|
||||
buildConsole/logLocation=E\:\\project\\software_2025\\app_wells_0407\\workspace1\\.metadata\\.plugins\\org.eclipse.cdt.ui\\wells.build.log
|
||||
eclipse.preferences.version=1
|
|
@ -1,6 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.debug.ui.MemoryView.orientation=0
|
||||
org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<launchPerspectives/>\r\n
|
||||
org.eclipse.debug.ui.user_view_bindings=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<viewBindings>\r\n<view id\="org.eclipse.debug.ui.ExpressionView">\r\n<perspective id\="org.eclipse.debug.ui.DebugPerspective" userAction\="opened"/>\r\n</view>\r\n</viewBindings>\r\n
|
||||
preferredDetailPanes=\u9ED8\u8BA4\u8BE6\u60C5\u9762\u677F\:\u9ED8\u8BA4\u8BE6\u60C5\u9762\u677F|
|
||||
preferredTargets=org.eclipse.cdt.debug.ui.toggleCBreakpointTarget,org.eclipse.cdt.debug.ui.toggleCDynamicPrintfTarget\:org.eclipse.cdt.debug.ui.toggleCBreakpointTarget|
|
|
@ -1,2 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.search.defaultPerspective=org.eclipse.search.defaultPerspective.none
|
|
@ -1,5 +0,0 @@
|
|||
PROBLEMS_FILTERS_MIGRATE=true
|
||||
eclipse.preferences.version=1
|
||||
platformState=1746604181936
|
||||
quickStart=false
|
||||
tipsAndTricks=false
|
|
@ -1,3 +0,0 @@
|
|||
//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false
|
||||
UIActivities.org.eclipse.cdt.debug.dsfgdbActivity=true
|
||||
eclipse.preferences.version=1
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<workingSetManager>
|
||||
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1744188982342_0" label="窗口工作集" name="Aggregate for window 1744188982342"/>
|
||||
</workingSetManager>
|
|
@ -1,225 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.553091094">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.553091094" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="rtthread_wells" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.553091094" name="Debug" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug" postbuildStep="">
|
||||
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.553091094." name="/" resourcePath="">
|
||||
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.1201710416" name="ARM Cross GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.251260409" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.1365878149" name="Create extended listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting" useByScannerDiscovery="false"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.709136944" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1986446770" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1312975261" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" useByScannerDiscovery="true" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.1538128212" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" useByScannerDiscovery="true" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.2136804218" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" useByScannerDiscovery="true" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.244767666" name="Data sections (-fdata-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections" useByScannerDiscovery="true" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.1055848773" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.default" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.501941135" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.dwarf2" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.1696308067" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" useByScannerDiscovery="false" value="GNU Tools for ARM Embedded Processors" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.1558403188" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.arm" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family.749415257" name="ARM family" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.mcpu.cortex-m0" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.2114153533" name="Instruction set" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.thumb" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.1600865811" name="Prefix" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix" useByScannerDiscovery="false" value="arm-none-eabi-" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.1109963929" name="C compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.c" useByScannerDiscovery="false" value="gcc" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.1040883831" name="C++ compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp" useByScannerDiscovery="false" value="g++" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.1678200391" name="Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar" useByScannerDiscovery="false" value="ar" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.1171840296" name="Hex/Bin converter" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy" useByScannerDiscovery="false" value="objcopy" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.342604837" name="Listing generator" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump" useByScannerDiscovery="false" value="objdump" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.898269225" name="Size command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.size" useByScannerDiscovery="false" value="size" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.2016398076" name="Build command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.make" useByScannerDiscovery="false" value="make" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.1606171496" name="Remove command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm" useByScannerDiscovery="false" value="rm" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id.540792084" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id" useByScannerDiscovery="false" value="1287942917" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.architecture.430121817" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.architecture" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.arch.none" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.966735324" name="Float ABI" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.default" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn.1381561249" name="Enable all common warnings (-Wall)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn" useByScannerDiscovery="true" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.target.other.2041717463" name="Other target flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.target.other" useByScannerDiscovery="true" value="" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.1463655269" name="FPU Type" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.default" valueType="enumerated"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.1798638225" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
|
||||
<builder buildPath="${workspace_loc:/qemu-vexpress-a9}/Debug" cleanBuildTarget="clean2" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1736709688" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="GNU Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.1810966071" name="GNU ARM Cross Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.1072524326" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths.161242639" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}}""/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs.1521934876" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs" useByScannerDiscovery="true"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.flags.1325367962" name="Assembler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.flags" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-mimplicit-it=thumb"/>
|
||||
</option>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.1843333483" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1570350559" name="GNU ARM Cross C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.634882052" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/drivers}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/app}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lwrb}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTT}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/bsp}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/drivers//include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/drivers//include//config}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//CMSIS//Device//ST//STM32L0xx//Include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//CMSIS//Include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//CMSIS//RTOS//Template}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//STM32L0xx_HAL_Driver//Inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//STM32L0xx_HAL_Driver//Inc//Legacy}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/.}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/applications}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//.}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//cubemx/Inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//cubemx}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/drivers/include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/libc/compilers/common}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/libc/compilers/newlib}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/libcpu/arm/common}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/libcpu/arm/cortex-m0}""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.100549972" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="SOC_FAMILY_STM32"/>
|
||||
<listOptionValue builtIn="false" value="SOC_SERIES_STM32L0"/>
|
||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||
<listOptionValue builtIn="false" value="STM32L071xx"/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other.2133065240" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other" useByScannerDiscovery="true" value="" valueType="string"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.files.714348818" name="Include files (-include)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.files" useByScannerDiscovery="true" valueType="includeFiles">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/rtconfig_preinc.h}""/>
|
||||
</option>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.992053063" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.869072473" name="Cross ARM C Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.1167322178" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nostart.351692886" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nostart" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nostdlibs.1009243715" name="No startup or default libs (-nostdlib)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nostdlibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nodeflibs.2016026082" name="Do not use default libraries (-nodefaultlibs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nodeflibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.usenewlibnano.923990336" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.usenewlibnano" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option defaultValue="true" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.shared.548869459" name="Shared (-shared)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.shared" useByScannerDiscovery="false" valueType="boolean"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.scriptfile.1818777301" name="Script files (-T)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.scriptfile" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//linkscripts//STM32L071RB//link.lds}""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.libs.1135656995" name="Libraries (-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.libs" useByScannerDiscovery="false" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="c "/>
|
||||
<listOptionValue builtIn="false" value="m "/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.paths.36884122" name="Library search path (-L)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.paths" useByScannerDiscovery="false"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other.396049466" name="Other linker flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other" useByScannerDiscovery="false" value="" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref.1645737861" name="Cross reference (-Xlinker --cref)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input.334732222" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.1601059928" name="GNU ARM Cross C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections.437759352" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections" value="true" valueType="boolean"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.scriptfile.1101974459" name="Script files (-T)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.scriptfile" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//linkscripts//STM32L071RB//link.lds}""/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.cref.2007675975" name="Cross reference (-Xlinker --cref)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.cref" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnano.2105838438" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnano" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.libs.934137837" name="Libraries (-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.libs" useByScannerDiscovery="false"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nostart.2118356996" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nostart" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nodeflibs.1427884346" name="Do not use default libraries (-nodefaultlibs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nodeflibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nostdlibs.1433863653" name="No startup or default libs (-nostdlib)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nostdlibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printgcsections.1387745410" name="Print removed sections (-Xlinker --print-gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printgcsections" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.strip.1230158061" name="Omit all symbol information (-s)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.strip" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printmap.1307581821" name="Print link map (-Xlinker --print-map)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printmap" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.useprintffloat.960778920" name="Use float with nano printf (-u _printf_float)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.useprintffloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usescanffloat.637205035" name="Use float with nano scanf (-u _scanf_float)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usescanffloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnosys.1948314201" name="Do not use syscalls (--specs=nosys.specs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnosys" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.verbose.273162112" name="Verbose (-v)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.paths.1399535143" name="Library search path (-L)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.paths" useByScannerDiscovery="false"/>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input.262373798" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.506412204" name="GNU ARM Cross Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver"/>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.1461589245" name="GNU ARM Cross Create Flash Image" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.1937707052" name="Output file format (-O)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.ihex" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.82359725" name="GNU ARM Cross Create Listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source.601724476" name="Display source (--source|-S)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders.692505279" name="Display all headers (--all-headers|-x)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle.97345172" name="Demangle names (--demangle|-C)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers.1342893377" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide.1533725981" name="Wide lines (--wide|-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide" value="true" valueType="boolean"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.1073550295" name="GNU ARM Cross Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format.946451386" name="Size format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format" useByScannerDiscovery="false"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1302177015" name="GNU ARM Cross C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.704468062" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="SOC_FAMILY_STM32"/>
|
||||
<listOptionValue builtIn="false" value="SOC_SERIES_STM32L0"/>
|
||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||
<listOptionValue builtIn="false" value="STM32L071xx"/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths.302877723" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/drivers}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/drivers//include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/drivers//include//config}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//CMSIS//Device//ST//STM32L0xx//Include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//CMSIS//Include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//CMSIS//RTOS//Template}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//STM32L0xx_HAL_Driver//Inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//STM32L0xx_HAL_Driver//Inc//Legacy}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/.}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/applications}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//.}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//cubemx/Inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//cubemx}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/drivers/include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/libc/compilers/common}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/libc/compilers/newlib}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/libcpu/arm/common}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/libcpu/arm/cortex-m0}""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.files.343249373" name="Include files (-include)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.files" useByScannerDiscovery="true" valueType="includeFiles">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/rtconfig_preinc.h}""/>
|
||||
</option>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.45918001" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="//cubemx/Drivers|//cubemx/MDK-ARM|//cubemx/Src/system_stm32l0xx.c|//rt-thread/components/cplusplus|//rt-thread/components/dfs|//rt-thread/components/drivers/audio|//rt-thread/components/drivers/can|//rt-thread/components/drivers/cputime|//rt-thread/components/drivers/hwcrypto|//rt-thread/components/drivers/hwtimer|//rt-thread/components/drivers/i2c|//rt-thread/components/drivers/misc|//rt-thread/components/drivers/mtd|//rt-thread/components/drivers/phy|//rt-thread/components/drivers/pm|//rt-thread/components/drivers/rtc|//rt-thread/components/drivers/sdio|//rt-thread/components/drivers/sensors|//rt-thread/components/drivers/serial|//rt-thread/components/drivers/spi|//rt-thread/components/drivers/touch|//rt-thread/components/drivers/usb|//rt-thread/components/drivers/watchdog|//rt-thread/components/drivers/wlan|//rt-thread/components/finsh|//rt-thread/components/libc/aio|//rt-thread/components/libc/compilers/armlibc|//rt-thread/components/libc/compilers/common/unistd.c|//rt-thread/components/libc/compilers/dlib|//rt-thread/components/libc/compilers/minilibc|//rt-thread/components/libc/getline|//rt-thread/components/libc/libdl|//rt-thread/components/libc/mmap|//rt-thread/components/libc/pthreads|//rt-thread/components/libc/signal|//rt-thread/components/libc/termios|//rt-thread/components/libc/time|//rt-thread/components/lwp|//rt-thread/components/net|//rt-thread/components/utilities|//rt-thread/components/vbus|//rt-thread/components/vmm|//rt-thread/libcpu/aarch64|//rt-thread/libcpu/arc|//rt-thread/libcpu/arm/AT91SAM7S|//rt-thread/libcpu/arm/AT91SAM7X|//rt-thread/libcpu/arm/am335x|//rt-thread/libcpu/arm/arm926|//rt-thread/libcpu/arm/armv6|//rt-thread/libcpu/arm/common/divsi3.S|//rt-thread/libcpu/arm/cortex-a|//rt-thread/libcpu/arm/cortex-m0/context_iar.S|//rt-thread/libcpu/arm/cortex-m0/context_rvds.S|//rt-thread/libcpu/arm/cortex-m23|//rt-thread/libcpu/arm/cortex-m3|//rt-thread/libcpu/arm/cortex-m33|//rt-thread/libcpu/arm/cortex-m4|//rt-thread/libcpu/arm/cortex-m7|//rt-thread/libcpu/arm/cortex-r4|//rt-thread/libcpu/arm/dm36x|//rt-thread/libcpu/arm/lpc214x|//rt-thread/libcpu/arm/lpc24xx|//rt-thread/libcpu/arm/realview-a8-vmm|//rt-thread/libcpu/arm/s3c24x0|//rt-thread/libcpu/arm/s3c44b0|//rt-thread/libcpu/arm/sep4020|//rt-thread/libcpu/arm/zynq7000|//rt-thread/libcpu/arm/zynqmp-r5|//rt-thread/libcpu/avr32|//rt-thread/libcpu/blackfin|//rt-thread/libcpu/c-sky|//rt-thread/libcpu/ia32|//rt-thread/libcpu/m16c|//rt-thread/libcpu/mips|//rt-thread/libcpu/nios|//rt-thread/libcpu/ppc|//rt-thread/libcpu/risc-v|//rt-thread/libcpu/rx|//rt-thread/libcpu/sim|//rt-thread/libcpu/sparc-v8|//rt-thread/libcpu/ti-dsp|//rt-thread/libcpu/unicore32|//rt-thread/libcpu/v850|//rt-thread/libcpu/xilinx|//rt-thread/src/cpu.c|//rt-thread/src/memheap.c|//rt-thread/src/mempool.c|//rt-thread/src/slab.c|//rt-thread/tools" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
<storageModule moduleId="ilg.gnumcueclipse.managedbuild.packs"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="qemu-vexpress-a9.ilg.gnuarmeclipse.managedbuild.cross.target.elf.860020518" name="Executable" projectType="ilg.gnuarmeclipse.managedbuild.cross.target.elf"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.553091094;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.553091094.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1570350559;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.992053063">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/wells"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings">
|
||||
<doc-comment-owner id="org.eclipse.cdt.ui.doxygen">
|
||||
<path value=""/>
|
||||
</doc-comment-owner>
|
||||
</storageModule>
|
||||
</cproject>
|
|
@ -1,4 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
spelling_locale_initialized=true
|
||||
useAnnotationsPrefPage=true
|
||||
useQuickDiffPrefPage=true
|
|
@ -1,58 +0,0 @@
|
|||
#include "rtt_log.h"
|
||||
|
||||
|
||||
#if RTT_LOG
|
||||
/*-----------------------------------------------------------
|
||||
* Includes files
|
||||
*----------------------------------------------------------*/
|
||||
|
||||
/* segger rtt includes. */
|
||||
#include "SEGGER_RTT.h"
|
||||
#include "SEGGER_RTT_Conf.h"
|
||||
|
||||
#define BUFFER_INDEX 0
|
||||
|
||||
//rt_mutex_t rt_mutex_log = RT_NULL;
|
||||
|
||||
/*!
|
||||
* @brief 封装 RTT 打印接口
|
||||
* 执行条件:无
|
||||
*
|
||||
* @retval: 无
|
||||
*/
|
||||
void rtt_printf(const char * sFormat, ...)
|
||||
{
|
||||
#if RTT_LOG
|
||||
|
||||
//if( rt_mutex_take(rt_mutex_log, MUTEX_TIMEOUT) == RT_EOK)
|
||||
{
|
||||
va_list ParamList;
|
||||
va_start(ParamList, sFormat);
|
||||
SEGGER_RTT_vprintf(BUFFER_INDEX, sFormat, &ParamList);
|
||||
va_end(ParamList);
|
||||
|
||||
//rt_mutex_release(rt_mutex_log);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief 初始化 RTT 打印接口
|
||||
* 执行条件:无
|
||||
*
|
||||
* @retval: 无
|
||||
*/
|
||||
void rtt_init(void)
|
||||
{
|
||||
SEGGER_RTT_Init();
|
||||
|
||||
// rt_mutex_log = rt_mutex_create("mutex", RT_IPC_FLAG_PRIO);
|
||||
// if( rt_mutex_log == RT_NULL)
|
||||
// {
|
||||
// LOG_OUT("rt_mutex_log err\r\n");
|
||||
// }
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
#ifndef __RTT_LOG_H
|
||||
#define __RTT_LOG_H
|
||||
|
||||
/*
|
||||
* 用户宏定义
|
||||
*/
|
||||
#include "app_user.h"
|
||||
|
||||
#define LOG_OUTPUT_EN (1)
|
||||
|
||||
#define RTT_LOG (1)
|
||||
#define UART_LOG (0)
|
||||
|
||||
|
||||
#if LOG_OUTPUT_EN
|
||||
|
||||
#if RTT_LOG
|
||||
#define LOG_OUT rtt_printf
|
||||
#endif
|
||||
#if UART_LOG
|
||||
#define LOG_OUT printf
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define LOG_OUT
|
||||
#endif
|
||||
|
||||
#define MUTEX_TIMEOUT (100)
|
||||
|
||||
extern void rtt_printf(const char * sFormat, ...);
|
||||
extern void rtt_init(void);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
#ifndef __APP_DEV_H
|
||||
#define __APP_DEV_H
|
||||
|
||||
#include "app_user.h"
|
||||
|
||||
//倾角测试
|
||||
#define X_Y_Z_ANGLE (10)
|
||||
|
||||
|
||||
#define IOT_DATA_LOGO 0x01
|
||||
#define IOT_DATA_HEAD 0xDD
|
||||
#define IOT_DATA_LENGTH 36
|
||||
#define IOT_DATA_PACK_ALL 0x01
|
||||
#define IOT_DATA_PACK_NUM 0x01
|
||||
|
||||
|
||||
#define IOT_SET_LOGO 0x06
|
||||
#define IOT_SET_SERVE_ID1 0x1F
|
||||
#define IOT_SET_SERVE_ID2 0x41
|
||||
#define IOT_SET_START_ADDR 0x00
|
||||
#define IOT_SET_LENGTH 0x26
|
||||
|
||||
#define USER_VIRTUAL_ID (1)
|
||||
|
||||
#define DOWN_ACK_LOGO (0X03)
|
||||
#define DOWN_ACK_HEAD (0XDD)
|
||||
#define DOWN_ACK_LEN (0X09)
|
||||
|
||||
#define DEV_MESS_LOGO (0X05)
|
||||
#define DEV_MESS_HEAD (0XDD)
|
||||
#define DEV_MESS_LEN (0X3D)
|
||||
|
||||
/*
|
||||
* NB数据上传
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t logo;
|
||||
uint8_t head;
|
||||
uint8_t length;
|
||||
uint8_t packs_all;
|
||||
uint8_t packs_num;
|
||||
uint8_t dev_id[4];
|
||||
uint8_t collect_time[4];
|
||||
uint8_t csq;
|
||||
uint8_t voltage[2];
|
||||
uint8_t temperature[2];
|
||||
uint8_t methane[2];
|
||||
uint8_t methane_state[2];
|
||||
uint8_t water[2];
|
||||
uint8_t distance[2];
|
||||
uint8_t pci[2];
|
||||
uint8_t turn;
|
||||
uint8_t rsrp[2];
|
||||
uint8_t snr[2];
|
||||
uint8_t gps_latitude[4];
|
||||
uint8_t gps_longitude[4];
|
||||
}iot_device_message_t;
|
||||
|
||||
/*
|
||||
* 下行应答
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t logo;
|
||||
uint8_t head;
|
||||
uint8_t len;
|
||||
uint8_t id[4];
|
||||
uint8_t cmd;
|
||||
uint8_t ret;
|
||||
|
||||
}iot_down_ack_t;
|
||||
|
||||
/*
|
||||
* 版本信息
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t logo;
|
||||
uint8_t head;
|
||||
uint8_t len;
|
||||
uint8_t id[4];
|
||||
uint8_t name[8];
|
||||
uint8_t software[4];
|
||||
uint8_t hardware[4];
|
||||
uint8_t module[6];
|
||||
uint8_t qccid[20];
|
||||
uint8_t imei[15];
|
||||
}iot_ver_message_t;
|
||||
|
||||
|
||||
/*
|
||||
* 数据下行设置
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
|
||||
uint16_t methane_low;
|
||||
uint16_t methane_high;
|
||||
uint16_t collect_period;
|
||||
uint16_t up_period;
|
||||
|
||||
uint16_t collect_period_save;
|
||||
uint16_t up_period_save;
|
||||
|
||||
uint8_t utc[4];
|
||||
uint8_t steal_flag;
|
||||
uint8_t gps_flag;
|
||||
uint8_t app_longitude[4];
|
||||
uint8_t app_latitude[4];
|
||||
uint8_t activate;
|
||||
|
||||
uint8_t ip_port[6];
|
||||
|
||||
}iot_device_set_message_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t id_dec;
|
||||
uint8_t id_hex[4];
|
||||
uint8_t id_char[12];
|
||||
}device_parameter_t;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void device_message_init(void);
|
||||
void set_message_init(void);
|
||||
void set_message_init_out(void);
|
||||
uint32_t device_id_dec(void);
|
||||
void device_id_hex(uint8_t *data);
|
||||
void device_id_char(void);
|
||||
void iot_device_message_update_default(void);
|
||||
void iot_device_default(void);
|
||||
void device_production_log_output(void);
|
||||
|
||||
|
||||
#endif
|
|
@ -1,658 +0,0 @@
|
|||
#include "app_iot_ctl.h"
|
||||
|
||||
|
||||
|
||||
iot_control_t iot_ctl = {0};
|
||||
|
||||
|
||||
extern rt_timer_t iot_timer_3;
|
||||
extern rt_timer_t iot_timer_4;
|
||||
extern rt_mailbox_t iot_mb_at;
|
||||
extern rt_mailbox_t iot_mb_ctl;
|
||||
extern rt_uint8_t iot_read_buff[IOT_READ_BUFF_SIZE];
|
||||
extern rt_int16_t iot_read_len;
|
||||
|
||||
extern rt_uint8_t i_list_num;
|
||||
extern iot_cmd_list_t *i_list_select;
|
||||
|
||||
//extern iot_cmd_list_t iot_list_poweron_lwm2m[];
|
||||
//extern iot_cmd_list_t iot_list_updata_lwm2m[];
|
||||
//extern iot_cmd_list_t iot_list_csq[];
|
||||
|
||||
extern iot_cmd_list_t iot_list_poweron_tcpip[];
|
||||
extern iot_cmd_list_t iot_list_updata_tcpip[];
|
||||
|
||||
|
||||
|
||||
extern iot_device_set_message_t i_set_mess;
|
||||
extern void i_cur_reset(void);
|
||||
|
||||
extern rt_mq_t sensor_rec_mq;
|
||||
extern rt_mq_t sensor_send_mq;
|
||||
|
||||
extern iot_device_message_t i_dev_mess;
|
||||
|
||||
extern rtc_control_t rtc_ctl;
|
||||
extern CircularBuffer ccbuff;
|
||||
|
||||
//临时变量
|
||||
uint32_t methane_temp1 =0;
|
||||
uint32_t voltage_temp2 =0;
|
||||
int32_t temperature_temp_3 =0;
|
||||
uint8_t temp1 = 0;
|
||||
|
||||
/*
|
||||
* 初始参数
|
||||
*/
|
||||
void iot_parameter_init(void)
|
||||
{
|
||||
iot_ctl.i_module = I_TCP_IP;
|
||||
|
||||
// iot_ctl.i_w_packet = 0;
|
||||
// iot_ctl.i_w_packet_alarm = 0;
|
||||
|
||||
iot_ctl.i_dev_work = false;
|
||||
iot_ctl.i_bt_work = false;
|
||||
|
||||
iot_ctl.i_nb_err = 0;
|
||||
|
||||
i_cur_reset();
|
||||
}
|
||||
/*
|
||||
* 等待云平台回应
|
||||
*/
|
||||
void iot_timeout_task_3(void *parameter)
|
||||
{
|
||||
if(iot_ctl.i_send_cmd == I_CMD_WAIT)
|
||||
{
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_OTA_SEND, 1000);
|
||||
}
|
||||
else if(iot_ctl.i_send_cmd == I_CMD_OTA_MESSAGE)
|
||||
{
|
||||
if(iot_ctl.i_ota_request++ < NB_OTA_REQUEST_CNT)
|
||||
{
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_OTA_SEND, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_SLEEP, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 超时关闭电源
|
||||
*/
|
||||
void iot_timeout_task_4(void *parameter)
|
||||
{
|
||||
if(iot_ctl.i_nb_err++ < NB_OPEN_ERR)
|
||||
{
|
||||
LOG_OUT("i_nb_err=%d\r\n", iot_ctl.i_nb_err);
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_WAIT_NETWORK, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_OUT("err_close\r\n");
|
||||
|
||||
iot_ctl.i_run_ste = I_WORK;
|
||||
iot_ctl.i_send_cmd = I_CMD_POWER;
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_RET_SUCC, 1000);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 等待任务
|
||||
*/
|
||||
void iot_ctl_thread_task(void *parameter)
|
||||
{
|
||||
rt_thread_mdelay(100);
|
||||
LOG_OUT("iot_ctl_thread_task OK\r\n");
|
||||
|
||||
|
||||
uint32_t ctl_cmd = 0;
|
||||
uint32_t ctl_ret = 0;
|
||||
uint8_t rec_buff[64] = {0};
|
||||
uint32_t timestamp = 0;
|
||||
while (1)
|
||||
{
|
||||
ctl_ret = rt_mb_recv(iot_mb_ctl, &ctl_cmd, RT_WAITING_FOREVER);
|
||||
if(ctl_ret == RT_EOK)
|
||||
{
|
||||
|
||||
switch(ctl_cmd)
|
||||
{
|
||||
//空闲
|
||||
case I_EVT_IDLE:
|
||||
{
|
||||
LOG_OUT("I_EVT_IDLE\r\n");
|
||||
}
|
||||
break;
|
||||
//上电
|
||||
case I_EVT_POWERON:
|
||||
{
|
||||
LOG_OUT("I_EVT_POWERON\r\n");
|
||||
|
||||
while( (iot_read_len = rt_device_read(app_iot_dev, RT_NULL, RT_NULL, RT_NULL)) > 0)
|
||||
{
|
||||
LOG_OUT("l=%d\r\n", iot_read_len);
|
||||
for(uint8_t t=0; t<iot_read_len; t++)
|
||||
{
|
||||
LOG_OUT("%c",iot_read_buff[t]);
|
||||
}
|
||||
LOG_OUT("\r\n");
|
||||
//IP入网
|
||||
#if IOT_USE_MB26A
|
||||
if((strstr(iot_read_buff, "+CEREG:0,1" ) != NULL))
|
||||
#endif
|
||||
#if IOT_USE_ML307
|
||||
if((strstr(iot_read_buff, "+CEREG: 0,1" ) != NULL))
|
||||
#endif
|
||||
{
|
||||
rt_timer_stop(iot_timer_4);
|
||||
|
||||
|
||||
LOG_OUT("ip_ready\r\n");
|
||||
iot_ctl.i_run_ste = I_WORK;
|
||||
i_cur_reset();
|
||||
|
||||
if(iot_ctl.i_module == I_LWM2M)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
i_list_select = iot_list_poweron_tcpip;
|
||||
}
|
||||
iot_ctl.i_send_cmd = I_CMD_POWER;
|
||||
rt_mb_send_wait(iot_mb_at, I_AT_SEND, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
//返回成功
|
||||
case I_EVT_RET_SUCC:
|
||||
{
|
||||
LOG_OUT("I_EVT_RET_SUCC\r\n");
|
||||
//LOG_OUT("send_cmd=%d\r\n", iot_ctl.i_send_cmd);
|
||||
switch(iot_ctl.i_send_cmd)
|
||||
{
|
||||
//上电事件
|
||||
case I_CMD_POWER:
|
||||
{
|
||||
LOG_OUT("I_CMD_POWER\r\n");
|
||||
rt_timer_stop(iot_timer_4);
|
||||
//提前开存储
|
||||
DEV_POWER_3_ON;
|
||||
rt_thread_mdelay(50);
|
||||
|
||||
if(iot_ctl.i_bt_work == true)
|
||||
{
|
||||
LOG_OUT("i_bt_work 1\r\n");
|
||||
|
||||
iot_ctl.i_bt_work = false;
|
||||
app_bt_data_ret();
|
||||
rt_thread_mdelay(200);
|
||||
|
||||
iot_ctl.i_rtc_up_flag = true;
|
||||
}
|
||||
iot_ctl.i_dev_work = false;
|
||||
|
||||
iot_ctl.i_w_flag = false;
|
||||
|
||||
methane_temp1 = i_dev_mess.methane[0]<<8 | i_dev_mess.methane[1];
|
||||
LOG_OUT("methane=%d\r\n", methane_temp1);
|
||||
if(methane_temp1 > 0 && methane_temp1 < NB_METHANE_FILTRATION)
|
||||
{
|
||||
methane_temp1 = 0;
|
||||
i_dev_mess.methane[0] = 0x00;
|
||||
i_dev_mess.methane[1] = 0x00;
|
||||
LOG_OUT("methane filtration\r\n");
|
||||
}
|
||||
|
||||
voltage_temp2 = i_dev_mess.voltage[0]<<8 | i_dev_mess.voltage[1];
|
||||
LOG_OUT("voltage=%d\r\n", voltage_temp2);
|
||||
|
||||
temperature_temp_3 = (i_dev_mess.temperature[0]<<8 | i_dev_mess.temperature[1]) ;
|
||||
if( (temperature_temp_3 >> 15) & 0x01 )
|
||||
temperature_temp_3 = - (temperature_temp_3 & 0x7FFF);
|
||||
else
|
||||
temperature_temp_3 = (temperature_temp_3 & 0x7FFF);
|
||||
LOG_OUT("temper=%d\r\n",temperature_temp_3);
|
||||
//临时测试
|
||||
#if 0
|
||||
temp1 = 100;
|
||||
#endif
|
||||
|
||||
if(iot_ctl.i_nb_err != NB_OPEN_SUCC)
|
||||
{
|
||||
app_rtc_data_read(×tamp);
|
||||
|
||||
if(timestamp > TIMESTAMP_ERR_DEFAULT)
|
||||
{
|
||||
i_dev_mess.collect_time[0] = (timestamp >>24) & 0xFF;
|
||||
i_dev_mess.collect_time[1] = (timestamp >>16) & 0xFF;
|
||||
i_dev_mess.collect_time[2] = (timestamp >>8) & 0xFF;
|
||||
i_dev_mess.collect_time[3] = (timestamp ) & 0xFF;
|
||||
}
|
||||
}
|
||||
//侧翻振动
|
||||
if(i_dev_mess.turn != 0 )
|
||||
{
|
||||
i_set_mess.gps_flag = true;
|
||||
LOG_OUT("turn_open_gps\r\n");
|
||||
}
|
||||
|
||||
//报警值存储
|
||||
if(methane_temp1 >= i_set_mess.methane_low)
|
||||
{
|
||||
i_dev_mess.logo = 0x07;
|
||||
app_iot_collect_write_cover(ALARM_SAVE, &iot_ctl.i_w_packet_alarm, &i_dev_mess, IOT_SEND_DATA_LEN);
|
||||
LOG_OUT("\r\ni_w_packet_alarm=%d\r\n", iot_ctl.i_w_packet_alarm);
|
||||
}
|
||||
//报警值判断
|
||||
if( (methane_temp1 >= i_set_mess.methane_low) ||
|
||||
(i_dev_mess.methane_state[1] != 0 ) ||
|
||||
(i_dev_mess.turn != 0 ) ||
|
||||
(temperature_temp_3 < NB_TEMPERATURE_LOW || temperature_temp_3 > NB_TEMPERATURE_HIGH) ||
|
||||
(voltage_temp2 < LOW_BATTERY_ALARM) ||
|
||||
(i_dev_mess.water[0] == 0x01) ||
|
||||
(i_dev_mess.water[1] == 0x01) )
|
||||
{
|
||||
iot_ctl.i_alarm_flag = true;
|
||||
iot_ctl.i_alarm_up_flag = true;
|
||||
|
||||
LOG_OUT("alarm happen\r\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_OUT("alarm null\r\n");
|
||||
|
||||
if(iot_ctl.i_alarm_flag == true)
|
||||
{
|
||||
iot_ctl.i_alarm_flag = false;
|
||||
iot_ctl.i_alarm_up_flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
iot_ctl.i_w_flag = true;
|
||||
}
|
||||
}
|
||||
|
||||
//报警上报标志
|
||||
if(iot_ctl.i_alarm_up_flag == true)
|
||||
{
|
||||
LOG_OUT("I_EVT_SEND_MORE\r\n");
|
||||
|
||||
iot_ctl.i_alarm_up_flag = false;
|
||||
i_dev_mess.logo = 0x01;
|
||||
app_iot_collect_write_cover(NORMAL_SAVE, &iot_ctl.i_w_packet, &i_dev_mess, IOT_SEND_DATA_LEN);
|
||||
|
||||
LOG_OUT("\r\ni_w_packet1=%d\r\n",iot_ctl.i_w_packet);
|
||||
|
||||
if(iot_ctl.i_nb_err == NB_OPEN_SUCC)
|
||||
{
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_SEND_MORE, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
//进入低功耗
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_SLEEP, 1000);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( iot_ctl.i_w_flag == true)
|
||||
{
|
||||
LOG_OUT("i_w_packet++\r\n");
|
||||
i_dev_mess.logo = 0x01;
|
||||
app_iot_collect_write_cover(NORMAL_SAVE, &iot_ctl.i_w_packet, &i_dev_mess, IOT_SEND_DATA_LEN);
|
||||
|
||||
LOG_OUT("\r\ni_w_packet2=%d\r\n",iot_ctl.i_w_packet);
|
||||
}
|
||||
|
||||
if(iot_ctl.i_rtc_up_flag == true)
|
||||
{
|
||||
LOG_OUT("i_rtc_up_flag\r\n");
|
||||
|
||||
if(iot_ctl.i_nb_err == NB_OPEN_SUCC)
|
||||
{
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_SEND_MORE, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
//进入低功耗
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_SLEEP, 1000);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//进入低功耗
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_SLEEP, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
//正常数据发送
|
||||
case I_CMD_SEND:
|
||||
{
|
||||
iot_ctl.i_w_packet--;
|
||||
LOG_OUT("I_CMD_SEND=%d\r\n",iot_ctl.i_w_packet);
|
||||
if(iot_ctl.i_w_packet >= 1)
|
||||
{
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_SEND_MORE, 1000);
|
||||
}
|
||||
else if(iot_ctl.i_w_packet == 0)
|
||||
{
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_VERSION, 1000);
|
||||
}
|
||||
}
|
||||
break;
|
||||
//报警数据发送
|
||||
case I_CMD_SEND_ALARM:
|
||||
{
|
||||
iot_ctl.i_w_packet_alarm--;
|
||||
LOG_OUT("I_CMD_SEND_ALARM=%d\r\n",iot_ctl.i_w_packet_alarm);
|
||||
if(iot_ctl.i_w_packet_alarm >= 1)
|
||||
{
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_SEND_ALARM, 1000);
|
||||
}
|
||||
else if(iot_ctl.i_w_packet_alarm == 0)
|
||||
{
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_DOEN_ACK, 1000);
|
||||
}
|
||||
}
|
||||
break;
|
||||
//发送完成等待下行
|
||||
case I_CMD_WAIT:
|
||||
{
|
||||
LOG_OUT("I_CMD_WAIT");
|
||||
LOG_OUT("=%d+%d\r\n",iot_ctl.i_w_packet, iot_ctl.i_w_packet_alarm);
|
||||
|
||||
if( ccbuff.read_flag_2 == true)
|
||||
{
|
||||
app_iot_collect_read_retreat(ALARM_SAVE);
|
||||
}
|
||||
|
||||
iot_ctl.i_ota_request = 0;
|
||||
rt_timer_start(iot_timer_3);
|
||||
}
|
||||
break;
|
||||
//等待升级信息
|
||||
case I_CMD_OTA_MESSAGE:
|
||||
{
|
||||
LOG_OUT("I_CMD_OTA_MESSAGE\r\n");
|
||||
rt_timer_start(iot_timer_3);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case I_CMD_OTA_READY:
|
||||
{
|
||||
LOG_OUT("I_CMD_OTA_READY\r\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
//失败
|
||||
case I_EVT_RET_FAIL:
|
||||
{
|
||||
LOG_OUT("I_EVT_RET_FAIL\r\n");
|
||||
|
||||
if(iot_ctl.i_nb_err == NB_OPEN_SUCC)
|
||||
{
|
||||
//进入低功耗
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_SLEEP, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
//数据处理
|
||||
iot_ctl.i_send_cmd = I_CMD_POWER;
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_RET_SUCC, 1000);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
//RTC事件触发
|
||||
case I_EVT_RTC:
|
||||
{
|
||||
LOG_OUT("I_EVT_RTC %d+%d\r\n", iot_ctl.i_dev_work, iot_ctl.i_bt_work);
|
||||
|
||||
if(ccbuff.read_flag_2 == false)
|
||||
{
|
||||
if( iot_ctl.i_dev_work == false)
|
||||
{
|
||||
iot_ctl.i_dev_work = true;
|
||||
|
||||
|
||||
//主控电源开
|
||||
rt_thread_mdelay(500);
|
||||
LOG_OUT("SENSOR_CMD\r\n");
|
||||
DEV_POWER_1_ON;
|
||||
DEV_POWER_2_ON;
|
||||
rt_thread_mdelay(500);
|
||||
|
||||
temp1 = SENSOR_CMD;
|
||||
rt_mq_send_wait(sensor_rec_mq, &temp1, 1, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
//单次上传
|
||||
case I_EVT_SEND_ONCE:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
//多次上传
|
||||
//报警上次
|
||||
case I_EVT_SEND_MORE:
|
||||
case I_EVT_SEND_ALARM:
|
||||
{
|
||||
LOG_OUT("=%d+%d\r\n",iot_ctl.i_w_packet, iot_ctl.i_w_packet_alarm);
|
||||
if(ctl_cmd == I_EVT_SEND_MORE)
|
||||
{
|
||||
if(app_iot_collect_read_cover(NORMAL_SAVE, NULL, &i_dev_mess, IOT_SEND_DATA_LEN) == RT_EOK)
|
||||
{
|
||||
iot_ctl.i_send_cmd = I_CMD_SEND;
|
||||
}
|
||||
else
|
||||
{
|
||||
iot_ctl.i_w_packet = 0;
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_VERSION, 1000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(ctl_cmd == I_EVT_SEND_ALARM)
|
||||
{
|
||||
if(app_iot_collect_read_cover(ALARM_SAVE, NULL, &i_dev_mess, IOT_SEND_DATA_LEN) == RT_EOK)
|
||||
{
|
||||
iot_ctl.i_send_cmd = I_CMD_SEND_ALARM;
|
||||
}
|
||||
else
|
||||
{
|
||||
iot_ctl.i_w_packet_alarm = 0;
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_DOEN_ACK, 1000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//组包
|
||||
app_iot_up_update(CMD_COLLECT, NULL);
|
||||
LOG_OUT("I_EVT_SEND_MORE\r\n");
|
||||
i_cur_reset();
|
||||
if(iot_ctl.i_module == I_LWM2M)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
i_list_select = iot_list_updata_tcpip;
|
||||
}
|
||||
|
||||
rt_mb_send_wait(iot_mb_at, I_AT_SEND, 3000);
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
//应答+版本
|
||||
case I_EVT_DOEN_ACK:
|
||||
case I_EVT_VERSION:
|
||||
{
|
||||
LOG_OUT("DOEN_ACK+VERSION\r\n");
|
||||
|
||||
i_cur_reset();
|
||||
|
||||
if(ctl_cmd == I_EVT_DOEN_ACK)
|
||||
{
|
||||
app_iot_up_update(CMD_DOWN_ACK, NULL);
|
||||
}
|
||||
else if(ctl_cmd == I_EVT_VERSION)
|
||||
{
|
||||
app_iot_up_update(CMD_VERSION, NULL);
|
||||
|
||||
}
|
||||
|
||||
iot_ctl.i_send_cmd = I_CMD_WAIT;
|
||||
i_list_select = iot_list_updata_tcpip;
|
||||
|
||||
|
||||
rt_mb_send_wait(iot_mb_at, I_AT_SEND, 3000);
|
||||
}
|
||||
break;
|
||||
|
||||
//接收传感器反馈
|
||||
case I_EVT_SENSOR_REC:
|
||||
{
|
||||
ctl_ret = rt_mq_recv(sensor_send_mq, rec_buff, SEND_MQ_SIZE, 5000);
|
||||
if(ctl_ret == RT_EOK)
|
||||
{
|
||||
//更新数据
|
||||
iot_device_message_update(rec_buff);
|
||||
}
|
||||
else
|
||||
{
|
||||
//清空
|
||||
memset(&i_dev_mess, 0x00, sizeof(i_dev_mess));
|
||||
}
|
||||
|
||||
|
||||
//IP切换
|
||||
extern uint8_t iot_ip_address[IOT_IP_MAX_LENGTH];
|
||||
extern uint8_t iot_ip_port_backup[IOT_IP_LENGTH];
|
||||
if( memcmp(i_set_mess.ip_port, iot_ip_port_backup, IOT_IP_LENGTH) != 0 )
|
||||
{
|
||||
LOG_OUT("ip_reset\r\n");
|
||||
memcpy(iot_ip_port_backup, i_set_mess.ip_port, IOT_IP_LENGTH);
|
||||
ip_with_port_to_string(NULL, iot_ip_port_backup[0], iot_ip_port_backup[1], iot_ip_port_backup[2],
|
||||
iot_ip_port_backup[3], (iot_ip_port_backup[4]<<8 | iot_ip_port_backup[5]) );
|
||||
}
|
||||
|
||||
LOG_OUT("ready_iot\r\n");
|
||||
iot_ctl.i_run_ste = I_POWERON;
|
||||
|
||||
//禁止进入低功耗
|
||||
rt_timer_stop(iot_timer_3);
|
||||
|
||||
//准备就绪
|
||||
iot_ctl.i_nb_err = 0;
|
||||
rt_timer_stop(iot_timer_4);
|
||||
bsp_iot_open();
|
||||
rt_timer_start(iot_timer_4);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
//升级请求
|
||||
case I_EVT_OTA_SEND:
|
||||
{
|
||||
LOG_OUT("I_EVT_OTA_SEND\r\n");
|
||||
|
||||
i_cur_reset();
|
||||
app_iot_up_update(CMD_OTA_MESSAGE, NULL);
|
||||
iot_ctl.i_send_cmd = I_CMD_OTA_MESSAGE;
|
||||
i_list_select = iot_list_updata_tcpip;
|
||||
rt_mb_send_wait(iot_mb_at, I_AT_SEND, 3000);
|
||||
}
|
||||
break;
|
||||
|
||||
//等待NB有信号入网
|
||||
case I_EVT_WAIT_NETWORK:
|
||||
{
|
||||
LOG_OUT("I_EVT_WAIT_NETWORK\r\n");
|
||||
rt_timer_start(iot_timer_4);
|
||||
uart_send_lp((rt_uint8_t *)"AT+CSQ\r\n",8);
|
||||
rt_thread_mdelay(1000);
|
||||
uart_send_lp((rt_uint8_t *)"AT+CEREG?\r\n",11);
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
//休眠的设置
|
||||
case I_EVT_SLEEP:
|
||||
{
|
||||
LOG_OUT("IOT_EVT_SLEEP\r\n");
|
||||
|
||||
//资源监测
|
||||
extern void rtthread_info_logout(void);
|
||||
rtthread_info_logout();
|
||||
rt_thread_mdelay(1000);
|
||||
|
||||
i_cur_reset();
|
||||
bsp_iot_close();
|
||||
//关存储
|
||||
DEV_POWER_3_OFF;
|
||||
|
||||
device_lpuart1_switch(LPUART_PRODUCTION, 115200);
|
||||
rt_thread_mdelay(100);
|
||||
device_production_log_output();
|
||||
rt_thread_mdelay(100);
|
||||
device_lpuart1_switch(LPUART_CLOSE, NULL);
|
||||
|
||||
//甲烷浓度改变采集周期
|
||||
LOG_OUT("methane=%d\r\n", methane_temp1);
|
||||
if( (methane_temp1 >= i_set_mess.methane_low) && (methane_temp1 < i_set_mess.methane_high) )
|
||||
{
|
||||
i_set_mess.collect_period = 10;
|
||||
i_set_mess.up_period = 10;
|
||||
}
|
||||
else if( methane_temp1 >= i_set_mess.methane_high)
|
||||
{
|
||||
i_set_mess.collect_period = 5;
|
||||
i_set_mess.up_period = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
i_set_mess.collect_period = i_set_mess.collect_period_save;
|
||||
i_set_mess.up_period = i_set_mess.up_period_save;
|
||||
}
|
||||
|
||||
if( ccbuff.read_flag_1 == true)
|
||||
{
|
||||
app_iot_collect_read_retreat(NORMAL_SAVE);
|
||||
}
|
||||
|
||||
if( ccbuff.read_flag_2 == true)
|
||||
{
|
||||
app_iot_collect_read_retreat(ALARM_SAVE);
|
||||
}
|
||||
|
||||
dev_power.host_sleep_m = m_sleep;
|
||||
iot_ctl.i_dev_work = false;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
//空闲留间隙
|
||||
rt_thread_mdelay(100);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,517 +0,0 @@
|
|||
#include "app_iot_data.h"
|
||||
|
||||
|
||||
extern iot_control_t iot_ctl;
|
||||
extern rt_timer_t iot_timer_3;
|
||||
extern iot_device_message_t i_dev_mess;
|
||||
extern iot_device_set_message_t i_set_mess;
|
||||
|
||||
extern rt_uint8_t iot_send_buff[IOT_SEND_BUFF_SIZE];
|
||||
extern rt_uint8_t iot_send_len ;
|
||||
|
||||
extern device_parameter_t dev_par;
|
||||
extern iot_down_ack_t i_down_ack;
|
||||
extern iot_ver_message_t i_ver_mess;
|
||||
|
||||
extern rt_mailbox_t iot_mb_ctl;
|
||||
|
||||
//const rt_uint8_t send_pack_head_lwm2m[] = {"AT+NMGS=41,"};
|
||||
const rt_uint8_t send_pack_head_tcpip[20] = {0};
|
||||
extern rtc_control_t rtc_ctl;
|
||||
|
||||
extern ota_message_t ota_message;
|
||||
extern rt_timer_t ota_timer_1;
|
||||
extern rt_mailbox_t ota_mb_cmd;
|
||||
|
||||
extern rt_mq_t ota_mq;
|
||||
|
||||
extern uint8_t socket_file_d;
|
||||
/*
|
||||
* 采集数据组包
|
||||
*/
|
||||
void app_iot_up_update(uint8_t cmd, uint16_t data)
|
||||
{
|
||||
|
||||
rt_uint8_t buff_temp[21] = {0};
|
||||
rt_uint8_t iot_send_head_len = 0;
|
||||
memset(iot_send_buff, 0x00, sizeof(iot_send_buff));
|
||||
|
||||
LOG_OUT("ready packets:\r\n");
|
||||
|
||||
if(cmd == CMD_COLLECT)
|
||||
{
|
||||
iot_send_len = IOT_SEND_DATA_LEN;
|
||||
|
||||
#if IOT_USE_MB26A
|
||||
#if NB_SOCKET_FILE_D
|
||||
iot_send_head_len = 11;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=", iot_send_head_len);
|
||||
*(iot_send_buff + 11) = socket_file_d + '0';
|
||||
*(iot_send_buff + 12) = ',';
|
||||
*(iot_send_buff + 13) = '4';
|
||||
*(iot_send_buff + 14) = '1';
|
||||
*(iot_send_buff + 15) = ',';
|
||||
iot_send_head_len = 16;
|
||||
#else
|
||||
iot_send_head_len = 16;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=0,41,", iot_send_head_len);
|
||||
#endif
|
||||
#endif
|
||||
#if IOT_USE_ML307
|
||||
iot_send_head_len = 17;
|
||||
memcpy(iot_send_buff, "AT+MIPSEND=0,41,\"", iot_send_head_len);
|
||||
#endif
|
||||
|
||||
user_num_tran_ascll_2(iot_send_buff+iot_send_head_len, &i_dev_mess, iot_send_len);
|
||||
}
|
||||
else if(cmd == CMD_DOWN_ACK)
|
||||
{
|
||||
iot_send_len = IOT_SEND_ACK;
|
||||
|
||||
#if IOT_USE_MB26A
|
||||
#if NB_SOCKET_FILE_D
|
||||
iot_send_head_len = 11;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=", iot_send_head_len);
|
||||
*(iot_send_buff + 11) = socket_file_d + '0';
|
||||
*(iot_send_buff + 12) = ',';
|
||||
*(iot_send_buff + 13) = '9';
|
||||
*(iot_send_buff + 15) = ',';
|
||||
iot_send_head_len = 15;
|
||||
#else
|
||||
iot_send_head_len = 15;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=0,9,", iot_send_head_len);
|
||||
#endif
|
||||
#endif
|
||||
#if IOT_USE_ML307
|
||||
iot_send_head_len = 16;
|
||||
memcpy(iot_send_buff, "AT+MIPSEND=0,9,\"", iot_send_head_len);
|
||||
#endif
|
||||
|
||||
user_num_tran_ascll_2(iot_send_buff+iot_send_head_len, &i_down_ack, iot_send_len);
|
||||
}
|
||||
else if(cmd == CMD_VERSION)
|
||||
{
|
||||
iot_send_len = IOT_SEND_MESSAGE;
|
||||
|
||||
#if IOT_USE_MB26A
|
||||
#if NB_SOCKET_FILE_D
|
||||
iot_send_head_len = 11;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=", iot_send_head_len);
|
||||
*(iot_send_buff + 11) = socket_file_d + '0';
|
||||
*(iot_send_buff + 12) = ',';
|
||||
*(iot_send_buff + 13) = '6';
|
||||
*(iot_send_buff + 14) = '4';
|
||||
*(iot_send_buff + 15) = ',';
|
||||
iot_send_head_len = 16;
|
||||
#else
|
||||
iot_send_head_len = 16;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=0,64,", iot_send_head_len);
|
||||
#endif
|
||||
#endif
|
||||
#if IOT_USE_ML307
|
||||
iot_send_head_len = 17;
|
||||
memcpy(iot_send_buff, "AT+MIPSEND=0,64,\"", iot_send_head_len);
|
||||
#endif
|
||||
|
||||
user_num_tran_ascll_2(iot_send_buff+iot_send_head_len, &i_ver_mess, iot_send_len);
|
||||
}
|
||||
else if(cmd == CMD_OTA_MESSAGE)
|
||||
{
|
||||
iot_send_len = IOT_SEND_OTA_MESSAGE;
|
||||
|
||||
#if IOT_USE_MB26A
|
||||
#if NB_SOCKET_FILE_D
|
||||
iot_send_head_len = 11;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=", iot_send_head_len);
|
||||
*(iot_send_buff + 11) = socket_file_d + '0';
|
||||
*(iot_send_buff + 12) = ',';
|
||||
*(iot_send_buff + 13) = '2';
|
||||
*(iot_send_buff + 14) = '0';
|
||||
*(iot_send_buff + 15) = ',';
|
||||
iot_send_head_len = 16;
|
||||
#else
|
||||
iot_send_head_len = 16;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=0,20,", iot_send_head_len);
|
||||
#endif
|
||||
#endif
|
||||
#if IOT_USE_ML307
|
||||
iot_send_head_len = 17;
|
||||
memcpy(iot_send_buff, "AT+MIPSEND=0,20,\"", iot_send_head_len);
|
||||
#endif
|
||||
|
||||
app_ota_request(OTA_CMD_REQUEST, NULL, buff_temp);
|
||||
user_num_tran_ascll_2(iot_send_buff+iot_send_head_len, buff_temp, iot_send_len);
|
||||
}
|
||||
else if(cmd == CMD_OTA_STATE)
|
||||
{
|
||||
iot_send_len = IOT_SEND_OTA_STATE;
|
||||
|
||||
#if IOT_USE_MB26A
|
||||
#if NB_SOCKET_FILE_D
|
||||
iot_send_head_len = 11;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=", iot_send_head_len);
|
||||
*(iot_send_buff + 11) = socket_file_d + '0';
|
||||
*(iot_send_buff + 12) = ',';
|
||||
*(iot_send_buff + 13) = '9';
|
||||
*(iot_send_buff + 15) = ',';
|
||||
iot_send_head_len = 15;
|
||||
#else
|
||||
iot_send_head_len = 15;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=0,9,", iot_send_head_len);
|
||||
#endif
|
||||
#endif
|
||||
#if IOT_USE_ML307
|
||||
iot_send_head_len = 16;
|
||||
memcpy(iot_send_buff, "AT+MIPSEND=0,9,\"", iot_send_head_len);
|
||||
#endif
|
||||
|
||||
app_ota_request(OTA_CMD_STATE, data, buff_temp);
|
||||
user_num_tran_ascll_2(iot_send_buff+iot_send_head_len, buff_temp, iot_send_len);
|
||||
}
|
||||
else if(cmd == CMD_OTA_LOSE)
|
||||
{
|
||||
iot_send_len = IOT_SEND_OTA_LOSE;
|
||||
|
||||
#if IOT_USE_MB26A
|
||||
#if NB_SOCKET_FILE_D
|
||||
iot_send_head_len = 11;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=", iot_send_head_len);
|
||||
*(iot_send_buff + 11) = socket_file_d + '0';
|
||||
*(iot_send_buff + 12) = ',';
|
||||
*(iot_send_buff + 13) = '1';
|
||||
*(iot_send_buff + 14) = '0';
|
||||
*(iot_send_buff + 15) = ',';
|
||||
iot_send_head_len = 16;
|
||||
#else
|
||||
iot_send_head_len = 16;
|
||||
memcpy(iot_send_buff, "AT+SKTSEND=0,10,", iot_send_head_len);
|
||||
#endif
|
||||
#endif
|
||||
#if IOT_USE_ML307
|
||||
iot_send_head_len = 17;
|
||||
memcpy(iot_send_buff, "AT+MIPSEND=0,10,\"", iot_send_head_len);
|
||||
#endif
|
||||
|
||||
app_ota_request(OTA_CMD_SINGLE_PACK, data, buff_temp);
|
||||
user_num_tran_ascll_2(iot_send_buff+iot_send_head_len, buff_temp, iot_send_len);
|
||||
}
|
||||
|
||||
|
||||
if(iot_ctl.i_module == I_LWM2M)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
#if IOT_USE_MB26A
|
||||
iot_send_buff[(iot_send_len*2)+iot_send_head_len] = '\r';
|
||||
iot_send_buff[(iot_send_len*2)+iot_send_head_len+1] = '\n';
|
||||
#endif
|
||||
#if IOT_USE_ML307
|
||||
iot_send_buff[(iot_send_len*2)+iot_send_head_len] = '"';
|
||||
iot_send_buff[(iot_send_len*2)+iot_send_head_len+1] = '\r';
|
||||
iot_send_buff[(iot_send_len*2)+iot_send_head_len+2] = '\n';
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
for(uint8_t t=0; t<(iot_send_len*2)+iot_send_head_len+2; t++)
|
||||
{
|
||||
LOG_OUT("%c",iot_send_buff[t]);
|
||||
}
|
||||
LOG_OUT("\r\n");
|
||||
|
||||
// for(uint8_t t=0; t<(iot_send_len*2)+iot_send_head_len+3; t++)
|
||||
// {
|
||||
// LOG_OUT("%x ",iot_send_buff[t]);
|
||||
// }
|
||||
// LOG_OUT("\r\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* URC数据接收
|
||||
*/
|
||||
uint8_t i_urc_deal(uint8_t *data, uint8_t len)
|
||||
{
|
||||
rt_uint16_t len_temp = 0;
|
||||
rt_uint8_t *data_p = data;
|
||||
rt_uint8_t *data_user = NULL;
|
||||
|
||||
rt_uint8_t *jump_place = NULL;
|
||||
int jump_num = 0;
|
||||
|
||||
// LOG_OUT("18=%c ", *(data_p+18));
|
||||
// LOG_OUT("19=%c ", *(data_p+19));
|
||||
// LOG_OUT("20=%c ", *(data_p+20));
|
||||
// LOG_OUT("23=%c\r\n", *(data_p+23));
|
||||
|
||||
#if 0 //BC260Y
|
||||
if(strncmp(data_p+2, "+NNMI", 7) == 0 || strncmp(data_p+2, "+QIURC", 6) == 0)
|
||||
#endif
|
||||
|
||||
#if IOT_USE_MB26A
|
||||
jump_place = strstr(data_p, "+SKTRECV");
|
||||
if( jump_place != NULL )
|
||||
{
|
||||
jump_num = jump_place - data_p;
|
||||
LOG_OUT("jump_num=%d\r\n", jump_num);
|
||||
jump_num += 11;
|
||||
#endif
|
||||
|
||||
#if IOT_USE_ML307
|
||||
jump_place = strstr(data_p, "+MIPURC");
|
||||
if( jump_place != NULL )
|
||||
{
|
||||
jump_num = jump_place - data_p;
|
||||
LOG_OUT("jump_num=%d\r\n", jump_num);
|
||||
jump_num += 18;
|
||||
#endif
|
||||
|
||||
if(iot_ctl.i_module == I_LWM2M)
|
||||
{
|
||||
}
|
||||
else if(iot_ctl.i_module == I_TCP_IP)
|
||||
{
|
||||
#if IOT_USE_MB26A
|
||||
if(*(data_p + jump_num + 1 ) == ',')
|
||||
{
|
||||
len_temp = (*(data_p + jump_num) - '0');
|
||||
LOG_OUT("len_temp=%d\r\n", len_temp);
|
||||
data_user = data_p + jump_num + 3;
|
||||
user_char_tran_numbuff_3(data_user, len_temp*2);
|
||||
}
|
||||
else if(*(data_p + jump_num + 2) == ',')
|
||||
{
|
||||
len_temp = (*(data_p+jump_num) - '0')*10;
|
||||
len_temp += (*(data_p+jump_num+1) - '0');
|
||||
LOG_OUT("len_temp=%d\r\n", len_temp);
|
||||
data_user = data_p + jump_num + 4;
|
||||
user_char_tran_numbuff_3(data_user, len_temp*2);
|
||||
}
|
||||
else if(*(data_p + jump_num + 3) == ',')
|
||||
{
|
||||
len_temp = (*(data_p + jump_num) - '0')*100;
|
||||
len_temp += (*(data_p + jump_num + 1) - '0')*10;
|
||||
len_temp += (*(data_p + jump_num + 2) - '0');
|
||||
LOG_OUT("len_temp=%d\r\n", len_temp);
|
||||
data_user = data_p + jump_num + 5;
|
||||
user_char_tran_numbuff_3(data_user, len_temp*2);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#if IOT_USE_ML307
|
||||
|
||||
if(*(data_p + jump_num + 1) == ',')
|
||||
{
|
||||
len_temp = (*(data_p + jump_num) - '0');
|
||||
LOG_OUT("len_temp=%d\r\n", len_temp);
|
||||
data_user = data_p + jump_num + 2;
|
||||
user_char_tran_numbuff_3(data_user, len_temp*2);
|
||||
}
|
||||
else if(*(data_p + jump_num + 2) == ',')
|
||||
{
|
||||
len_temp = (*(data_p + jump_num) - '0')*10;
|
||||
len_temp += (*(data_p + jump_num + 1) - '0');
|
||||
LOG_OUT("len_temp=%d\r\n", len_temp);
|
||||
data_user = data_p + jump_num + 3;
|
||||
user_char_tran_numbuff_3(data_user, len_temp*2);
|
||||
}
|
||||
else if(*(data_p + jump_num + 3) == ',')
|
||||
{
|
||||
len_temp = (*(data_p + jump_num) - '0')*100;
|
||||
len_temp += (*(data_p + jump_num + 1) - '0')*10;
|
||||
len_temp += (*(data_p + jump_num + 2) - '0');
|
||||
LOG_OUT("len_temp=%d\r\n", len_temp);
|
||||
data_user = data_p + jump_num + 4;
|
||||
user_char_tran_numbuff_3(data_user, len_temp*2);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
LOG_OUT("\r\n");
|
||||
for(uint16_t t=0; t<len_temp; t++)
|
||||
{
|
||||
LOG_OUT("%2x",*(data_user+t));
|
||||
}
|
||||
LOG_OUT("\r\n");
|
||||
|
||||
//业务数据
|
||||
if( *(data_user+0) == 0x02 && *(data_user+1) == 0xDD && (memcmp(data_user+3, dev_par.id_hex, 4) == 0) )
|
||||
{
|
||||
//接收到数据
|
||||
rt_timer_stop(iot_timer_3);
|
||||
|
||||
switch(*(data_user+7))
|
||||
{
|
||||
case 0x01:
|
||||
i_set_mess.methane_low = *(data_user+8)<<8 | *(data_user+9);
|
||||
i_set_mess.methane_low *= 10;
|
||||
LOG_OUT("[%d]", i_set_mess.methane_low);
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
i_set_mess.collect_period = *(data_user+8)<<8 | *(data_user+9);
|
||||
|
||||
rtc_ctl.iot_up_count = 0;
|
||||
rtc_ctl.collect_count =0;
|
||||
|
||||
i_set_mess.collect_period_save = i_set_mess.collect_period;
|
||||
|
||||
LOG_OUT("[%d]", i_set_mess.collect_period);
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
i_set_mess.up_period = *(data_user+8)<<8 | *(data_user+9);
|
||||
|
||||
rtc_ctl.iot_up_count = 0;
|
||||
rtc_ctl.collect_count =0;
|
||||
|
||||
i_set_mess.up_period_save = i_set_mess.up_period;
|
||||
|
||||
LOG_OUT("[%d]", i_set_mess.up_period);
|
||||
break;
|
||||
|
||||
case 0x04:
|
||||
memcpy(i_set_mess.utc, data_user+8, 4);
|
||||
LOG_OUT("[%x %x %x %x]", i_set_mess.utc[0],i_set_mess.utc[1],i_set_mess.utc[2],i_set_mess.utc[3]);
|
||||
break;
|
||||
|
||||
case 0x05:
|
||||
i_set_mess.steal_flag = *(data_user+8);
|
||||
LOG_OUT("[%d]", i_set_mess.steal_flag);
|
||||
break;
|
||||
|
||||
case 0x06:
|
||||
i_set_mess.gps_flag = *(data_user+8);
|
||||
LOG_OUT("[%d]", i_set_mess.gps_flag);
|
||||
break;
|
||||
|
||||
case 0x08:
|
||||
i_set_mess.methane_high = *(data_user+8)<<8 | *(data_user+9);
|
||||
i_set_mess.methane_high *= 10;
|
||||
LOG_OUT("[%d]", i_set_mess.methane_high);
|
||||
break;
|
||||
|
||||
case 0x09:
|
||||
memcpy(i_set_mess.ip_port, data_user+8, 6);
|
||||
LOG_OUT("[%d %d %d %d]", i_set_mess.ip_port[0],i_set_mess.ip_port[1],i_set_mess.ip_port[2],i_set_mess.ip_port[3]);
|
||||
LOG_OUT("[%d]\r\n", (i_set_mess.ip_port[4]<<8 | i_set_mess.ip_port[5]) );
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if( ( *(data_user+7) >= 0x01 && *(data_user+7) <= 0x06 ) || *(data_user+7) == 0x08 || *(data_user+7) == 0x09 )
|
||||
{
|
||||
i_down_ack.cmd = *(data_user+7);
|
||||
i_down_ack.ret = 0x01;
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_DOEN_ACK, 1000);
|
||||
}
|
||||
else if(*(data_user+7) == 0x07)
|
||||
{
|
||||
if(iot_ctl.i_w_packet_alarm >= 1)
|
||||
{
|
||||
i_down_ack.cmd = *(data_user+7);
|
||||
i_down_ack.ret = 0x01;
|
||||
|
||||
app_iot_alarm_read_save();
|
||||
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_SEND_ALARM, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
i_down_ack.cmd = *(data_user+7);
|
||||
i_down_ack.ret = 0x01;
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_DOEN_ACK, 1000);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i_down_ack.cmd = *(data_user+7);
|
||||
i_down_ack.ret = 0x00;
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_DOEN_ACK, 1000);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
//升级信息
|
||||
else if(*(data_user+0) == 0x12 && *(data_user+1) == 0xDD && (memcmp(data_user+4, dev_par.id_hex, 4) == 0))
|
||||
{
|
||||
//接收到数据
|
||||
rt_timer_stop(iot_timer_3);
|
||||
iot_ctl.i_ota_request = NB_OTA_REQUEST_SUCC;
|
||||
|
||||
if( ( *(data_user+8)*10+*(data_user+10) ) > (i_ver_mess.software[0]*10+i_ver_mess.software[2]) )
|
||||
{
|
||||
memcpy(ota_message.ota_ver, data_user+8, 4);
|
||||
ota_message.ota_sizeof = *(data_user+12)<<24 | *(data_user+13)<<16 | *(data_user+14)<<8 | *(data_user+15);
|
||||
ota_message.ota_packets = *(data_user+16)<<8 | *(data_user+17);
|
||||
ota_message.ota_length = *(data_user+18)<<8 | *(data_user+19);
|
||||
ota_message.ota_crc16 = *(data_user+20) << 8 | *(data_user+21);
|
||||
|
||||
LOG_OUT("ver:%x%x%x%x\r\n", ota_message.ota_ver[0],ota_message.ota_ver[1], ota_message.ota_ver[2], ota_message.ota_ver[3]);
|
||||
LOG_OUT("sizeof:%d\r\n", ota_message.ota_sizeof);
|
||||
LOG_OUT("packets:%d\r\n", ota_message.ota_packets);
|
||||
LOG_OUT("length:%d\r\n", ota_message.ota_length);
|
||||
LOG_OUT("crc16:%x\r\n", ota_message.ota_crc16);
|
||||
|
||||
rt_mb_send_wait(ota_mb_cmd, OTA_START, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_mb_send_wait(iot_mb_ctl, I_EVT_SLEEP, 1000);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
//升级状态
|
||||
else if(*(data_user+0) == 0x14 && *(data_user+1) == 0xDD && (memcmp(data_user+4, dev_par.id_hex, 4) == 0))
|
||||
{
|
||||
rt_timer_stop(ota_timer_1);
|
||||
|
||||
if(*(data_user+8) == 0x01)
|
||||
{
|
||||
rt_mb_send_wait(ota_mb_cmd, OTA_START_REC, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_mb_send_wait(ota_mb_cmd, OTA_STOP, 1000);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
//升级数据
|
||||
else if(*(data_user+0) == 0x16 && *(data_user+1) == 0xDD && (memcmp(data_user+4, dev_par.id_hex, 4) == 0))
|
||||
{
|
||||
len_temp = *(data_user+2) << 8 | *(data_user+3);
|
||||
|
||||
LOG_OUT("l=%d\r\n", len_temp);
|
||||
|
||||
if( len_temp == OTA_PACKETS_SIZE + 2)
|
||||
{
|
||||
rt_mq_send_wait(ota_mq, data_user+8, OTA_PACKETS_SIZE, 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_mq_send_wait(ota_mq, data_user+8, len_temp+4, 100);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
#ifndef __APP_IOT_DATA_H
|
||||
#define __APP_IOT_DATA_H
|
||||
|
||||
#include "app_user.h"
|
||||
|
||||
#define IOT_SEND_DATA_LEN (41)
|
||||
#define IOT_SEND_MESSAGE (64)
|
||||
#define IOT_SEND_ACK (9)
|
||||
#define IOT_SEND_OTA_MESSAGE (20)
|
||||
#define IOT_SEND_OTA_STATE (9)
|
||||
#define IOT_SEND_OTA_LOSE (10)
|
||||
|
||||
#define IOT_SEND_DATA_HEAD_LWM2M (11)
|
||||
#define IOT_SEND_DATA_HEAD_TCPIP (16)
|
||||
|
||||
|
||||
|
||||
|
||||
void app_iot_up_update(uint8_t cmd, uint16_t data);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue