21 #ifndef PT_API_VERSION 22 #define PT_API_VERSION 2 24 #if PT_API_VERSION != 2 25 #error "Including mixed versions of Protocol API" 28 #ifndef PT_CLIENT_API_H 29 #define PT_CLIENT_API_H 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...
Definition: pt_client_api.h:75
struct protocol_translator_callbacks protocol_translator_callbacks_t
A structure to hold the callbacks of the protocol translator.
void pt_client_free(pt_client_t *client)
Frees the PT API client.
void(* pt_certificate_renewal_notification_handler)(const connection_id_t connection_id, const char *name, int32_t initiator, int32_t status, const char *description, void *userdata)
Type definition for certificate renewal notification. This callback will be called to notify the stat...
Definition: pt_certificate_api.h:123
void(* pt_disconnected_cb)(connection_id_t connection_id, void *userdata)
A function prototype for calling the client code when the connection is disconnected.
Definition: pt_client_api.h:84
pt_status_t pt_client_shutdown(pt_client_t *client)
Gracefully shuts down the protocol translator client.
Contains common structures and definitions for the protocol translator client.
API for subscribing certificate renewal notications and renewing certificates.
connection_id_t pt_client_get_connection_id(pt_client_t *client)
May be used to get the connection ID from the client.
A structure to hold the callbacks of the protocol translator.
Definition: pt_api.h:344
pt_status_t(* pt_device_certificate_renew_request_handler)(const connection_id_t connection_id, const char *device_id, const char *name, void *userdata)
Type definition for certificate renewal request handler for device certificate. This callback will be...
Definition: pt_certificate_api.h:164
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.
Definition: pt_client_api.h:93
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 M...
int pt_api_init()
Use this function to initialize the PT API.
void(* pt_response_handler)(void *userdata)
A function pointer type definition for callbacks given in the protocol translator API functions as an...
Definition: pt_client_api.h:65
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.