Skip to main content

version

Function version 

Source
pub fn version(answer: &[u8]) -> Option<&str>
Expand description

Reads the version string out of what the radio answered.

§Arguments

  • answer - the bytes the read moved, starting with the address that went out.

§Returns

The string, or None when the answer is too short or is not text.

§Examples

use pamoja_radios::sx1302::sx1261::version;

let mut answer = [0u8; 18];
answer[3..].copy_from_slice(b"sx1261_v1.12D06");
assert_eq!(version(&answer), Some("sx1261_v1.12D06"));