The example program is included in the SDK for two reasons, to allow you to start communicating with the Touch Sensor Module and to serve as a starting point for creating your own application.
This is the algorithm implemented by the program.
- Initialize the Touch Sensor Module.
- Initiate signal handler (CTRL+C for shutdown).
- Create a new connection to device using HID Pipe.
- Connect to device using connection from step 3.
- Read response from connection.
- Optional: Search for platform device.
- Search for the Touch Sensor Module.
- Send command Set Operation Modes to the Touch Sensor Module.
- Loop until interrupt signal from user (CTRL+C).
- Read incoming message.
- Dump incoming message (display it for the user).
- If incoming message is OperationModesMessageType
- Send command Get Mcu Unique Identifier to the Touch Sensor Module.
- If incoming message is McuUniqueIdentifierMessageType
- Send command Set Enable to the Touch Sensor Module.
- Disconnect connection.
- Free up connection memory.
- Uninitialize the Touch Sensor Module.