Crates.io | seeed-erpc |
lib.rs | seeed-erpc |
version | 0.1.1 |
source | src |
created_at | 2020-12-02 04:55:38.951866 |
updated_at | 2020-12-31 07:04:39.597893 |
description | Driver crate for interacting with seeed-studio eRPC Wifi devices. |
homepage | |
repository | https://github.com/twitchyliquid64/seeed-erpc-rs |
max_upload_size | |
id | 318804 |
size | 37,467 |
An embedded / no-std implementation of Seeed Studio's eRPC protocol, which is used to communicate with their RTL8720 firmware.
Most notably, this is the main firmware for the wifi chip in their Wio Terminal product.
WIP - most RPCs are not yet implemented.
Have a look at the Wio terminal BSP implementation for an example of how to use this.
To summarize:
RPC::header(sequence_number)
with the bytes extended from RPC::args(&mut buff)
.FrameHeader::new_from_msg(request_bytes)
followed by request_bytes
itself.FrameHeader::parse()
.frame_header.msg_length
bytes.frame_header.check_crc(&payload_bytes)
.RPC::parse(&payload_bytes)
.Sometimes the remote end will send you data even if you didn't ask for it. These are the 'callback' service 'oneway' RPCs.
Handling these is a little annoying. The trick is to repeat steps 3-6 above if you get the error Err::NotOurs
back from RPC::parse()
.