Handle the PED State Change callback

Implement the PED State Change callback

Implement the ped_state_change_CB callback and assign to the function pointer device_state_update_CBFor more information on how to do this, see Implement callbacks as part of a register_device_request.

Code example

The declaration of the PED State Change callback is:

void ped_state_change_CB(void * ped_dev, ped_device_info *, void * echo_struct);


This is invoked automatically by a change in PED state.

Handle the PED State Change callback

The ped_state_change_CB callback is returned when the PED state is changed and allows you to process this change, if it is required by the business logic of your application. Create this function and assign to the function pointer  device_state_update_CB.


Field Description


Pointer to an internal PED object. This parameter is for internal use only, instead use terminal_id to get access to the PED.
ped_device_info Pointer to the ped_device_info struct in the POS. Use this parameter to get information about the current PED state.
echo_struct Pointer to a POS defined struct. Returned in the callback. Use this parameter to share a POS data struct between the call to the library and the associated callback from the library.

PED States

State Description
ped_state_undetected Incorrect IP, cannot detect the PED. This is a final state.
ped_state_detected PED detected, correct serial/IP address
ped_state_identified Valid PED
ped_state_registered PED is registered, final result on RegisterPED
ped_state_config_synced PED is has synchronised it's configuration.
ped_state_wait_reboot_ready PED is rebooting.
ped_state_wait_ready_for_transaction PED must complete another process before it is ready to create a transaction
ped_state_not_ready PED is busy. This is a final state. 
ped_state_ready_for_transaction PED is ready for transaction
ped_state_tender PED is busy with a tender