-
Notifications
You must be signed in to change notification settings - Fork 54
Home
Andrey Voroshkov edited this page Mar 7, 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 | Request | Response | Description | Example |
---|---|---|---|---|
Enumerate Devices | N |
N |
Number of Devices |
N0\n -> N3\n (3 devices found) |
Start Race | R |
R |
Race Status (1 = On, 0 = Off) |
R*R\n -> S0R1\nS1R1\n...
|
End Race | r |
R |
Race Status (1 = On, 0 = Off) |
R*r\n -> S0R0\nS1R0\n...
|
Increase Min Lap Time | M |
M |
Minimal Lap Time (1 byte, in seconds) |
R*M\n -> S0M0A\n...
|
Decrease Min Lap Time | m |
M |
Minimal Lap Time (1 byte, in seconds) |
R*m\n -> S0M0A\n...
|
Next Channel | C |
C |
Current Channel (1 byte) |
R*C\n -> S0C05\n...
|
Previous Channel | c |
C |
Current Channel (1 byte) |
R*c\n -> S0C04\n...
|