electricui-embedded

Crates.ioelectricui-embedded
lib.rselectricui-embedded
version0.1.5
sourcesrc
created_at2022-03-18 12:31:02.337752
updated_at2022-03-31 11:11:41.573765
descriptionAn unofficial and incomplete `no_std` Rust library for implementing the ElectricUI Binary Protocol
homepage
repositoryhttps://github.com/jonlamb-gh/electricui-embedded-rs
max_upload_size
id552656
size215,490
Jon (jonlamb-gh)

documentation

https://docs.rs/electricui-embedded

README

electricui-embedded   ci crates.io docs.rs

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.

Example

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.

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):
  led_blink
  led_state
  lit_time
  name
Got AM_END, 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(led_blink), 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(led_state), 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

Protocol Diagram

protocol

License

Licensed under either of

at your option.

Commit count: 13

cargo fmt