Skip to main content

patched

Function patched 

Source
pub fn patched(answer: &[u8]) -> bool
Expand description

Whether the radio is running the patch this crate writes.

§Arguments

  • answer - the bytes a version read moved.

§Returns

Whether the string ends in PRAM_VERSION. Only the last four characters are compared, because the rest of the string names a build rather than the patch.

§Examples

use pamoja_radios::sx1302::sx1261::patched;

let mut answer = [0u8; 18];
answer[3..].copy_from_slice(b"sx1261_v1.12D06");
assert!(patched(&answer));

answer[3..].copy_from_slice(b"sx1261_v1.10000");
assert!(!patched(&answer), "a radio still running what it came with");