Compare commits
No commits in common. "610ee12ebc6cc7eea0e6cfeae737262abda06c03" and "106a2612bde889f3a651327f7fc929c0cd8e4362" have entirely different histories.
610ee12ebc
...
106a2612bd
11
README.md
11
README.md
|
@ -25,17 +25,10 @@ fn main() {
|
|||
let mut txvr = Rn2903::new_at("/dev/ttyUSB0")
|
||||
.expect("Could not open device. Error");
|
||||
loop {
|
||||
txvr.transact(b"sys set pindig GPIO10 0").unwrap();
|
||||
txvr.transact(b"radio set pindig GPIO10 0").unwrap();
|
||||
thread::sleep(Duration::from_millis(1000));
|
||||
txvr.transact(b"sys set pindig GPIO10 1").unwrap();
|
||||
txvr.transact(b"radio set pindig GPIO10 1").unwrap();
|
||||
thread::sleep(Duration::from_millis(1000));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Module Documentation
|
||||
|
||||
This repository reproduces the relevant documents for the RN2903 module at
|
||||
[command_reference-40001811B.pdf](docu/command_reference-40001811B.pdf) and
|
||||
[datasheet-DS5000239H.pdf](docu/datasheet-DS5000239H.pdf).
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -224,6 +224,7 @@ impl Rn2903 {
|
|||
///
|
||||
/// Using [`::transact()`](#method.transact) is preferred.
|
||||
pub fn send_line(&mut self, line: &[u8]) -> Result<()> {
|
||||
use std::io::IoSlice;
|
||||
let bytes: Vec<u8> = line.iter().chain(b"\x0D\x0A".iter()).cloned().collect();
|
||||
let mut cursor = 0;
|
||||
while cursor < bytes.len() {
|
||||
|
|
Loading…
Reference in New Issue