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

Function set_dev_nonces

chirpstack/src/storage/device_keys.rs:92–106  ·  view source on GitHub ↗
(
    dev_eui: EUI64,
    nonces: &fields::DevNonces,
)

Source from the content-addressed store, hash-verified

90}
91
92pub async fn set_dev_nonces(
93 dev_eui: EUI64,
94 nonces: &fields::DevNonces,
95) -> Result<DeviceKeys, Error> {
96 let dk: DeviceKeys = diesel::update(device_keys::dsl::device_keys.find(dev_eui))
97 .set(device_keys::dev_nonces.eq(nonces))
98 .get_result(&mut get_async_db_conn().await?)
99 .await
100 .map_err(|e| Error::from_diesel(e, dev_eui.to_string()))?;
101 info!(
102 dev_eui = %dev_eui,
103 "Dev-nonces updated"
104 );
105 Ok(dk)
106}
107
108pub async fn validate_incr_join_and_store_dev_nonce(
109 join_eui: EUI64,

Callers 2

flush_dev_noncesMethod · 0.85
test_deviceFunction · 0.85

Calls 4

setMethod · 0.80
to_stringMethod · 0.80
updateFunction · 0.70
get_async_db_connFunction · 0.70

Tested by 1

test_deviceFunction · 0.68