An unofficial and incomplete no_std
Rust library for
implementing the ElectricUI Binary Protocol.
See the ElectricUI docs or the ElectricUI C library for more information.
See electricui-embedded-stm32f4-example for the target portion.
Note: this example is pretty low level and shouldn't be replicated, see the electricui-cli crate for other patterns and examples.
```text cargo run --example host -- /dev/ttyUSB0
Requesting board ID
{ DataLen(0), Type(8), Int(1), Offset(0), IdLen(1), Resp(1), Acknum(0) } << { DataLen(2), Type(8), Int(1), Offset(0), IdLen(1), Resp(0), Acknum(0) } Board ID: [EF, BE] Requesting name { DataLen(0), Type(0), Int(0), Offset(0), IdLen(4), Resp(1), Acknum(0) } << { DataLen(8), Type(4), Int(0), Offset(0), IdLen(4), Resp(0), Acknum(0) } Name: 'my-board' Requesting writable IDs announcement { DataLen(0), Type(0), Int(1), Offset(0), IdLen(1), Resp(1), Acknum(0) } << { DataLen(34), Type(1), Int(1), Offset(0), IdLen(1), Resp(0), Acknum(0) } << { DataLen(1), Type(6), Int(1), Offset(0), IdLen(1), Resp(0), Acknum(0) } Message IDs (4): ledblink ledstate littime name Got AMEND, count = 4 Requesting tracked variables { DataLen(0), Type(0), Int(1), Offset(0), IdLen(1), Resp(1), Acknum(0) } << { DataLen(1), Type(6), Int(0), Offset(0), IdLen(9), Resp(0), Acknum(0) } Got tracked var Id(ledblink), Type(U8), Data([01]) << { DataLen(1), Type(6), Int(0), Offset(0), IdLen(9), Resp(0), Acknum(0) } << { DataLen(2), Type(8), Int(0), Offset(0), IdLen(8), Resp(0), Acknum(0) } Got tracked var Id(ledstate), Type(U8), Data([01]) Got tracked var Id(lit_time), Type(U16), Data([46, 00]) << { DataLen(8), Type(4), Int(0), Offset(0), IdLen(4), Resp(0), Acknum(0) } Got tracked var Id(name), Type(Char), Data([6D, 79, 2D, 62, 6F, 61, 72, 64]) Requesting heartbeat val=3 { DataLen(1), Type(6), Int(1), Offset(0), IdLen(1), Resp(1), Acknum(0) } << { DataLen(1), Type(6), Int(1), Offset(0), IdLen(1), Resp(0), Acknum(0) } Got heartbeat val=3 ```
Licensed under either of
at your option.