请教各位专家:
1、我根据自己的需求对SENSOR 历程进行了修改,在 configSettings 加入自己的控制参数,如下:
#if defined(TEMP_SENSOR)
configSettings.frameControl |= Smsgs_dataFields_tempSensor;
configSettings.frameControl |= Smsgs_dataFields_SensorAlarm //自行添加
#endif
修改后LOAD 运行后,在processSensorMsgEvt 函数中,显示sensor.frameControl=0x39 (Smsgs_dataFields_SensorAlarm define 0x0020),说明配置参数生效。
当我对collector 进行修改后LOAD 运行,SENSOR 端显示发送数据包中 sensor.frameControl=0x19 自行配置的参数
configSettings.frameControl |= Smsgs_dataFields_SensorAlarm 没有启作用,通过查看程序,在SENSOR 重启SENSOR_START_EVT事件中
if(Ssf_getNetworkInfo(&devInfo, &parentInfo ) == true)
{
Ssf_configSettings_t configInfo;
#ifdef FEATURE_MAC_SECURITY
ApiMac_status_t stat;
#endif /* FEATURE_MAC_SECURITY */
LCD_WRITE_STRING("Sensor_process:[445]Ssf_getNetworkInfo == true", 1);
/* Do we have config settings? */
if(Ssf_getConfigInfo(&configInfo) == true)
{
LCD_WRITE_STRING("Sensor_process:[450]Ssf_getConfigInfo == true", 1);
/* Save the config information */
configSettings.frameControl = configInfo.frameControl;
configSettings.reportingInterval = configInfo.reportingInterval;
configSettings.pollingInterval = configInfo.pollingInterval;
/* Update the polling interval in the LLC */
对configSettings进行了重置,查看Ssf_getConfigInfo(&configInfo),发现该函数是从FLASH 读取相关配置负责给configInfo。
问题:
A:Ssf_getNetworkInfo(&devInfo, &parentInfo ) 该函数是否指该SENSOR与COLLECTOR 连结过记录了网络信息,所以再次连接是运行
Jdllc_rejoin(&devInfo, &parentInfo);,
B:(Ssf_getConfigInfo(&configInfo) 为什么在重FLASH 中重读配置,Sensor_init 不是对configSettings进行了配置吗,
id.systemID = NVINTF_SYSID_APP;
id.itemID = SSF_NV_CONFIG_INFO_ID;
id.subID = 0;
/* Read Network Information from NV */
if(pNV->readItem(id, 0, sizeof(Ssf_configSettings_t),
pInfo) == NVINTF_SUCCESS)
{
return (true);
}
FLASH 中的配置是在程序中哪里写入的,没有找到相关函数。
请对以上问题帮忙分析,谢谢。
Viki Shi:
你有试过擦除NV再load新代码进行测试吗?
自由飞翔:
回复 Viki Shi:
我查了下,SENSOR 重新连接时,COLLECTOR 发送了一个配置包,在这里改一下就好了。擦除NV 重新LOAD 肯定可以。
我现在找不到将配置写入NV的程序在哪里,请说明。
自由飞翔:
回复 自由飞翔:
找到了 在Ssf_networkUpdate 函数中对加入设备的网络信息进行了NV写入
在请教个问题,在SENSOR 例程运行时,我按BUTTON 按钮,好像使SENSOR 断开了网络,我没有找到这部分的程序,请问BUTTON 的回调函数在哪里。