Related SDK API:
Initialize CMS:OTAP_CMS_Init
Set subscription callback function:
OTAP_CMS_SubscribeMsg(ENUM_OTAP_CMS_SET_CALLBACK_FUN ...) , can parse fall detection
data in callback function (OTAP_CMS_SubscribeMsgCallback). If byAlarmType is 1 and szAlarmTopic is
PeopleFallingDownDetection, we can get fall detection data in pAlarmInfoBuf in JSON format.
Set subscription topic:
OTAP_CMS_SubscribeMsg(ENUM_OTAP_CMS_SET_TOPIC_FILTER ...), set pTopicFilter to :"#\r\n\model/#\r\n\0" in
SDK structure OTAP_CMS_SUBSCRIBEMSG_TOPIC_FILTER_PARAM
Start CMS listening and set registration callback function information:
OTAP_CMS_StartListen, radar registration data can be received in callback function
(OTAP_CMS_RegisterCallback).
Below is the correct order of value of dwDataType in the callback function.
1. ENUM_OTAP_CMS_DEV_AUTH, type of pOutBuffer is OTAP_CMS_DEV_REG_INFO. We can get the
device information like device ID, device name, devie serial and etc in OTAP_CMS_DEV_REG_INFO. At the
same time, you must set OTAP key of the device to pInBuffer in the callback function.
2. ENUM_OTAP_CMS_DEV_SESSIONKEY, type pOutBuffer is also OTAP_CMS_DEV_REG_INFO. In this step,
we can get bySessionKey in OTAP_CMS_DEV_REG_INFO. But this is useless for Non load balancing
mode.
3. ENUM_OTAP_CMS_DAS_REQ, we need to configure IP and port of DAS with SDK structure
OTAP_CMS_DAS_INFO
4.ENUM_OTAP_CMS_DEV_ON, device is online. The SDK structure of pOutBuffer is
OTAP_CMS_DEV_REG_INFO. We can use iUserID in the callback function to manipulate the device.
Subscribe event:
Call OTAP_CMS_ConfigDev(OTAP_ENUM_OTAP_CMS_SET_MODEL_ATTR…) to send below json message to
the radar