(dev_eui: &EUI64)
| 9 | use lrwn::EUI64; |
| 10 | |
| 11 | pub async fn get(dev_eui: &EUI64) -> Result<internal::DeviceSession, Error> { |
| 12 | let key = redis_key(format!("device:{{{}}}:ds", dev_eui)); |
| 13 | |
| 14 | let v: Vec<u8> = redis::cmd("GET") |
| 15 | .arg(key) |
| 16 | .query_async(&mut get_async_redis_conn().await?) |
| 17 | .await |
| 18 | .context("Get device-session")?; |
| 19 | if v.is_empty() { |
| 20 | return Err(Error::NotFound(dev_eui.to_string())); |
| 21 | } |
| 22 | let ds = |
| 23 | internal::DeviceSession::decode(&mut Cursor::new(v)).context("Decode device-session")?; |
| 24 | Ok(ds) |
| 25 | } |
nothing calls this directly
no test coverage detected