Mistake on this page? Email us

Contains the interface to create, connect, register, unregister and shut down the protocol translator client. Also contains call declaration of call-back which is called if client is disconnected. More...

Go to the source code of this file.

Data Structures

struct  protocol_translator_callbacks
 A structure to hold the callbacks of the protocol translator. More...
 

Macros

#define PT_API_VERSION   2
 
#define PT_CLIENT_API_H
 

Typedefs

typedef void(* pt_response_handler) (void *userdata)
 A function pointer type definition for callbacks given in the protocol translator API functions as an argument. This function definition is used for providing success and failure callback handlers. More...
 
typedef void(* pt_connection_ready_cb) (connection_id_t connection_id, const char *name, void *userdata)
 A function prototype for calling the client code when the connection is ready for passing messages. More...
 
typedef void(* pt_disconnected_cb) (connection_id_t connection_id, void *userdata)
 A function prototype for calling the client code when the connection is disconnected. More...
 
typedef void(* pt_connection_shutdown_cb) (connection_id_t connection_id, void *userdata)
 A function prototype for calling the client code when the connection is shutting down. More...
 
typedef struct protocol_translator_callbacks protocol_translator_callbacks_t
 A structure to hold the callbacks of the protocol translator.
 

Functions

int pt_api_init ()
 Use this function to initialize the PT API. More...
 
pt_client_t * pt_client_create (const char *socket_path, const protocol_translator_callbacks_t *pt_cbs)
 Creates an instance of a PT API client. More...
 
void pt_client_free (pt_client_t *client)
 Frees the PT API client. More...
 
connection_id_t pt_client_get_connection_id (pt_client_t *client)
 May be used to get the connection ID from the client. More...
 
int pt_client_start (pt_client_t *client, pt_response_handler success_handler, pt_response_handler failure_handler, const char *name, void *userdata)
 Starts the protocol translator client event loop and tries to connect to a local instance of Device Management Edge. When a connection is established, it tries to register the protocol translator. When registering succeeds the success_handler will be called. If registering fails the failure_handler will be called. This could happen for example, if the protocol translator name is already in use in Device Management Edge instance. More...
 
pt_status_t pt_client_shutdown (pt_client_t *client)
 Gracefully shuts down the protocol translator client. More...
 

Detailed Description

Contains the interface to create, connect, register, unregister and shut down the protocol translator client. Also contains call declaration of call-back which is called if client is disconnected.