|
数据上传频率太快了,每隔几秒一次。我希望5分钟或者10分钟上传一次。我找到 gizDevReportPolicy(dataPoint_t *currentData)这个函数了,把前面屏蔽掉了(这一部分是如果采集数值发生变化就上传数据,不需要屏蔽了),网上显示设备在线但是,一直没有上传数据。大家帮帮忙
* @brief Datapoints reporting mechanism
*
* 1. Changes are reported immediately
* 2. Data timing report , 600000 Millisecond
*
*@param [in] currentData : Current datapoints value
* @return : NULL
*/
static void gizDevReportPolicy(dataPoint_t *currentData)
{
static uint32_t lastRepTime = 0;
uint32_t timeNow = gizGetTimerCount();
if((1 == gizCheckReport(currentData, (dataPoint_t *)&gizwitsProtocol.gizLastDataPoint)))
{
GIZWITS_LOG("changed, report data\n");
if(0 == gizDataPoints2ReportData(currentData,&gizwitsProtocol.reportData.devStatus))
{
gizReportData(ACTION_REPORT_DEV_STATUS, (uint8_t *)&gizwitsProtocol.reportData.devStatus, sizeof(devStatus_t)); }
memcpy((uint8_t *)&gizwitsProtocol.gizLastDataPoint, (uint8_t *)currentData, sizeof(dataPoint_t));
}
if((0 == (timeNow % (600000))) && (lastRepTime != timeNow))
{
GIZWITS_LOG("Info: 600S report data\n");
if(0 == gizDataPoints2ReportData(currentData,&gizwitsProtocol.reportData.devStatus))
{
gizReportData(ACTION_REPORT_DEV_STATUS, (uint8_t *)&gizwitsProtocol.reportData.devStatus, sizeof(devStatus_t));
}
memcpy((uint8_t *)&gizwitsProtocol.gizLastDataPoint, (uint8_t *)currentData, sizeof(dataPoint_t));
lastRepTime = timeNow;
}
}
|
-
1.png
(34.53 KB, 下载次数: 166)
数据上传条件代码
-
2.png
(69.67 KB, 下载次数: 182)
修改后
|