The example program is included in the SDK for two reasons, to allow you to start communicating with the sensor and to serve as a starting point for creating your own application.
This is the algorithm implemented by the program.
- Initialize the sensor.
- 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 sensor.
- Send command Set Operation Modes to the sensor.
- 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 Resolution to the sensor.
- If incoming message is ResolutionMessageType
- Send command Get Mcu Unique Identifier to the sensor.
- If incoming message is McuUniqueIdentifierMessageType
- Send command Set Enable to the sensor.
- Disconnect connection.
- Free up connection memory.
- Uninitialize the sensor.