Another test task from a nameless company with great ambitions, recognized market leaders and blah blah .. .
Check | Client OS | Server OS |
---|---|---|
Ok | Debian 11 | Debian 11 |
Ok | Windows 10 | Windows 10 |
Ok | Windows 10 | Debian 11 |
??? | Debian 11 | Windows 10 |
Test description: LED control It is necessary to implement a camera LED control system. The camera LED (LED) is characterized by the following set of parameters.
- Status (state): on / off.
- Color (color): red, green, blue.
- Measurement frequency (rating): 0..5 (in Hertz).
The system should consist of 2 components.
- Application in C ++ (server) that simulates interaction with the LED.
- C++ application (client) that provides an interface to control the LED.
Commands:
Command | Argument | Result | Description |
---|---|---|---|
set-led-state | on, off | OK, FAILED | turn on/off LED |
get-led-state | OK on | off, FAILED | |
set-led-color | red, green, blue | OK, FAILED | set LED color |
get-led-color | OK red | green | |
set-led-rate | 0..5 | OK, FAILED | set LED rate |
get-led-rate | OK 0..5, FAILED | get LED rate |
Examples:
Req – request, Res – response.
Req: "get-led-state\n"
Res: "OK on\n"
Req: "set-led-color yellow\n"
Res: "FAILED\n"
Server:
- The server architecture should make it easy to add new commands and change the logic of the existing ones.
- The server must be able to work with multiple clients, serving requests in real time.
- The server must correctly handle any abnormal situations and errors.
Client:
- The client architecture should make it easy to add new commands and change the logic of the existing ones.
Common:
- Language and Libraries: ISO C++ (up to and including 17) and its standard library, Boost and/or glibc (for Linux).
- The code must be designed to build and run modern distributions of the Linux OS.
- Build system: GNU Make or CMake.