A discovery service.
More...
A discovery service.
◆ DPS_DiscoveryHandler
Function prototype for a discovery handler called when a discovery message is received.
- Parameters
-
| service | the service |
| pub | opaque handle for the message that was received |
| payload | payload from the message if any |
| len | length of the payload |
◆ DPS_OnDiscoveryServiceDestroyed
Function prototype for callback function called when a service is destroyed.
- Parameters
-
◆ DPS_CreateDiscoveryService()
Allocate resources for a discovery service.
- Parameters
-
| node | the node |
| serviceId | an application-defined topic segment for discovery information |
- Returns
- the service, or NULL if creation failed
◆ DPS_DestroyDiscoveryService()
Free resources for a discovery service.
- Parameters
-
| service | the service |
| cb | callback function to be called when the service is destroyed |
| data | data to be passed to the callback function |
- Returns
- DPS_OK if the service will be destroyed and the callback called
- DPS_ERR_NULL service or cb was null
- Or an error status code in which case the callback will not be called.
◆ DPS_DiscoveryPublish()
Publish this node's discovery information and receive other node's discovery information.
- Parameters
-
| service | the service |
| payload | optional payload |
| len | length of the payload |
| handler | optional callback function to be called when a discovery message is received |
- Returns
- DPS_OK if successful, an error otherwise
◆ DPS_GetDiscoveryServiceData()
Get application data pointer previously set by DPS_SetDiscoveryServiceData()
- Parameters
-
- Returns
- A pointer to the data or NULL if the service is invalid
◆ DPS_SetDiscoveryServiceData()
Store a pointer to application data in a discovery service.
- Parameters
-
| service | the service |
| data | the data pointer to store |
- Returns
- DPS_OK or an error