From b8553067d195e439668117d40f90564681f74219 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Sun, 11 Jan 2026 14:53:50 +0100 Subject: [PATCH] b tcp cmd docs --- docs/tcp_cmd_interface.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/tcp_cmd_interface.md b/docs/tcp_cmd_interface.md index 8eb8fac..1b2eb26 100644 --- a/docs/tcp_cmd_interface.md +++ b/docs/tcp_cmd_interface.md @@ -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 "" : puts text on the lcd -color : set the background color of the lcd -textColor : set the color of the text +color () : set the background color of the lcd +textColor () : set the color of the text listImages : shows a list with images in the filesystem setImage : put an image on the screen setGif : 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 +```