IETF RFC2217 defines a Telnet extension providing serial port functionality. It was initially intended to be used with modems, serial printers, fax machines and similar equipment, but it provides the ability to connect any serial based device to the network.
Nice work! If you're reading and like this kind of code, you may want to also see the dependency serialport-rs, which is a cross-platform serial port library, and which is seeking maintainers.
Cool. But if you're no_std compatible, please be so by default. It doesn't matter if you're my direct dependency, but it does with transitive dependencies.
Only the first layer of the library is no_std compatible, and the server, which most people are arguably looking for is not no_std compatible, hence std feature is enabled by default.
This really depends on what the common use case is. Probably the vast majority of use cases are going to be okay with 'std' and so 'std' should probably be enabled by default. So I wouldn't consider your advice here as good general purpose advice.
I agree it can be annoying if you are on 'no_std' and you depend on a library that doesn't expose the 'std' features of its dependencies. Then you're stuck, but I'd consider that a bug of the dependency you're using.
Now it is important to make your feature be 'std' as opposed to 'no-std'. That is, features should generally represent additive APIs. This is because you can always enable a feature, but you can't disable one if a dependency has enabled it and hasn't provided a way to turn it off.
I love that espressif has managed to port llvm, port rust, and now port their ecosystem to rust. It’s quite amazing. Were their customers asking for rust? Was this an internal thing? Would be amazing to know
This is infact work of Espressif, i am an employee. Libraries of esp-rs are maintained and developed by both Espressif employees and community members.
I assume you mean passes raw data received from TCP/IP through?
RFC2217 lets you change the port settings (for instance baud rate, parity, bit count...), control flow control lines or breaks directly, inspect modem and line state and more.
> I assume you mean passes raw data received from TCP/IP
through?
Yeah `impl TcpStream`
> lets you change the port settings
Might just be lack of familiarity with telnet, but wouldn't this be fairly easy to do `impl TcpStream`? In other words, why not just add this into espflash?
The "serial port" setting, not the "tcp port" setting.
The telnet protocol is not just raw data. The 0xFF byte is an escape code for commands (and a 0xFF needs to be repeated twice pass an actual 0xFF). There are a few commands including those to send a rs232 break signal or to negotiate options such as serial port baud rate (serial ports don't negotiate a speed, so you have to be able to configure the right speed on both ends of the communication)
> The "serial port" setting, not the "tcp port" setting.
Oh that makes more sense, thanks!
> Serial ports don't negotiate a speed, so you have to be able to configure the right speed on both ends of the communication
This is actually why I was asking -- I'm messing around with an espflash-like clone and wanted this feature; so is the idea that its easier to set up the negotiation because of the command structure of telnet (e.g. pattern match on rx `telnet send ayt`)?
17 comments
[ 3.1 ms ] story [ 38.6 ms ] threadhttps://www.rfc-editor.org/rfc/rfc2217.html
I agree it can be annoying if you are on 'no_std' and you depend on a library that doesn't expose the 'std' features of its dependencies. Then you're stuck, but I'd consider that a bug of the dependency you're using.
Now it is important to make your feature be 'std' as opposed to 'no-std'. That is, features should generally represent additive APIs. This is because you can always enable a feature, but you can't disable one if a dependency has enabled it and hasn't provided a way to turn it off.
RFC2217 lets you change the port settings (for instance baud rate, parity, bit count...), control flow control lines or breaks directly, inspect modem and line state and more.
Yeah `impl TcpStream`
> lets you change the port settings
Might just be lack of familiarity with telnet, but wouldn't this be fairly easy to do `impl TcpStream`? In other words, why not just add this into espflash?
The telnet protocol is not just raw data. The 0xFF byte is an escape code for commands (and a 0xFF needs to be repeated twice pass an actual 0xFF). There are a few commands including those to send a rs232 break signal or to negotiate options such as serial port baud rate (serial ports don't negotiate a speed, so you have to be able to configure the right speed on both ends of the communication)
Oh that makes more sense, thanks!
> Serial ports don't negotiate a speed, so you have to be able to configure the right speed on both ends of the communication
This is actually why I was asking -- I'm messing around with an espflash-like clone and wanted this feature; so is the idea that its easier to set up the negotiation because of the command structure of telnet (e.g. pattern match on rx `telnet send ayt`)?