MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / validate

Method validate

chirpstack/src/storage/device_profile.rs:113–123  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

111
112impl DeviceProfile {
113 fn validate(&self) -> Result<(), Error> {
114 if self.name.is_empty() {
115 return Err(Error::Validation("name is not set".into()));
116 }
117
118 if self.rx1_delay < 0 || self.rx1_delay > 15 {
119 return Err(Error::Validation("RX1 Delay must be between 0 - 15".into()));
120 }
121
122 Ok(())
123 }
124}
125
126impl Default for DeviceProfile {

Callers 2

createFunction · 0.45
updateFunction · 0.45

Calls 1

intoMethod · 0.45

Tested by

no test coverage detected