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

Method emit

src/common/adapter_manager.rs:46–54  ·  view source on GitHub ↗
(&self, event: CentralEvent)

Source from the content-addressed store, hash-verified

44 PeripheralType: Peripheral + 'static,
45{
46 pub fn emit(&self, event: CentralEvent) {
47 if let CentralEvent::DeviceDisconnected(ref id) = event {
48 self.peripherals.remove(id);
49 }
50
51 if let Err(lost) = self.events_channel.send(event) {
52 trace!("Lost central event, while nothing subscribed: {:?}", lost);
53 }
54 }
55
56 pub fn event_stream(&self) -> Pin<Box<dyn Stream<Item = CentralEvent> + Send>> {
57 let receiver = self.events_channel.subscribe();

Callers 8

newMethod · 0.80
start_scanMethod · 0.80
emit_eventMethod · 0.80
connectMethod · 0.80
newMethod · 0.80
emit_eventMethod · 0.80
report_propertiesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected