OpenThread_app
Loading...
Searching...
No Matches
ot_app_coap_uri_obs.h File Reference

Manages the list of remote subscribers (observers) for local resources. More...

#include "hro_utils.h"
#include "ot_app_coap.h"
#include "ot_app_deviceName.h"

Go to the source code of this file.

Classes

struct  oac_uri_dataPacket_t
struct  oac_uri_obs_t
struct  oac_uri_observer_t

Macros

#define OAC_URI_OBS_TOKEN_LENGTH   4
#define OAC_URI_OBS_SUBSCRIBERS_MAX_NUM   20
#define OAC_URI_OBS_DEVICENAME_FULL_SIZE   OTAPP_DNS_SRV_LABEL_SIZE
#define OAC_URI_OBS_PAIRED_URI_MAX   OTAPP_PAIRED_URI_MAX
#define OAC_URI_OBS_BUFFER_SIZE   (8 * 4)
#define OAC_URI_OBS_TX_BUFFER_SIZE   (OAC_URI_OBS_TOKEN_LENGTH + OAC_URI_OBS_BUFFER_SIZE)
#define OAC_URI_OBS_UPDATE_IP_ADDR_Msk   (0x1UL << 0U)
#define OAC_URI_OBS_UPDATE_URI_TOKEN_Msk   (0x1UL << 1U)
#define OAC_URI_OBS_ADD_NEW_URI_Msk   (0x1UL << 2U)

Typedefs

typedef int8_t oacu_result_t
typedef uint8_t oacu_uriIndex_t
typedef uint8_t oacu_token_t
typedef struct oac_uri_obs_t oac_uri_obs_t
typedef struct oac_uri_observer_t oac_uri_observer_t

Enumerations

enum  oac_obsError_t {
  OAC_URI_OBS_OK = (-1) , OAC_URI_OBS_ERROR = (-2) , OAC_URI_OBS_IS = (-3) , OAC_URI_OBS_IS_NOT = (-4) ,
  OAC_URI_OBS_TOKEN_EXIST = (-5) , OAC_URI_OBS_TOKEN_NOT_EXIST = (-6) , OAC_URI_OBS_LIST_FULL = (-7) , OAC_URI_OBS_IP_UPDATED = (-8) ,
  OAC_URI_OBS_IP_NO_NEED_UPDATE = (-9) , OAC_URI_OBS_NOT_SUB_REQUEST = (-10) , OAC_URI_OBS_ADDED_NEW_DEVICE = (-11) , OAC_URI_OBS_NO_NEED_UPDATE = (-12)
}

Functions

oac_uri_observer_toac_uri_obs_getSubListHandle (void)
 todo
oac_uri_dataPacket_toac_uri_obs_getdataPacketHandle (void)
 get ptr to oac_uri_dataPacket_t struct. it is like as a buffer. You can override it
int8_t oac_uri_obs_subscribe (oac_uri_observer_t *subListHandle, const oacu_token_t *token, oacu_uriIndex_t uriIndex, const otIp6Address *ipAddr, const char *deviceNameFull)
int8_t oac_uri_obs_subscribeFromUri (oac_uri_observer_t *subListHandle, otMessage *aMessage, const otMessageInfo *aMessageInfo, oacu_uriIndex_t uriId, char *deviceNameFull)
int8_t oac_uri_obs_unsubscribe (oac_uri_observer_t *subListHandle, char *deviceNameFull, const oacu_token_t *token)
 todo
int8_t oac_uri_obs_notify (oac_uri_observer_t *subListHandle, const otIp6Address *excludedIpAddr, oacu_uriIndex_t uriIndex, const uint8_t *dataToNotify, uint16_t dataSize)
 todo
int8_t oac_uri_obs_parseMessageFromNotify (const uint8_t *inBuffer, const uint16_t dataSize, oac_uri_dataPacket_t *out)
 parse incomming message from notify
int8_t oac_uri_obs_deleteAll (oac_uri_observer_t *subListHandle)
int8_t oac_uri_obs_sendSubscribeRequest (const otIp6Address *ipAddr, const char *aUriPath, uint8_t *tokenOut)
 todo
int8_t oac_uri_obs_sendSubscribeRequestUpdate (const otIp6Address *ipAddr, const char *aUriPath, uint8_t *tokenIn)
 todo

Detailed Description

Manages the list of remote subscribers (observers) for local resources.

see more information in section: CoAP Observe Registry