Skip to content

Commit

Permalink
Fixed FFI bug
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-baumann committed Oct 13, 2024
1 parent 7d3c2c8 commit eaa0116
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/data_rct/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ impl Discovery {

pub fn start(&self) {
DISCOVERED_DEVICES.get().unwrap().write().unwrap().clear();
println!("Clear called");

if let Some(ble_discovery_implementation) = &self.ble_discovery_implementation {
ble_discovery_implementation.start_scanning();
Expand Down
8 changes: 2 additions & 6 deletions src/data_rct_ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,11 @@ impl InternalDiscovery {
}

pub fn start(&self) {
if let Some(ble_discovery_implementation) = &self.handler.read().expect("Failed to lock handler").ble_discovery_implementation {
ble_discovery_implementation.start_scanning();
}
self.handler.read().expect("Failed to lock handler").start();
}

pub fn stop(&self) {
if let Some(ble_discovery_implementation) = &self.handler.read().expect("Failed to lock handler").ble_discovery_implementation {
ble_discovery_implementation.stop_scanning();
}
self.handler.read().expect("Failed to lock handler").stop();
}

pub fn parse_discovery_message(&self, data: Vec<u8>, ble_uuid: Option<String>) {
Expand Down

0 comments on commit eaa0116

Please sign in to comment.