-
Notifications
You must be signed in to change notification settings - Fork 54
Home
Andrey Voroshkov edited this page Sep 14, 2017
·
39 revisions
Welcome to the Chorus-RF-Laptimer wiki!
Each Solo device Receives and Transmits data. Here's how the communication flow is organized from a Solo device standpoint.
- Each Solo device connected into a Chorus has its ID (order number), which is assigned dynamically upon initialization of the Chorus device from a communicating application. Normally enumeration starts with 0.
- Each data chunk is a plain string terminated with "\n" character (ASCII=10) and having a predefined structure.
- There are 3 types of data chunks:
- Requests
- Responses
- Pass-through data
- Almost each Request produces a Response
- Pass-through data is either a request to a different Solo device, or response which needs to pass through current device to reach the Bluetooth dongle and be transmitted to App.
There are 3 types of requests:
- Device enumeration: (3 characters)
"N" + <first_ID> + "\n"
. Example:"N0\n"
- Command/Request: (4 characters)
"R" + <device_ID> + <command> + "\n"
. Example:"R1T\n"
- Calibration: (11 characters)
"C" + <device_ID> + <time_long_HEX_value> + "\n"
. Example:"C00000010A\n"
In any "R" request: <device_ID>
may be set to "*"
, which means the request is addressed to all devices (broadcast), and each should provide a response. Example: "R*A\n"
Note: for broadcast requests the order of responses from different devices is not defined. Example: "S1R1\nS0R1\nS2R1\n"
Response structure: "S" + <device_ID> + <response_type> + <data> + "\n"
Each response type has its own predefined length depending on size of data to be transmitted.
Description | From API version | Request | Response | Description | Example (request -> response) |
---|---|---|---|---|---|
Enumeration | ----- | ----- | ----- | ----- | ----- |
Enumerate Devices | 1 | N | N | Number of Devices | N0\n -> N3\n (3 devices found) |
Calibration | ----- | ----- | ----- | ----- | ----- |
Set Calibration Value | 1 | C | i | Calibration State (half-byte, 1 = Calibrated, 0 = Not Calibrated) | C100000006\n -> S1i1\n |
Commands | ----- | ----- | ----- | ----- | ----- |
Start Race | 1 | R | R | Race Status (half-byte; 1 = On, 0 = Off) | R*R\n -> S0R1\nS1R1\n... |
End Race | 1 | r | R | Race Status (half-byte; 1 = On, 0 = Off) | R*r\n -> S0R0\nS1R0\n... |
Increase Min Lap Time | 1 | M | M | Minimal Lap Time (1 byte, in seconds) | R0M\n -> S0M0A\n |
Decrease Min Lap Time | 1 | m | M | Minimal Lap Time (1 byte, in seconds) | R1m\n -> S1M0A\n |
Set Min Lap Time | 1 | L | M | Request: Minimal Lap Time (1 byte, in seconds); Response: Current Minimal Lap Time (1 byte, in seconds) | R0L05\n -> S0M05\n |
Next RF Band | 1 | B | B + Q | Current Band (half-byte; 0 - 5) + Current Frequency in MHz (2 bytes) | R0B\n -> S0B5\nS0Q1636\n |
Previous RF Band | 1 | b | B + Q | Current Band (half-byte; 0 - 5) + Current Frequency in MHz (2 bytes) | R0b\n -> S0B4\nS0Q1636\n |
Set Band | 1 | N | B + Q | Request: Band to set (half-byte; 0 - 7); Response: Current Band (half-byte; 0 - 7) + Current Frequency in MHz (2 bytes) | R0N5\n -> S0B5\nS0Q1636\n |
Next Channel | 1 | C | C + Q | Current Channel (half-byte; 0 - 7) + Current Frequency in MHz (2 bytes) | R0C\n -> S0C5\nS0Q1636\n |
Previous Channel | 1 | c | C + Q | Current Channel (half-byte; 0 - 7) + Current Frequency in MHz (2 bytes) | R0c\n -> S0C4\nS0Q1636\n |
Set Channel | 1 | H | C + Q | Request: Channel to set (half-byte; 0 - 7); Response: Current Channel (half-byte; 0 - 7) + Current Frequency in MHz (2 bytes) | R0H4\n -> S0C4\nS0Q1636\n |
Set Frequency | 1 | Q | Q | Request: Frequency in MHz to be set (2 bytes); Response: Current Frequency in MHz (2 bytes) | R0Q1636\n -> S0Q1636\n |
Increase Threshold | 1 | T | T | Current Threshold (2 bytes) | R0T\n -> S0T010A\n |
Decrease Threshold | 1 | t | T | Current Threshold (2 bytes) | R0t\n -> S0T0109\n |
Set/Clear Threshold | 1 | S | T | Current Threshold (2 bytes) | R0S\n -> S0T0000\n |
Set Threshold Value | 1 | S | Т | Request: Threshold value to be set (2 bytes); Response: Current Threshold (2 bytes) | R0S012A\n -> S0T012A\n |
Enable/Disable Sounds | 1 | D | D | Sound State (half-byte; 1 = On, 0 = Off) | R1D\n -> S1D0\n |
Start Calibration | 1 | I | No Response | R*I\n -> | |
End Calibration | 1 | i | I | Calibration Time (4 bytes) | R*i\n -> S1I00002710\nS0I00002715\n... |
RSSI Monitor On | 1 | V | V | RSSI Monitor State (half-byte; 1 = On, 0 = Off) | R0V\n -> S0V1\n |
RSSI Monitor Off | 1 | v | V | RSSI Monitor State (half-byte; 1 = On, 0 = Off) | R0v\n -> S0V0\n |
Skip/Enable First Lap | 1 | F | F | First Lap State (half-byte; 1 = Skip, 0 = Count) | R*F\n -> S0F1\nS1F0\n... |
--- | 1 | --- | S | Current RSSI Value; sent each 100ms when RSSI Monitor is On (2 bytes) | -> S0S0111\n |
--- | 1 | --- | L | Lap Time; last Lap Time is automatically sent in race mode when drone passes the gate; All Lap Times sent as a response to Bulk Device State (see below); Format: (1 byte: lap number + 4 bytes: lap time) | -> S1L010000025C\n |
--- | 1 | --- | P | Was device configured after power-up initialization? Used to determine if application should apply saved preferences (if device is not yet configured) or not (if some value has already been set, e.g. frequency) Format: (half-byte; 0 - false; 1 - true) | -> S1P0\n |
Get API Version | 1 | # | # | API version (2 bytes) | R0#\n -> S0#0001\n |
Bulk Device State | 1 | A | CRMTSLDBVFPQ# + X | All states corresponding to specified letters (see above) plus 'X' meaning the end of state transmission for each device | R0A\n -> S0C2\nS0R1\nS0M10\n...S0X1\n |