aqhome-data: send data in multiple messages. remove limits.
This commit is contained in:
@@ -404,13 +404,14 @@ uint64_t *AQH_Storage_GetDataPoints(AQH_STORAGE *sto, uint64_t valueId, uint64_t
|
||||
uint64_t *arrayPtr;
|
||||
uint64_t i;
|
||||
|
||||
DBG_ERROR(NULL, "Requested %d entries", (int) maxDataPointsRequested);
|
||||
df=_getDataFileByValueId(sto, valueId);
|
||||
if (df==NULL) {
|
||||
DBG_ERROR(AQH_LOGDOMAIN, "No file for value id %lu", (unsigned long int) valueId);
|
||||
return NULL;
|
||||
}
|
||||
numEntries=AQH_DataFile_GetNumberOfEntries(df);
|
||||
if (maxDataPointsRequested>numEntries)
|
||||
if (maxDataPointsRequested>numEntries || maxDataPointsRequested==0)
|
||||
maxDataPointsRequested=numEntries;
|
||||
arrayLen=(maxDataPointsRequested*2)+1;
|
||||
arrayPtr=(uint64_t*) malloc(arrayLen*sizeof(uint64_t));
|
||||
@@ -435,7 +436,8 @@ uint64_t *AQH_Storage_GetDataPoints(AQH_STORAGE *sto, uint64_t valueId, uint64_t
|
||||
|
||||
if ((fromTime==0 || ts>=fromTime) && (toTime==0 || ts<=toTime)) {
|
||||
if ((arrayPos+1)>arrayLen) {
|
||||
DBG_INFO(AQH_LOGDOMAIN, "Limit for number of returned entries reached");
|
||||
DBG_INFO(AQH_LOGDOMAIN, "Limit for number of returned entries reached (%d, numEntries=%d)",
|
||||
(int) arrayLen, (int) numEntries);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user