Pre-requisites
Before running the C SDK, ensure you configure the following platform-specific elements:- Serial Port Communication: Implement methods for reading and writing bytes from your platform’s serial port, which connects to Nayax’s device. The SDK interacts with the hardware through this serial interface. You must implement the following functions:
drv_usart_rx_byte(): Reads a single byte from the serial port.drv_usart_rx_chunk(): Reads multiple bytes in one operation.drv_usart_get_rx_pending(): Returns the number of pending bytes in the serial buffer.drv_usart_tx_data(): Sends data bytes to the VPOS device.
- Periodic Timer Tick: Implement a periodic timer tick to invoke the
vmc_link_background()function. This function should be called with an interval of 5 ms to 10 ms. Additionally, ensure thecpu_platform_get_time()function returns a continuously incrementing millisecond counter since the system startup. - UART Communication Validation: Verify that the UART communication with Nayax’s device is fully functional.
- Check for proper data transmission and reception.
- Validate that event callbacks are triggered correctly.
Integrate Marshall
To get started with the C SDK, follow these steps. You can refer to the providedmymain.c file for a sample code and guidance on importing necessary namespaces into your project.
-
Instantiate a VMC configuration object:
C
-
Fill in the appropriate fields. The following code block presents a standard configuration:
C
Mandatory FieldsThe customer machine information are mandatory fields for the VMC configuration, these are the
model, serial , hw_ver and the manuf_code. Read more about these fields in VMC Configuration Object.-
Configure the SDK and register to link events.
C
-
Start the SDK and wait for the
onReady()event:C