const ResponseStatement &_rep, int _result, unsigned int _seq)
{
- if (_result != OC_STACK_OK || _rep.getAttributes().empty() || lastSequenceNum > _seq)
- {
- return;
- }
- else
- {
- lastSequenceNum = _seq;
- }
+ lastSequenceNum = _seq;
if (state != CACHE_STATE::READY)
{
networkTimer.cancel(networkTimeOutHandle);
networkTimeOutHandle = networkTimer.post(CACHE_DEFAULT_EXPIRED_MILLITIME, pTimerCB);
- notifyObservers(_rep.getAttributes());
+ notifyObservers(_rep.getAttributes(), _result);
}
void DataCache::onGet(const HeaderOptions & /*_hos*/,
pollingHandle = pollingTimer.post(CACHE_DEFAULT_REPORT_MILLITIME, pPollingCB);
}
- notifyObservers(_rep.getAttributes());
+ notifyObservers(_rep.getAttributes(), _result);
}
- void DataCache::notifyObservers(const RCSResourceAttributes Att)
+ void DataCache::notifyObservers(const RCSResourceAttributes Att, int eCode)
{
{
std::lock_guard<std::mutex> lock(att_mutex);
{
if (i.second.first.rf == REPORT_FREQUENCY::UPTODATE)
{
- i.second.second(this->sResource, Att);
+ i.second.second(this->sResource, Att, eCode);
}
}
}