Update 'README.md'

This commit is contained in:
Jozef Šimko 2022-05-26 21:27:22 +00:00
parent 4b360e3626
commit 70dc93e440

View File

@ -37,7 +37,7 @@ Server can be launched with 1 or 2 input parameters. The number of parameters de
**port** - specific number to identify communication processes of server
**[config_file]** - configuration file with exact name of variables
**[config_file]** - configuration file with exact name of variables - check *config.cfg* file as example
#### Manual mode
- server waits for input commands from client, sends them to laser sensor and returns results back to client
@ -48,23 +48,30 @@ Server can be launched with 1 or 2 input parameters. The number of parameters de
- `./server <port> [config_file]`
### Client
Client has to be lauched with 2 input parameters.
Client has to be lauched with 2 input parameters. If server is in **manual mode**, the client always loads input commands from *commands.txt*.
**IP address** - IP address of server the client tries to connect
**port** - port number of server
- `./client <IP address> <port>`
### Demo
## Demo
Demo program demonstrates how to create client-like program, which can connect to server in automatic mode and process resulting data.
#### Building
UNIX - `gcc demo.c -Wall -Werror -Wextra -o demo`
WINDOWS - `gcc demo.c -Wall -Wextra -lwsock32 -o demo`
#### Launch
No input parameters.
Macros defines multiple variables used in demo program, which demonstrates connection to server in automatic mode and process of resulting data.
Macros defines multiple variables:
```c
#define IP_ADDRESS "192.168.0.101" // IP address of server
#define PORT 32500 // server port number
#define MAX_VALUE 1265 // upper limit (depends on used units)
#define MIN_VALUE 1200 // lower limit (depends on used units)
#define MAX_VALUE 1265 // upper limit to compare (depends on used units)
#define MIN_VALUE 1200 // lower limit to compare (depends on used units)
```
## References