Terminal-2 icon

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_CB. For more information on how to do this, see Implement callbacks with 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);

Invoke

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.

Parameters

Field Description
ped_dev 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

StateDescription
ped_state_undetectedIncorrect IP, cannot detect the PED. This is a final state.
ped_state_detectedPED detected, correct serial/IP address.
ped_state_identifiedValid PED.
ped_state_registeredPED is registered, final result on RegisterPED.
ped_state_config_syncedPED is has synchronized its configuration.
ped_state_wait_reboot_readyPED is rebooting.
ped_state_wait_ready_for_transactionPED must complete another process before it is ready to create a transaction.
ped_state_not_readyPED is busy. This is a final state. 
ped_state_ready_for_transactionPED is ready for transaction.
ped_state_tenderPED is busy with a tender.