session/1.0/inc/ISession.h
Structures
com::quic::sensinghub::session::V1_0::ISession
ISession is transport-neutral, OS-agnostic, extensible interface for communicating to Sensing Hub.
Functions
open
Open the session and establish a connection to Sensing Hub.
Initiates the client session created using getSession(). Sets up and establishes communication channel between the client and the Sensing Hub framework.
This should be called exactly once per ISession instance before any other operations such as setCallBacks() or sendRequest().
close
Closes the session for this instance and release associated resources.
Terminates the communication channel between the client and the Sensing Hub framework and frees any resources held by this session.
After close() is called:
No further requests should be sent using this ISession instance.
Registered callbacks will no longer receive events.
The client is expected to call close() once it is done with the session to avoid leaks and dangling resources.
setCallBacks
Set the callbacks for specified sensor SUID.
Client needs to call only once per given suid.
Associates response, error, and event callbacks with the given SUID for this session. These callbacks are invoked for messages received from Sensing Hub that correspond to the specified SUID.
suid
Unique SUID of the sensor for which callbacks are set.
respCallBack
respCallBack pointer (may be nullptr).
errorCallBack
errorCallBack pointer (may be nullptr)
eventCallBack
eventCallBack pointer (may be nullptr).
sendRequest
Send an asynchronous request for a given sensor.
Sends a protocol-buffer-encoded request message to the Sensing Hub for the specified SUID.
suid
Unique SUID of the target sensor.
std::string
Proto encoded request message, formulated with client API for the given sensor.

