From 45a4687067f6cfbf17ff0fc8810ededaaeed91ce Mon Sep 17 00:00:00 2001 From: "andr.b" Date: Thu, 9 Apr 2026 21:32:30 +0300 Subject: [PATCH] before start --- .gitignore | 17 +++++++++++++---- AGENTS.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/main.cpp | 2 +- 3 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 AGENTS.md diff --git a/.gitignore b/.gitignore index 48a9424..f244f49 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,14 @@ -/.svn -CMakeLists.txt.user* +*.user +/build* +/bin /release -/build -/*_build_* +*.orig +/.* +*__pycache__* +*test-results.xml + +# Secrets +.jenkins_token + +# Temporary deployment files +meshcontroller.tar.gz diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..c420804 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,51 @@ +# test_server + +A C++ HTTP server using the PIP library. + +## Build & Run + +```bash +mkdir build && cd build +cmake .. +make +./test_server +``` + +## Key Facts + +- **C++ Standard**: C++11 (enforced) +- **Build System**: CMake (generates `compile_commands.json` automatically) +- **Build Directory**: `/build` (ignored in git) +- **Entrypoint**: `src/main.cpp` + +## Dependencies + +The project uses a custom **PIP C++ library** (not Python pip). Required components: +- `PIP::Console` - Console output (`piCout`) +- `PIP::HTTPServer` - HTTP server functionality +- `PIP::IOUtils` - I/O utilities +- `PIP::ClientServer` - Client/server infrastructure + +## Code Style + +- **Formatter**: clang-format (config in `.clang-format`) +- **Indent**: Tabs, width 4 +- **Column Limit**: 140 characters +- **Encoding**: UTF-8 + +Run formatter: +```bash +clang-format -i src/*.cpp src/*.h +``` + +## Architecture + +The server creates a `PIKbdListener` that: +- Captures F10 key press for graceful exit +- Starts an HTTP server (address printed on startup) +- Waits for exit signal via `WAIT_FOR_EXIT` macro + +## Notes + +- Qt Creator is the primary IDE (`.qtcreator/` config present) +- No tests or CI configured diff --git a/src/main.cpp b/src/main.cpp index 30839c1..6535043 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,5 +8,5 @@ int main(int argc, char * argv[]) { ls.start(); piCout << "started on" << httpaddr; WAIT_FOR_EXIT - ls.stopAndWait(); + ls.stopAndWait(); }