(dev_addr: DevAddr)
| 179 | } |
| 180 | |
| 181 | pub fn is_roaming_dev_addr(dev_addr: DevAddr) -> bool { |
| 182 | let conf = config::get(); |
| 183 | |
| 184 | if !is_enabled() { |
| 185 | return false; |
| 186 | } |
| 187 | |
| 188 | for net_id in &[ |
| 189 | // Configured NetID. |
| 190 | conf.network.net_id, |
| 191 | // Test NetIDs. For roaming it is expected that non-testing NetIDs will be used. These are |
| 192 | // included as non-roaming NetIDs as one might start with a test-NetID and then acquires an |
| 193 | // official NetID to setup roaming. Not including these would mean that all devices must |
| 194 | // re-join to obtain a new DevAddr. |
| 195 | NetID::from_be_bytes([0, 0, 0]), |
| 196 | NetID::from_be_bytes([0, 0, 1]), |
| 197 | ] { |
| 198 | if dev_addr.is_net_id(*net_id) { |
| 199 | return false; |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | for net_id in &conf.network.secondary_net_ids { |
| 204 | if dev_addr.is_net_id(*net_id) { |
| 205 | return false; |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | true |
| 210 | } |
| 211 | |
| 212 | pub fn get_net_ids_for_dev_addr(dev_addr: DevAddr) -> Vec<NetID> { |
| 213 | let mut out: Vec<NetID> = Vec::new(); |
no test coverage detected