Skip to content

Commit

Permalink
Replace internal declarations with those from objc2-core-bluetooth
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm authored and qdot committed Jun 1, 2024
1 parent d5a3e33 commit d6d54d4
Show file tree
Hide file tree
Showing 9 changed files with 351 additions and 679 deletions.
11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,17 @@ objc2-foundation = { version = "0.2.2", features = [
"NSValue",
] }
objc2-core-bluetooth = { version = "0.2.2", features = [
"CBPeripheral",
"CBAdvertisementData",
"CBAttribute",
"CBCentralManager",
"CBCentralManagerConstants",
"CBCharacteristic",
"CBDescriptor",
"CBManager",
"CBPeer",
"CBPeripheral",
"CBService",
"CBUUID",
] }

[target.'cfg(target_os = "windows")'.dependencies]
Expand Down
393 changes: 187 additions & 206 deletions src/corebluetooth/central_delegate.rs

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions src/corebluetooth/ffi.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#![allow(non_camel_case_types)]
use std::os::raw::{c_char, c_void};

pub type dispatch_object_s = c_void;
pub type dispatch_queue_t = *mut dispatch_object_s;
pub type dispatch_queue_attr_t = *const dispatch_object_s;

pub const DISPATCH_QUEUE_SERIAL: dispatch_queue_attr_t = 0 as dispatch_queue_attr_t;

extern "C" {
pub fn dispatch_queue_create(
label: *const c_char,
attr: dispatch_queue_attr_t,
) -> dispatch_queue_t;
}

// TODO: Do we need to link to AppKit here?
#[cfg_attr(target_os = "macos", link(name = "AppKit", kind = "framework"))]
extern "C" {}
318 changes: 0 additions & 318 deletions src/corebluetooth/framework.rs

This file was deleted.

Loading

0 comments on commit d6d54d4

Please sign in to comment.