Communication Protocol Documentation

The communication protocol for the TCP server is designed to handle various commands and triggers sent from a client. The protocol uses a specific format to encapsulate commands and their parameters, ensuring that the server can interpret and execute them correctly.

Each message sent to the server must be enclosed within `[S]` (start) and `[E]` (end) markers. Commands within the message are separated by semicolons (`;`). Commands can have parameters, which are separated by colons (`:`).

[S]trigger 123;my_command;my_second_command:123;my_string_command:"hello\nworld"[E]

The protocol supports several commands, each with specific parameters. Below are the supported commands and their formats:

1. trigger

  1. Format: `trigger <number>`
  2. Description: Starts a camera trigger with the specified number as trigger id.
  3. Example: `trigger 123`

2. ledson

  1. Format: `ledson`
  2. Description: Turns on the LEDs.
  3. Example: `ledson`
  4. DEPRECATED: was in use with EVT cameras

3. ledsoff

  1. Format: `ledsoff`
  2. Description: Turns off the LEDs.
  3. Example: `ledsoff`
  4. DEPRECATED: was in use with EVT cameras

4. carrierID

  1. Format: `carrierID <number>`
  2. Description: Sets the carrier ID to the specified number. This ID will be added to metadata of image.
  3. Example: `carrierID 456`
  4. DEPRECATED: use meta command to set additional metadata

5. mask

  1. Format: `mask <number>`
  2. Description: Sets the camera mask to the specified number. Allows to disable certain camera trigger.
  3. Example: `mask 5` - will only enable cameras 3 and 1 since 5 = 0b00000101

6. meta

  1. Format: `meta <string>`
  2. Description: Sets additional metadata to an image. The metadata is reset after each trigger, so must be set BEFORE trigger.
  3. Example: `[S]meta:“some metadata\nsupports\nmultiple\lines”;trigger 123[E]`

Single Command

[S]trigger 123[E]

- Description: Starts a camera trigger with the number 123.

Multiple Commands

[S]meta:"some metadata";carrierID 456;trigger 123[E]

- Description: Sets metadata to “some metadata”(without quotes), sets carrierID to 456 and triggers camera with trigger id 123

  • soplarpet/tcp_communication.txt
  • Last modified: 2024/09/17 12:43
  • by superuser