[HN Gopher] RFC2217 implementation written in Rust
___________________________________________________________________
RFC2217 implementation written in Rust
Author : dnedic
Score : 89 points
Date : 2022-12-19 16:26 UTC (6 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| 3836293648 wrote:
| 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.
| dnedic wrote:
| 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.
| burntsushi wrote:
| 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.
| evevuecrl wrote:
| What is the advantage to using this RFC instead of just having a
| server that writes to (or reads from) a serial port?
| dnedic wrote:
| 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.
| evevuecrl wrote:
| > 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?
| cratermoon wrote:
| 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.
|
| https://www.rfc-editor.org/rfc/rfc2217.html
| evevuecrl wrote:
| Had never heard of this RFC and think it might be useful. Is
| there an example to try with the C3?
| bfrog wrote:
| 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
| proto_lambda wrote:
| I don't think this project specifically is the work of
| Espressif, but rather a community effort. Not sure about the
| other things you mentioned.
| dnedic wrote:
| 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.
| yjftsjthsd-h wrote:
| Any chance you could remark on the motivations for this?
| dnedic wrote:
| I cannot at the moment, it's related to an internal
| project that is not yet public.
| jph wrote:
| 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.
| dnedic wrote:
| Some of my coworkers at Espressif already work on maintaining
| serialport-rs! Most notably https://github.com/jessebraham
___________________________________________________________________
(page generated 2022-12-19 23:01 UTC)