Serial Framing Protocol (SFP)
Reduction counting NIF for Erlang and Elixir based on BaroboRobotics/libsfp library, which is “a reliable, message-oriented, point-to-point communications protocol suitable for embedding in systems with severely constrained resources.”
Designed to play nicely with Nerves, especially Nerves.UART.
Installation
If using Hex, the package can be installed
by adding serial_framing_protocol
to your list of dependencies in mix.exs
:
def deps do
[{:serial_framing_protocol, "~> 1.1.0"}]
end
If using rebar3, the package can be installed by adding http_signature
to you list of dependencies in rebar.config
:
{deps, [
{serial_framing_protocol, "1.1.0"}
]}.
The HexDocs can be found at https://hexdocs.pm/serial_framing_protocol.
Usage
See test/support/process_socket.ex
or the docs for examples.
Real world examples are available as part of inthezone_nerves for the VEX Robotics Competition:
-
Vex.Robot.NervesSocket
— handles raw serial data from UART port. -
Vex.Robot.UdpSocket
— handles UDP packets forwarded from Raspberry Pi 3. -
Vex.Local.Server.Socket
— interfaces with VEX Cortex-M3 over UART or UDP connection.