--- title: "Handle the PED State Change callback" url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/process-a-basic-transaction-c-library/handle-the-ped-state-change-callback-c-library" source_url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/process-a-basic-transaction-c-library/handle-the-ped-state-change-callback-c-library.md" canonical: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/process-a-basic-transaction-c-library/handle-the-ped-state-change-callback-c-library" last_modified: "2026-05-23T12:56:20+02:00" language: "en" --- # Handle the PED State Change callback [View source](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/process-a-basic-transaction-c-library/handle-the-ped-state-change-callback-c-library.md) ## 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](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/calls-and-callbacks-c-library/implement-callbacks-with-register_device_request). ### Code example The declaration of the PED State Change callback is: ```cpp 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 | 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 synchronized its 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. |