Open
Description
Having worked with a few different modems lately (nRF9160, Quectel BC68, ESP8266) I note they all have APIs to open sockets, and read/write, etc, but they're all different. The nRF9160 uses a BSD-like library, the BC68 uses AT+NSOCR AT commands while the ESP8266 uses AT+CIPxxx AT commands.
I wonder if we could implement some traits for:
- An object which lets you open UDP sockets
- An object which lets you open TCP sockets
- A socket object, which lets you read, write, poll, flush, close, etc (so like the core::io traits we don't yet have I guess, with some extra functions)
We can then write, for example, an HTTP client which works on desktop Linux (we'd have an implementation which uses std::net / mio), or an embedded system with an ESP8266 plugged into a UART, or an embedded sytem with a BC68 plugged into a UART, or on an nRF9160.
Does anything like this exist? If not, I'll see if I can knock up a prototype.