Add factory reset functionality
This commit is contained in:
parent
6318251226
commit
12cce7213b
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- `Rn2903::system_version_bytes()`
|
- `Rn2903::system_version_bytes()`
|
||||||
|
- `Rn2903::system_factory_reset()`
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
|
@ -293,4 +293,12 @@ impl Rn2903 {
|
||||||
pub fn system_version_bytes(&mut self) -> Result<Vec<u8>> {
|
pub fn system_version_bytes(&mut self) -> Result<Vec<u8>> {
|
||||||
self.transact(b"sys get ver")
|
self.transact(b"sys get ver")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Performs a factory reset on the connected module. All EEPROM values are
|
||||||
|
/// restored to factory defaults. All LoRaWAN settings set by the user are lost.
|
||||||
|
/// Returns the system version, like `::system_version_bytes()`.
|
||||||
|
pub fn system_factory_reset(&mut self) -> Result<String> {
|
||||||
|
let bytes = self.transact(b"sys factoryRESET")?;
|
||||||
|
Ok(bytes_to_string(&bytes))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue