b tcp cmd docs

This commit is contained in:
2026-01-11 14:53:50 +01:00
parent c0b4a014f5
commit b8553067d1

View File

@@ -1,7 +1,7 @@
# TCP CMD Interface
## Introduction
The tcp cmd interface is a way to control the device over TCP. It is a simple protocol that allows the user to send commands to the device and receive responses. The protocol looks like bash commands. The commands are separated by a new line character (`\n`). The response is sent after the command is executed. The response is also terminated by a new line character (`\n`). The response can be a simple string or a JSON object.
The tcp cmd interface is a way to control the device over TCP. It is a simple protocol that allows the user to send commands to the device and receive responses. The protocol looks like bash commands. The commands are separated by a new line character (`\n`). The response is sent after the command is executed. The response is also terminated by a new line character (`\n`).
## Table of contents
@@ -38,8 +38,8 @@ The `help` command will print a list of available commands.
$> help
help : shows a list of commands
text "<text>" : puts text on the lcd
color <r> <g> <b> : set the background color of the lcd
textColor <r> <g> <b> : set the color of the text
color (<a>) <r> <g> <b> : set the background color of the lcd
textColor (<a>) <r> <g> <b> : set the color of the text
listImages : shows a list with images in the filesystem
setImage <image_name> : put an image on the screen
setGif <image_name> : put a gif on the screen
@@ -53,7 +53,7 @@ $> text "Hello World!"
```
#### `bgcolor`
The `bgcolor` command will set the background color of the screen. The color can be provided in 2 ways: as three numbers between 0 and 255 and one hex value. The first number is the red value, the second is the green value and the third is the blue value.
The `bgcolor` command will set the background color of the screen. The color can be provided in 2 ways: as three numbers between 0 and 255 and one hex value. The first number is the red value, the second is the green value and the third is the blue value. It also has the possible to set the alpha value as the first parameter, this is optional.
```bash
bgcolor 255 0 0
```
@@ -63,7 +63,7 @@ bgcolor 0xFF0000
```
#### `color`
The `color` command will set the color of the text. The color can be provided in 2 ways: as three numbers between 0 and 255 and one hex value. The first number is the red value, the second is the green value and the third is the blue value.
The `color` command will set the color of the text. The color can be provided in 2 ways: as three numbers between 0 and 255 and one hex value. The first number is the red value, the second is the green value and the third is the blue value. It also has the possible to set the alpha value as the first parameter, this is optional.
```bash
color 255 0 0
```
@@ -84,13 +84,21 @@ $> listImages
```
#### `setImage`
The `setImage` command will put an image on the screen. The image must be present in the filesystem. If the image is not present in the filesystem, the device will send an error message. This function only works for BMP images, if you give any other file type, the device will send an error message.
The `setImage` command will put an image on the screen. The image must be present in the filesystem. If the image is not present in the filesystem, the device will send an error message. This function only works for BMP images, if you give any other file type, the device will send an error message. You can also provide the starting x and y coordinates as optional parameters. If no coordinates are provided, the image will be placed at the top left corner of the screen (0,0).
```bash
$> setImage image1.bmp
```
or
```bash
$> setImage image1.bmp 128 64
```
#### `setGif`
The `setGif` command will put a gif on the screen. The gif must be present in the filesystem. If the gif is not present in the filesystem, the device will send an error message. This function only works for GIF images, if you give any other file type, the device will send an error message.
The `setGif` command will put a gif on the screen. The gif must be present in the filesystem. If the gif is not present in the filesystem, the device will send an error message. This function only works for GIF images, if you give any other file type, the device will send an error message. You can also provide the starting x and y coordinates as optional parameters. If no coordinates are provided, the gif will be placed at the top left corner of the screen (0,0).
```bash
$> setGif gif1.gif
```
or
```bash
$> setGif gif1.gif 128 64
```