|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
Layer: Foundation ยท Build flags: PC_ENABLE_DMA, PC_ENABLE_PREEMPT_QUEUE, PC_ENABLE_GATEWAY, PC_DMA_SIMULATE
The capstone of the v5 ingest pipeline: a wireless gateway. A southbound radio (LoRa / nRF24 / Zigbee / ... reached over SPI / I2C / UART) receives frames, and the device bridges them to the web stack - MQTT / HTTP / WebSocket.
Everything below the codec is a feature from earlier examples:
services/gateway) envelopes and publishes it.Register each radio as a port (with an optional transmit callback for downlink), and install the uplink - the northbound publish:
pc_gateway_msg with the source address, port, RSSI, and a sequence number. pc_gateway_topic() formats a routing key <prefix>/<port>/<addr>.pc_gateway_downlink(port, dst_addr, payload, len) transmits a northbound command back out the radio via the port's transmit callback.rate_cap (frames/second) throttles a chatty radio; excess is dropped, not blocked.pc_gateway_get_stats()), never blocks.The radio TX and the northbound publish are callbacks, so this runs with no radio hardware: the sketch feeds simulated frames through the DMA simulator and prints the publishes. A real build swaps the feed for the module's SPI RX and the publish for an MQTT client - the pipeline is unchanged.
Storage is static (zero heap): PC_GW_MAX_PORTS ports.
The flags must reach the library build, so pass them as build flags: