3 ms·
For sure, serial data is a factor. I need to dig into the support of GPIO and other serial interfaces (e.g. USB) - but that's a great point. The image distro
by kitplummer 7y ago
For sure, serial data is a factor. I need to dig into the support of GPIO and other serial interfaces (e.g. USB) - but that's a great point. The image distro model is really cool, and need to evaluate that further as well.
- elcritch 7y agoDrop by the Nerves channel on the Elixir-Lang Slack. It’s pretty active and people are pretty helpful. PS: I enjoy writing streaming code in Elixir (vs more procedural or OO methods). This is a snippet I use to decode a SLIP encoded binary UART stream with an CRC check: Stream.repeatedly(fn -> receive_data_packet(timeout) end) |> Stream.transform(<<@frame_end, @frame_end>>, &frame_splitter(&1, &2, {separator, max_buffer})) |> Stream.map(&decode_slip(&1)) |> Stream.map(&frame_header(&1)) |> Stream.reject(&( &1[:code] == -1)) |> Stream.each(fn x -> if !x[:crc_check] do Logger.error("parser crc error: #{inspect x}") end end) |> Stream.reject(&( &1[:crc_check] == false)) ...