Hello there, as discussed in this post, i'd like to address the issue of how to connect the x16 to the internet. It is something probably everyone wants to do so maybe we could prepare some ground (i'm already looking forward to BBS, simple multiplayer games, etc :)).
So, i think the general idea is to have some external device which will handle the network stack, and relays data to the X16 via uart, spi or any other channel. It would be great if said hardware could be made inexpensively with off the shelf parts and minimum extra, like an ESP32 or some other network-enabled arduino.
Now, one thing that i consider very important is to have a common, abstract interface to do simple network access, so that every hardware developer can build their api against it and offer programmers an uniform, vendor indifferent way to access the internet. Let's not relive the errors of the past era where every program must include code to deal with all possible hardwares ? Remember when you had to choose which soudn card you had and the game developer had to code for all of them?
So, if anyone has some ideas, we could perhaps come to a consensus.
My first idea is to have a specific device that handle tcp sockets, i'll paste my previous post:
Quote
So i was wondering if it would be possible to create a "tcp socket" device, where the filename is an IP address. It would need to be managed by the microcontroller, but it shouldn't be hard at all. It would work like this:
OPEN 1, 20, 0, "142.250.184.100:80"
OPEN 2, 20, 0, "api.server.com:555"
The microcontroller will open the socket connection and associate it with the file number. Subsequent read or write will be routed to the socket, and errors can be mapped to the usual FILE_NOT_FOUND, DEVICE NOT PRESENT etc.
The only problem is that filenames are 16 character long AFAIK, so they can hold any ip address (15 chars top) but not the port. Using the secondary address as port is a problem becouse i think it's at most 128. Now an address+port is 6 bytes so it CAN be fitted in 16 char, for example using hex (C345A100:00C1), but it's pretty unelegant. It would require a conversion routine which is annoying. Perhaps someone has some suggestion (if the whole proposal makes any sense :P).
There's a problem with the size of filenames that's a bit unfortunate.
Another idea could be to reserve some space for a jump table that is to be populated by a "driver" the user can load before the program, if it makes any sense? The API can be as simple as an open/read/write/close set.
I think TCP sockets will cover most of our needs, but beside it, UDP might also be interesting and could be similarly developed. Higher level protocols, i'm not sure. Perhaps an HTTP interafce could be implemented but i think it will be pushing things too far. (A simple HTTP protocol can be directly written on the x16 side, in case.)
A flag could be reserved to create a SSL connection instead of a regular one (obviously the cryptography will be on the microcontroller).