How karan90687/sensor_hub works
This is a small C packet-format example: one executable serializes a 13-byte frame, while another reads bytes, builds a packet, validates it, and prints it. The shared protocol code defines the packet and checks length, sync byte, checksum, and unused flag bits. The generator writes to tests/data/edge.bin, but the analyzer reads a different hard-coded absolute path, so the graph does not imply that the generator’s output feeds the analyzer. The README documents the byte layout; source excerpts establish the runtime calls.
Main entry points: main.c Buffer Analyzer · gen.c Frame Generator · protocol.h Packet Definition · protocol.c Packet Validator
Components 8
Packet Format
- Packet Definition
common/protocol.h - Packet Validator
common/protocol.c
Frame Generation
- Frame Generator
host/gen.c - Generated Buffer
Buffer Analysis
- Analysis Input
- Buffer Analyzer
host/main.c - Packet Printer
host/format.c
Other components
- Operator
Connections 9
- Operator → Frame Generator: runs
host/gen.c - Frame Generator → Packet Definition: populates
host/gen.c - Frame Generator → Generated Buffer: writes bytes
host/gen.c - Operator → Buffer Analyzer: runs
host/main.c - Buffer Analyzer → Analysis Input: reads bytes
host/main.c - Buffer Analyzer → Packet Definition: builds frame
host/main.c - Buffer Analyzer → Packet Validator: validates
host/main.c - Packet Validator → Packet Definition: checks fields
common/protocol.c - Buffer Analyzer → Packet Printer: prints valid frame
host/main.c