Observation ID is not enough to differentiate between multiple
observers from application point of view in the cases of application
needs to notify specific observers. This patch has changes making
ObservationInfo structure to hold connectivity type, address and port information too.
Change-Id: I4f2aa81bf60366d208f0c06a1694ac2bc70665f3
Signed-off-by: Harish Kumara Marappa <h.marappa@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2323
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
ObserveAction action;
// Identifier for observation being registered/unregistered
OCObservationId obsId;
+ // Connectivity type
+ OCConnectivityType connectivityType;
+ // Addresss
+ std::string address;
+ // Port
+ uint16_t port;
} ObservationInfo;
// const strings for different interfaces
m_queryParameters{},
m_requestHandlerFlag{},
m_representation{},
- m_observationInfo{ObserveAction::ObserveRegister, 0},
+ m_observationInfo{},
m_headerOptions{},
m_requestHandle{nullptr},
m_resourceHandle{nullptr}
OC::ObservationInfo observationInfo;
observationInfo.action = (OC::ObserveAction) entityHandlerRequest->obsInfo.action;
observationInfo.obsId = entityHandlerRequest->obsInfo.obsId;
+
+ observationInfo.connectivityType = static_cast<OCConnectivityType>(
+ (entityHandlerRequest->devAddr.adapter << CT_ADAPTER_SHIFT) |
+ (entityHandlerRequest->devAddr.flags & CT_MASK_FLAGS));
+ observationInfo.address = entityHandlerRequest->devAddr.addr;
+ observationInfo.port = entityHandlerRequest->devAddr.port;
pRequest->setObservationInfo(observationInfo);
}
}