About this task
In the C Library integration, you will implement most callbacks based on a defined signature.
This includes:
initialization_CBlibrary_shutdown_CBregister_pos_CBregister_ped_CBcreate_new_tender_CBlibrary_exception_CBcancel_or_refund_CBshow_screen_CBtx_store_CB
We have defined a signature for each callback. The signature we provide looks like:
void initialization_CB(void * result, void * echo_pointer);
You will need to implement callback functions with the same signature.
The process differs for callbacks that are added to the
register_device_request structure and passed with the register_ped call. For these callbacks, see . Steps
To use these callbacks:
-
Implement the callback with the same signature. In the following example we will implement the
intitialization_CBcallback.void initialization_CB(void * result, void * echo_struct){ app_context_t * sPOS = (app_context_t *)echo_struct; sPOS->pending_callback = 0; //mark handled } -
Pass
intitialization_CBas a parameter of theinit_librarycall.ADYLibraryResult result = init_library(initReq, initialization_CB, sPOS);