|
OpenThread_app
|
Callback functions handling incoming CoAP requests for specific URI paths. More...
Functions | |
| void | otapp_coap_uri_testHandle (void *aContext, otMessage *request, const otMessageInfo *aMessageInfo) |
| Handler for a generic test resource. | |
| void | otapp_coap_uri_ledControlHandle (void *aContext, otMessage *request, const otMessageInfo *aMessageInfo) |
| Handler for LED control resource (e.g., "light/on_off"). | |
| void | otapp_coap_uri_paringServicesHandle (void *aContext, otMessage *request, const otMessageInfo *aMessageInfo) |
| Handler for Pairing and Discovery services (e.g., "pairing/service"). | |
| void | otapp_coap_uri_subscribedHandle (void *aContext, otMessage *request, const otMessageInfo *aMessageInfo) |
| Client-side Handler for incoming Observe notifications. | |
| void | ad_temp_uri_well_knownCoreHandle (void *aContext, otMessage *request, const otMessageInfo *aMessageInfo) |
Callback functions handling incoming CoAP requests for specific URI paths.
This module defines the "Business Logic" of the CoAP server. Each function corresponds to a specific resource (URI) exposed by the device. These handlers are registered in the main CoAP module and invoked automatically by the OpenThread stack when a matching request arrives. Key Handlers:
| void ad_temp_uri_well_knownCoreHandle | ( | void * | aContext, |
| otMessage * | request, | ||
| const otMessageInfo * | aMessageInfo ) |
| void otapp_coap_uri_ledControlHandle | ( | void * | aContext, |
| otMessage * | request, | ||
| const otMessageInfo * | aMessageInfo ) |
Handler for LED control resource (e.g., "light/on_off").
Processes PUT/POST requests to change the state of the device's LED or relay. Parses the payload (e.g., "1" or "0") and calls the hardware driver to execute the action.
| [in] | aContext | User context pointer. |
| [in] | request | Pointer to the incoming CoAP request message. |
| [in] | aMessageInfo | Pointer to message metadata. |
| void otapp_coap_uri_paringServicesHandle | ( | void * | aContext, |
| otMessage * | request, | ||
| const otMessageInfo * | aMessageInfo ) |
Handler for Pairing and Discovery services (e.g., "pairing/service").
This is the core endpoint for the pairing process.
| [in] | aContext | User context pointer. |
| [in] | request | Pointer to the incoming CoAP request message. |
| [in] | aMessageInfo | Pointer to message metadata. |
| void otapp_coap_uri_subscribedHandle | ( | void * | aContext, |
| otMessage * | request, | ||
| const otMessageInfo * | aMessageInfo ) |
Client-side Handler for incoming Observe notifications.
This function is NOT a server resource (URI) handler in the traditional sense. It is the callback registered when this device subscribes to a remote resource. It is called when a remote device sends a notification (e.g., "Light status changed"). Logic:
| [in] | aContext | User context pointer. |
| [in] | request | Pointer to the incoming notification message. |
| [in] | aMessageInfo | Pointer to message metadata. |
| void otapp_coap_uri_testHandle | ( | void * | aContext, |
| otMessage * | request, | ||
| const otMessageInfo * | aMessageInfo ) |
Handler for a generic test resource.
Used for verifying connectivity and basic CoAP functionality (Ping/Pong). Typically responds with a simple ACK or status payload.
| [in] | aContext | User context pointer (unused). |
| [in] | request | Pointer to the incoming CoAP request message. |
| [in] | aMessageInfo | Pointer to message metadata (source IP, port, etc.). |