A registration service.
More...
|
| DPS_RegistrationList * | DPS_CreateRegistrationList (uint8_t size) |
| | Create an empty registration list of the specified size. More...
|
| |
| void | DPS_DestroyRegistrationList (DPS_RegistrationList *regs) |
| | Destroy a registration list and free resources. More...
|
| |
| DPS_Status | DPS_Registration_Get (DPS_Node *node, const char *addrText, const char *tenantString, DPS_RegistrationList *regs, uint16_t timeout, DPS_OnRegGetComplete cb, void *data) |
| | Lookup the addresses registered with a registration service. More...
|
| |
| DPS_Status | DPS_Registration_GetSyn (DPS_Node *node, const char *addrText, const char *tenantString, DPS_RegistrationList *regs, uint16_t timeout) |
| | A synchronous version of DPS_RegistrationGet() this function blocks until the candidate list has been populated or the request times out. More...
|
| |
| DPS_Status | DPS_Registration_LinkTo (DPS_Node *node, DPS_RegistrationList *regs, DPS_OnRegLinkToComplete cb, void *data) |
| | Randomly select a remote candidate to link to. More...
|
| |
| DPS_Status | DPS_Registration_LinkToSyn (DPS_Node *node, DPS_RegistrationList *regs, DPS_NodeAddress *addr) |
| | Synchronous version of Registration_LinkTo. More...
|
| |
| DPS_Status | DPS_Registration_Put (DPS_Node *node, const char *addrText, const char *tenantString, uint16_t timeout, DPS_OnRegPutComplete cb, void *data) |
| | Register a local node with a registration service. More...
|
| |
| DPS_Status | DPS_Registration_PutSyn (DPS_Node *node, const char *addrText, const char *tenantString, uint16_t timeout) |
| | Synchronous version of DPS_RegistrationPut(). More...
|
| |
A registration service.
◆ DPS_OnRegGetComplete
◆ DPS_OnRegLinkToComplete
Function prototype for callback called when DPS_Registration_LinkTo() completes.
- Parameters
-
| regs | The list of registrations addresses passed in to DPS_Registration_LinkTo(). |
| addr | The address if the remote if status == DPS_OK |
| status | Status code indicating success or failure
- DPS_OK if a link was successfully established
- DPS_ERR_NO_ROUTE if a link could not be established
- Other error status codes
|
| data | Caller supplied data passed into the DPS_Registration_LinkTo() |
◆ DPS_OnRegPutComplete
| typedef void(* DPS_OnRegPutComplete) (DPS_Status status, void *data) |
Function prototype for callback called when DPS_Registration_Put() completes.
- Parameters
-
| status | Status code indicating success or failure
- DPS_OK if the registration was made
- Other error status codes
|
| data | Caller supplied data passed into the DPS_Registration_Put() |
◆ DPS_CreateRegistrationList()
Create an empty registration list of the specified size.
- Parameters
-
| size | The desired size of the list |
- Returns
- The newly created registration list or NULL if an error occurred
◆ DPS_DestroyRegistrationList()
Destroy a registration list and free resources.
- Parameters
-
| regs | A previously created registration list |
◆ DPS_Registration_Get()
Lookup the addresses registered with a registration service.
- Parameters
-
| node | The node |
| addrText | The text string of the registration service address |
| tenantString | Topic string identifying the tenant |
| regs | Registration list for accumulating the results. The count field must be initialized with the maximum number of registrations to be returned. The candidate list pointer must remain valid until the callback is called. |
| timeout | Timeout in milliseconds |
| cb | The callback to call with the result |
| data | Caller supplied data to be passed to the callback |
- Returns
- DPS_OK if the registration get request was successfully initiated, otherwise returns an error status and the callback function will not be called.
◆ DPS_Registration_GetSyn()
A synchronous version of DPS_RegistrationGet() this function blocks until the candidate list has been populated or the request times out.
- Parameters
-
| node | The node |
| addrText | The text string of the registration service address |
| tenantString | Topic string identifying the tenant |
| regs | Registration list for accumulating the results. |
| timeout | Timeout in milliseconds |
- Returns
- DPS_OK if the get request succeeded or and error status for the failure.
◆ DPS_Registration_LinkTo()
Randomly select a remote candidate to link to.
- Parameters
-
| node | The local node to link |
| regs | The list of candidate registrations to try to link to |
| cb | The callback to call with the result |
| data | Caller supplied data to be passed to the callback |
- Returns
- Status code indicating success or failure
- DPS_OK if a link is being tried, the success or failure will be reported in the callback
- DPS_ERR_NO_ROUTE if no new links can be established
- Other error status codes
◆ DPS_Registration_LinkToSyn()
Synchronous version of Registration_LinkTo.
- Parameters
-
| node | The local node to link |
| regs | The list of candidate registrations to try to link to |
| addr | Set to the address of the linked candidate |
- Returns
- Status code indicating success or failure
- DPS_OK if a link was successfully established
- DPS_ERR_NO_ROUTE if no new links can be established
- Other error status codes
◆ DPS_Registration_Put()
Register a local node with a registration service.
- Parameters
-
| node | The local node to register |
| addrText | The text string of the registration service address |
| tenantString | Topic string identifying the tenant |
| timeout | Timeout in milliseconds |
| cb | Callback called when the registration completes. |
| data | Caller provided data to be passed to the callback function |
- Returns
- DPS_OK if the registration put request was successfully initiated, otherwise returns an error status and the callback function will not be called.
◆ DPS_Registration_PutSyn()
| DPS_Status DPS_Registration_PutSyn |
( |
DPS_Node * |
node, |
|
|
const char * |
addrText, |
|
|
const char * |
tenantString, |
|
|
uint16_t |
timeout |
|
) |
| |
Synchronous version of DPS_RegistrationPut().
This function blocks until the operations is complete.
- Parameters
-
| node | The local node to register |
| addrText | The text string of the registration service address |
| tenantString | Topic string identifying the tenant |
| timeout | Timeout in milliseconds |
- Returns
- DPS_OK if the put request succeeded or and error status for the failure.