|
OpenThread_app
|
Manages the list of discovered devices, pairing logic, and URI resource parsing. More...
#include "hro_utils.h"#include "ot_app_coap_uri_obs.h"#include "ot_app_coap.h"#include "string.h"#include "ot_app.h"Go to the source code of this file.
Classes | |
| struct | otapp_pair_resUrisParseData_t |
| Structure holding temporary parsed data from a URI resource. More... | |
| struct | otapp_pair_uris_t |
| Represents a single URI endpoint belonging to a paired device. More... | |
| struct | otapp_pair_Device_t |
| Represents a fully paired remote device. More... | |
| struct | otapp_pair_rule_t |
| Rules structure defining which device types are allowed to pair. More... | |
| struct | otapp_pair_queueItem_t |
| Structure for the pairing event queue. More... | |
Typedefs | |
| typedef uint8_t | otapp_pair_resUrisBuffer_t[OTAPP_PAIR_URI_RESOURCE_BUFFER_SIZE] |
| typedef struct otapp_pair_DeviceList_t | otapp_pair_DeviceList_t |
| Opaque handle for the device list. | |
| typedef void(* | otapp_pair_observerCallback_t) (otapp_pair_Device_t *newDevice) |
| Prototype for observer callback function. | |
Enumerations | |
| enum | otapp_pair_QueueDataType_t { OTAPP_PAIR_CHECK_AND_ADD_TO_DEV_LIST } |
| Queue event types. More... | |
Functions | |
| int8_t | otapp_pair_init (ot_app_devDrv_t *driver) |
| Initializes the pairing module. | |
| int8_t | otapp_pair_observerPairedDeviceRegisterCallback (otapp_pair_observerCallback_t callback) |
| Registers a callback to be notified when a new device is paired. | |
| int8_t | otapp_pair_DeviceAdd (otapp_pair_DeviceList_t *pairDeviceList, const char *deviceNameFull, otIp6Address *ipAddr) |
| Adds a new device to the pairing list. | |
| int8_t | otapp_pair_DeviceIndexGet (otapp_pair_DeviceList_t *pairDeviceList, const char *deviceNameFull) |
| Retrieves the index of a device in the list by its name. | |
| otapp_pair_Device_t * | otapp_pair_DeviceGet (otapp_pair_DeviceList_t *pairDeviceList, const char *deviceNameFull) |
| Retrieves a pointer to the device structure by name. | |
| char * | otapp_pair_DeviceNameGet (otapp_pair_DeviceList_t *pairDeviceList, uint8_t indexDevice) |
| Retrieves the full name of a device at a specific index. | |
| int8_t | otapp_pair_DeviceDelete (otapp_pair_DeviceList_t *pairDeviceList, const char *deviceNameFull) |
| Removes a device from the pairing list. | |
| int8_t | otapp_pair_DeviceDeleteAll (otapp_pair_DeviceList_t *pairDeviceList) |
| Clears all devices from the pairing list. | |
| otapp_pair_DeviceList_t * | otapp_pair_getHandle (void) |
| Gets the singleton handle to the global device list. | |
| otIp6Address * | otapp_pair_ipAddressGet (otapp_pair_DeviceList_t *pairDeviceList, uint8_t indexDevice) |
| Retrieves the IPv6 address of a device at a specific index. | |
| int8_t | otapp_pair_ipAddressIsSame (otapp_pair_DeviceList_t *pairDeviceList, uint8_t indexDevice, otIp6Address *ipAddr) |
| Checks if the stored IP address matches the provided one. | |
| int8_t | otapp_pair_ipAddressUpdate (otapp_pair_DeviceList_t *pairDeviceList, uint8_t indexDevice, otIp6Address *ipAddrNew) |
| Updates the IP address of a paired device if it has changed. | |
| void | otapp_pair_devicePrintData (otapp_pair_DeviceList_t *pairDeviceList, uint8_t indexDevice) |
| Prints debug information about a paired device to the log. | |
| int8_t | otapp_pair_addToQueue (otapp_pair_queueItem_t *queueItem) |
| Adds an item to the pairing processing queue. | |
| otapp_pair_resUrisParseData_t * | otapp_pair_uriParseMessage (uint8_t *inBuffer, uint16_t inBufferSize, int8_t *result, uint16_t *outParsedDataSize) |
| Parses the payload of a CoAP response containing URI resources. | |
| uint16_t | otapp_pair_uriParseMessageCalculateBufSize (uint16_t aMessagePayloadSize) |
| Calculates the required buffer size to hold a message with URI resources. | |
| int8_t | otapp_pair_uriAdd (otapp_pair_uris_t *deviceUrisList, const otapp_pair_resUrisParseData_t *uriData, const oacu_token_t *token) |
| Adds a parsed URI to a specific slot in a device's URI list. | |
| int8_t | otapp_pair_uriResourcesCreate (otapp_coap_uri_t *uri, uint8_t uriSize, uint8_t *bufferOut, uint16_t *bufferSizeInOut) |
| Serializes a list of device URI resources into a TLV-encoded byte buffer. | |
| uint16_t | otapp_pair_uriResourcesCalculateBufSize (otapp_coap_uri_t *uri, uint8_t uriSize) |
| Calculates the buffer size needed to serialize a list of URIs. | |
| int8_t | otapp_pair_uriStateSet (otapp_pair_DeviceList_t *pairDeviceList, const oacu_token_t *token, const uint32_t *uriState) |
| Sets the state (value) of a URI based on its token. | |
| int8_t | otapp_pair_subSendUpdateIP (otapp_pair_DeviceList_t *pairDeviceList) |
| Resends subscription updates to all paired devices (e.g. after IP change). | |
| otapp_pair_uris_t * | otapp_pair_tokenGetUriIteams (otapp_pair_DeviceList_t *pairDeviceList, const oacu_token_t *token) |
| Finds a URI item in the list by its token. | |
| int8_t | otapp_pair_uriGetIdList (otapp_pair_Device_t *deviceHandle, otapp_deviceType_t uriDevType) |
| Searches for a specific device function type within a device's URI list. | |
Manages the list of discovered devices, pairing logic, and URI resource parsing.
see more information in section: Device Pairing