MCPcopy Create free account
hub / github.com/deviceplug/btleplug / read_rssi

Method read_rssi

src/droidplug/peripheral.rs:442–453  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

440 }
441
442 async fn read_rssi(&self) -> Result<i16> {
443 let future = self.with_obj(|env, obj| {
444 JSendFuture::try_from(JFuture::from_env(env, obj.read_remote_rssi()?)?)
445 })?;
446 let result_ref = future.await?;
447 self.with_obj(|env, _obj| {
448 let result = JPollResult::from_env(env, result_ref.as_obj())?;
449 let rssi_obj = get_poll_result(env, result)?;
450 let rssi_val = env.call_method(rssi_obj, "intValue", "()I", &[])?.i()?;
451 Ok(rssi_val as i16)
452 })
453 }
454
455 async fn write_descriptor(&self, descriptor: &Descriptor, data: &[u8]) -> Result<()> {
456 let future = self.with_obj(|env, obj| {

Callers

nothing calls this directly

Calls 3

get_poll_resultFunction · 0.85
with_objMethod · 0.80
read_remote_rssiMethod · 0.80

Tested by

no test coverage detected