TinyPAN banner

TinyPAN

1 devlog
18h 37m 25s

A Bluetooth tethering library for microcontrollers. Tunnels IP traffic over Bluetooth Classic (BNEP) or BLE (SLIP) directly into the lwIP stack.

This project uses AI

I’ve used AI to work and build for different MCUs

Demo Repository

Loading README...

akhil

Multiple changes to improve alignment, memory use, and SLIP handling:

  • Added ETH_PAD_SIZE=1 (lwipopts.h) and updated HAL/docs so BNEP zero-copy path yields 4-byte-aligned payloads, avoiding DMA bounce logic.
  • Default TX queue size reduced to 3 (tinypan_config.h) and docstrings updated to clarify usable capacity and tuning guidance.
  • BNEP: send a Multicast Filter SET request on NAP connect and handle filter responses (tinypan_bnep.c).
  • Transport/netif: account for ETH_PAD_SIZE when removing/adding headers and when allocating/copying pbufs (tinypan_bnep_transport.c, tinypan_lwip_netif.c). Netif init and slip wiring adjusted for SLIP mode.
  • SLIP transport rewritten to streaming FSM: incoming BLE bytes build pbuf chains incrementally and outgoing frames are streamed/escaped in chunks (tinypan_slip_transport.c). Removed static RX ring buffer and old sio stubs.
  • Mock HAL: record a small ring history of recent TX buffers, add input validation, and expose history accessors for tests (hal/mock/tinypan_hal_mock.c).
  • Supervisor: use transport flush callback and set link down on transitions to ensure consistent behavior (tinypan_supervisor.c).
  • Tests updated to validate multicast filter request and to use the new mock TX history API; DHCP test plumbing adjusted to iterate recent TX history.

These changes reduce RAM usage, improve DMA alignment guarantees, prevent multicast broadcast storms, and make SLIP operation more stream-oriented and memory friendly.

Attachment
0