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
ACagliano wrote:
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


So it's like the TINET bridge but you were faster than me to handle the socket things and create a lib :p I should really start learning eZ80 it's amazing the possibilities you get when you know it
TKB_Studios wrote:

So it's like the TINET bridge but you were faster than me to handle the socket things and create a lib :p I should really start learning eZ80 it's amazing the possibilities you get when you know it

Well it's not like the bridge and it doesn't replace the bridge. It just streamlines interacting with a compatible bridge in an easy way. Users don't have to sort out how to run the usb driver, how to set up the serial events properly, how to manage up/down state/etc. It's all managed for them. But you still need a bridge, be it yours, command's, or mine, or whoever else decides to write their own.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement