Data Delivery C API Library Reference
1.2
|
Typedefs | |
typedef int | ddca_edgeap_context_t |
Edge Application context variable type for DDCA Edge Application API. | |
Functions | |
int | ddca_edgeap_context_create (ddca_edgeap_context_t **context) |
create connection context for edge application | |
int | ddca_edgeap_init (const ddca_edgeap_context_t *context, const char *edgeap_profile_name) |
initialize connection for edge application | |
int | ddca_edgeap_emit (const ddca_event_t *event) |
emit given event data to Data Delivery Core | |
int | ddca_edgeap_emit_with_data_type (const ddca_event_t *event) |
emit given event data with data type to Data Delivery Core | |
int | ddca_edgeap_register_event_cb (int(*AP_EVENT_CB)(ddca_event_t *event)) |
register the event callback function | |
int | ddca_edgeap_start (void) |
start to receive the event callback request | |
int | ddca_edgeap_stop (void) |
stop to receive the event callback request | |
int | ddca_edgeap_join (void) |
join the event callback receive thread | |
int | ddca_edgeap_destroy (void) |
destroy the context | |
int | ddca_edgeap_register_process_cb (int(*AP_PROCESS_CB)(const ddca_event_t *request, ddca_event_t *response)) |
register the process callback function | |
int | ddca_edgeap_register_filter_cb (ddca_bool_t(*AP_FILTER_CB)(const ddca_event_t *event)) |
register the filter callback function | |
int | ddca_edgeap_register_transform_cb (int(*AP_TRANSFORM_CB)(ddca_event_t *event)) |
register the transform callback function | |
int | ddca_edgeap_register_operation_cb (int(*AP_OPERATION_CB)(ddca_event_t *event)) |
register the operation callback function | |
int | ddca_edgeap_register_notification_cb (int(*NOTIFICATION_CB)(const ddca_event_t *event)) |
register the notification callback function | |
int | ddca_edgeap_respond (const char *op_id, const ddca_bool_t success) |
send an acknowledgement of the message from REST API to the backend | |
int | ddca_edgeap_get_profile (ddca_conf_profile_t **profile) |
get a registered profile | |
int | ddca_edgeap_update_profile (void) |
update profile |
typedef int ddca_edgeap_context_t |
Edge Application context variable type for DDCA Edge Application API.
This variable type is used to store the connection context between the edge application and data delivery core process.
int ddca_edgeap_context_create | ( | ddca_edgeap_context_t ** | context | ) |
create connection context for edge application
This function creates the connection context for connection between an edge application and data delivery core.
[out] | **context | connection context |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_destroy | ( | void | ) |
destroy the context
This function destroys the context of connection. The function must be called before the end of the program to exit cleanly.
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_emit | ( | const ddca_event_t * | event | ) |
emit given event data to Data Delivery Core
This function emits the given event data to Data Delivery Core indicated by the context.
[in] | *event | data to be emitted |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_emit_with_data_type | ( | const ddca_event_t * | event | ) |
emit given event data with data type to Data Delivery Core
This function emits the given event data with data type to Data Delivery Core indicated by the context.
[in] | *event | data to be emitted |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_get_profile | ( | ddca_conf_profile_t ** | profile | ) |
get a registered profile
This function returns a pointer to a registered profile.
[out] | **profile | a regitered profile |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_init | ( | const ddca_edgeap_context_t * | context, |
const char * | edgeap_profile_name | ||
) |
initialize connection for edge application
This function initializes the connection for a given edge application to Edge delivery core using a context given as a parameter.
[in] | *context | connection context |
[in] | *edgeap_profile_name | file name of edge application profile |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_join | ( | void | ) |
join the event callback receive thread
This function waits to join to the event callback receive thread. The function must be called between the call of ddca_edgeap_start and ddca_edgeap_destroy to terminate the program cleanly.
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_register_event_cb | ( | int(*)(ddca_event_t *event) | AP_EVENT_CB | ) |
register the event callback function
This function marks the given function as the event callback function. This event callback function will be called when the new event is notified to this Edge Application. The one which can be registered is one of only 1 of event callback, process callback, filter callback or transform callback.
[in] | *AP_EVENT_CB | function pointer to be marked as the event callback function |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_register_filter_cb | ( | ddca_bool_t(*)(const ddca_event_t *event) | AP_FILTER_CB | ) |
register the filter callback function
This function marks the given function as the filter callback function. This filter callback function will be called when the new event is notified to this Edge Application. This filter callback function is used to choose whether a received event is forwarded. The one which can be registered is one of only 1 of event callback, process callback, filter callback or transform callback.
[in] | *AP_FILTER_CB | the pointer which indicates the filter callback function |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_register_notification_cb | ( | int(*)(const ddca_event_t *event) | NOTIFICATION_CB | ) |
register the notification callback function
This function marks the given function as the operation callback function. This operation callback function will be called when the operation message is delivered from REST API to this edge application via ICE Core. This operation callback function is used to receive the ddca_event_t variable as the command from REST and expected to act following to its context. ddca_edgeap_respond API is available to respond an acknowledgement to the backend in the callback function.
[in] | *NOTIFICATION_CB | the pointer which indicates the operation callback function |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_register_operation_cb | ( | int(*)(ddca_event_t *event) | AP_OPERATION_CB | ) |
register the operation callback function
This function marks the given function as the operation callback function. This operation callback function will be called when the operation message is delivered from REST API to this edge application via ICE Core. This operation callback function is used to receive the ddca_event_t variable as the command from REST and expected to act following to its context. ddca_edgeap_respond API is available to respond an acknowledgement to the backend in the callback function.
[in] | *AP_OPERATION_CB | the pointer which indicates the operation callback function |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_register_process_cb | ( | int(*)(const ddca_event_t *request, ddca_event_t *response) | AP_PROCESS_CB | ) |
register the process callback function
This function marks the given function as the process callback function. This process callback function will be called when the new event is notified to this Edge Application. This process callback function is used to process event and return response. The one which can be registered is one of only 1 of event callback, process callback, filter callback or transform callback.
[in] | *AP_PROCESS_CB | the pointer which indicates the process callback function |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_register_transform_cb | ( | int(*)(ddca_event_t *event) | AP_TRANSFORM_CB | ) |
register the transform callback function
This function marks the given function as the transform callback function. This transform callback function will be called when the new event is notified to this Edge Application. This transform callback function is used to edit and forward a received event. The one which can be registered is one of only 1 of event callback, process callback, filter callback or transform callback.
[in] | *AP_TRANSFORM_CB | the pointer which indicates the transform callback function |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_respond | ( | const char * | op_id, |
const ddca_bool_t | success | ||
) |
send an acknowledgement of the message from REST API to the backend
This function sends an acknowledgement of the message from REST API to the backend. The response can be associated with the message with an op_id and accumulated to the database on the backend. This function is intended to use to the case that to tell the REST API operator the published message is delivered to the application properly which do not return any result, or which return the result after a while. This functoin can be called only once by an operation.
[in] | *op_id | operation id to be reported with the result |
[in] | success | result to be reported |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_start | ( | void | ) |
start to receive the event callback request
This function starts to receive the event callback request. The event callback request will be delivered after this function is called.
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_stop | ( | void | ) |
stop to receive the event callback request
This function stops to receive the event callback request. The event callback request will not be delivered after this function is called.
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_edgeap_update_profile | ( | void | ) |
update profile
This function notifies C API of renewing a profile. A profile is read in C API, and it's re-registered.
DDCA_SUCCESS | operation success |
others | operation failure |