Skip to content

Commit d6d54d4

Browse files
madsmtmqdot
authored andcommitted
Replace internal declarations with those from objc2-core-bluetooth
1 parent d5a3e33 commit d6d54d4

File tree

9 files changed

+351
-679
lines changed

9 files changed

+351
-679
lines changed

Cargo.toml

+10-1
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,17 @@ objc2-foundation = { version = "0.2.2", features = [
6060
"NSValue",
6161
] }
6262
objc2-core-bluetooth = { version = "0.2.2", features = [
63-
"CBPeripheral",
63+
"CBAdvertisementData",
64+
"CBAttribute",
6465
"CBCentralManager",
66+
"CBCentralManagerConstants",
67+
"CBCharacteristic",
68+
"CBDescriptor",
69+
"CBManager",
70+
"CBPeer",
71+
"CBPeripheral",
72+
"CBService",
73+
"CBUUID",
6574
] }
6675

6776
[target.'cfg(target_os = "windows")'.dependencies]

src/corebluetooth/central_delegate.rs

+187-206
Large diffs are not rendered by default.

src/corebluetooth/ffi.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![allow(non_camel_case_types)]
2+
use std::os::raw::{c_char, c_void};
3+
4+
pub type dispatch_object_s = c_void;
5+
pub type dispatch_queue_t = *mut dispatch_object_s;
6+
pub type dispatch_queue_attr_t = *const dispatch_object_s;
7+
8+
pub const DISPATCH_QUEUE_SERIAL: dispatch_queue_attr_t = 0 as dispatch_queue_attr_t;
9+
10+
extern "C" {
11+
pub fn dispatch_queue_create(
12+
label: *const c_char,
13+
attr: dispatch_queue_attr_t,
14+
) -> dispatch_queue_t;
15+
}
16+
17+
// TODO: Do we need to link to AppKit here?
18+
#[cfg_attr(target_os = "macos", link(name = "AppKit", kind = "framework"))]
19+
extern "C" {}

src/corebluetooth/framework.rs

-318
This file was deleted.

0 commit comments

Comments
 (0)