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

Method validate

chirpstack/src/storage/device_queue.rs:29–43  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

27
28impl DeviceQueueItem {
29 fn validate(&self) -> Result<(), Error> {
30 if self.f_port == 0 || self.f_port > 255 {
31 return Err(Error::Validation(
32 "FPort must be between 1 - 255".to_string(),
33 ));
34 }
35
36 if self.is_encrypted && self.f_cnt_down.is_none() {
37 return Err(Error::Validation(
38 "FCntDown must be set for encrypted queue-items".to_string(),
39 ));
40 }
41
42 Ok(())
43 }
44}
45
46impl Default for DeviceQueueItem {

Callers 1

enqueue_itemFunction · 0.45

Calls 1

to_stringMethod · 0.80

Tested by

no test coverage detected