As the name implies, this is a dylib (like the others that come with the toolchain) that provide a socket-like API for use with the CE C toolchain. In reality, the API simply frontends the initialization of the serial driver, handshaking with a bridge running on a device that can actually establish sockets, and then sends packets of type control (directives to the bridge) or relay (packets to relay to the socket).
NOTE: This is experimental and has only been through a few tests. Posting it so others can mess about with it and report bugs.
There are a few considerations for a bridge to be compatible with this, and theoretically ANY bridge that follows these can be used.
1. EVERY packet forwarded to the bridge needs a prefix byte to indicate if it is a control packet or a relay packet. The defaults for the included bridge are 0xFB for control and 0x00 for relay.
2. The first 3 bytes of any packet to relay must be the size of the data segment of the packet. So [0x00][size_t][data]. This is the format the bridge will receive data in and should be parsed as such.
3. The control packets have the following format: [0xFB][directive][aad] where directive is a single byte indicating the function to execute. The calc-side API reserves directive 0x00 as "connect" and 0x01 as STARTTLS, so please keep that as is if you're writing your own bridge. Any other directive codes are free to use.
API Documentation: https://acagliano.github.io/netbridgece/
Library: https://github.com/acagliano/netbridgece
NOTE: This is experimental and has only been through a few tests. Posting it so others can mess about with it and report bugs.
There are a few considerations for a bridge to be compatible with this, and theoretically ANY bridge that follows these can be used.
1. EVERY packet forwarded to the bridge needs a prefix byte to indicate if it is a control packet or a relay packet. The defaults for the included bridge are 0xFB for control and 0x00 for relay.
2. The first 3 bytes of any packet to relay must be the size of the data segment of the packet. So [0x00][size_t][data]. This is the format the bridge will receive data in and should be parsed as such.
3. The control packets have the following format: [0xFB][directive][aad] where directive is a single byte indicating the function to execute. The calc-side API reserves directive 0x00 as "connect" and 0x01 as STARTTLS, so please keep that as is if you're writing your own bridge. Any other directive codes are free to use.
API Documentation: https://acagliano.github.io/netbridgece/
Library: https://github.com/acagliano/netbridgece