Skip to content

Commit 7cb0306

Browse files
authored
add AGENTS.md (#50)
1 parent 6b48665 commit 7cb0306

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# AGENTS.md - TeslaBLE Development Guide
2+
3+
## Build Commands
4+
```bash
5+
cmake -B build -DCMAKE_MESSAGE_LOG_LEVEL=ERROR && cmake --build build -j8 2>&1 | grep -E "error:|Error:|Built target|failed" | head -20 || true
6+
cd build && ctest -j1 --output-on-failure 2>&1 | grep -E "(FAILED.*\]|^[0-9]+% tests|expected equality|Which is:|tests/.*:.*:.*Failure|Failed to)"
7+
```
8+
9+
## Architecture
10+
- **Library**: C++23 library for Tesla vehicle BLE communication
11+
- **Core Classes**: `Client` (main API), `CryptoContext` (keys/EC), `Peer` (sessions per domain)
12+
- **Domains**: VEHICLE_SECURITY, INFOTAINMENT (via `UniversalMessage_Domain`)
13+
- **Protocol**: Protobuf messages (nanopb), AES-GCM encryption (mbedtls)
14+
- **Dependencies**: nanopb, mbedtls, googletest
15+
- **Generated Code**: `generated/src/*.pb.c`, `generated/include/*.pb.h`
16+
17+
## Code Style
18+
- **Namespace**: `TeslaBLE`
19+
- **Naming**: `PascalCase` classes, `snake_case` functions, `_` suffix for members (`crypto_context_`)
20+
- **Types**: Use `pb_byte_t`, `pb_size_t` for protobuf; `std::array`, `std::unique_ptr`
21+
- **Error Handling**: Return `TeslaBLE_Status_E` enum (0=OK); use `LOG_ERROR`/`LOG_DEBUG` macros
22+
- **Formatting**: No comments unless requested; 4-space indent; braces on same line
23+
- **Protobuf**: Use `*_init_default`/`*_init_zero`; encode with `pb_encode_fields`, decode with `pb_decode`

0 commit comments

Comments
 (0)