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

Method from_env_impl

src/droidplug/jni/objects.rs:57–145  ·  view source on GitHub ↗
(env: &'b JNIEnv<'a>, obj: JObject<'a>)

Source from the content-addressed store, hash-verified

55 }
56
57 fn from_env_impl(env: &'b JNIEnv<'a>, obj: JObject<'a>) -> Result<Self> {
58 //let class = env.auto_local(class);
59 let class_static = crate::droidplug::jni_utils::classcache::get_class(
60 "com/nonpolynomial/btleplug/android/impl/Peripheral",
61 )
62 .unwrap();
63 let class = JClass::from(class_static.as_obj());
64
65 let connect = env.get_method_id(
66 class,
67 "connect",
68 "()Lio/github/gedgygedgy/rust/future/Future;",
69 )?;
70 let disconnect = env.get_method_id(
71 class,
72 "disconnect",
73 "()Lio/github/gedgygedgy/rust/future/Future;",
74 )?;
75 let is_connected = env.get_method_id(class, "isConnected", "()Z")?;
76 let discover_services = env.get_method_id(
77 class,
78 "discoverServices",
79 "()Lio/github/gedgygedgy/rust/future/Future;",
80 )?;
81 let read = env.get_method_id(
82 class,
83 "read",
84 "(Ljava/util/UUID;)Lio/github/gedgygedgy/rust/future/Future;",
85 )?;
86 let write = env.get_method_id(
87 class,
88 "write",
89 "(Ljava/util/UUID;[BI)Lio/github/gedgygedgy/rust/future/Future;",
90 )?;
91 let set_characteristic_notification = env.get_method_id(
92 class,
93 "setCharacteristicNotification",
94 "(Ljava/util/UUID;Z)Lio/github/gedgygedgy/rust/future/Future;",
95 )?;
96 let get_notifications = env.get_method_id(
97 class,
98 "getNotifications",
99 "()Lio/github/gedgygedgy/rust/stream/Stream;",
100 )?;
101 let read_descriptor = env.get_method_id(
102 class,
103 "readDescriptor",
104 "(Ljava/util/UUID;Ljava/util/UUID;)Lio/github/gedgygedgy/rust/future/Future;",
105 )?;
106 let write_descriptor = env.get_method_id(
107 class,
108 "writeDescriptor",
109 "(Ljava/util/UUID;Ljava/util/UUID;[B)Lio/github/gedgygedgy/rust/future/Future;",
110 )?;
111 let get_device_name = env.get_method_id(class, "getDeviceName", "()Ljava/lang/String;")?;
112 let request_mtu = env.get_method_id(
113 class,
114 "requestMtu",

Callers

nothing calls this directly

Calls 1

get_classFunction · 0.85

Tested by

no test coverage detected