GeneralEvents interface and APIs for registering callbacks, sending alerts, and requesting time updates.
Events Interface
TheGeneralEvents interface defines various events related to the general operations of the Marshall SDK. Implementing this interface allows your application to respond to specific events triggered during the SDK’s operation. The following code block presents all available event methods:
Events Methods
The table below outlines all the methods available through the interface.| Parameter | Description |
|---|---|
onDCSParamChange(int dcs_param, byte[] data) | When a Nayax Core parameter changes, the parameter identifier and the new data are provided. |
onDisplayEventButtonPressed(byte button_id) | Triggered when a button on the display is pressed, providing the button identifier. |
onDisplayEventTextInput(string input) | Called when text input is received from the display, providing the input text. |
onTransferData(byte[] data) | This function is invoked when data is transferred between the Device and the Peripheral. The transferred data is provided as a byte array: (byte[] data), which contains information structured in TLV (Tag-Length-Value) format.See onTransferData for more details. |
onTimeUpdate(byte year, byte month, byte day, byte hours, byte minutes, byte seconds) | It is called when a time update occurs, providing the updated time value. |
General Methods
The following methods are available to interact with the general facilities of the Marshall SDK:| Parameter | Type | Description |
|---|---|---|
register_callbacks(GeneralEvents events) | void | Registers the callback events for the peripheral general module. This method allows your application to handle the events defined in the GeneralEvents interface. |
alert(short id, String msg) | void | Sends an alert to Nayax Core, shown under Last Alerts. |
requestTime() | void | Makes a time request from the VPOS. The response will arrive as an event (onTimeUpdate). |