Distributed Publish & Subscribe for IoT
registration.h File Reference

A registration service. More...

Go to the source code of this file.

Data Structures

struct  _DPS_Registration
 Registration entry. More...
 
struct  _DPS_RegistrationList
 For returning a list of candidate remote nodes. More...
 

Macros

#define DPS_CANDIDATE_FAILED   0x02
 An attempt to link to a candidate was attempted but failed.
 
#define DPS_CANDIDATE_INVALID   0x10
 This is a invalid candidate address for linking.
 
#define DPS_CANDIDATE_LINKED   0x04
 Registration is currently linked.
 
#define DPS_CANDIDATE_TRYING   0x01
 An attempt is being made link to a candidate.
 
#define DPS_CANDIDATE_UNLINKED   0x08
 Registration was linked but is currently not linked.
 
#define DPS_REGISTRATION_GET_TIMEOUT   5000
 Default 5 second timeout for get requests.
 
#define DPS_REGISTRATION_PUT_TIMEOUT   2000
 Default 2 second timeout for put requests.
 

Typedefs

typedef void(* DPS_OnRegGetComplete) (DPS_RegistrationList *regs, DPS_Status status, void *data)
 Function prototype for callback called when DPS_Registration_Get() completes. More...
 
typedef void(* DPS_OnRegLinkToComplete) (DPS_Node *node, DPS_RegistrationList *regs, const DPS_NodeAddress *addr, DPS_Status status, void *data)
 Function prototype for callback called when DPS_Registration_LinkTo() completes. More...
 
typedef void(* DPS_OnRegPutComplete) (DPS_Status status, void *data)
 Function prototype for callback called when DPS_Registration_Put() completes. More...
 
typedef struct _DPS_Registration DPS_Registration
 Registration entry.
 
typedef struct _DPS_RegistrationList DPS_RegistrationList
 For returning a list of candidate remote nodes.
 

Functions

DPS_RegistrationListDPS_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...
 

Variables

const char * DPS_RegistryTopicString
 The registry topic string.
 

Detailed Description

A registration service.