Skip to content

Callback delegates and run loops. #22

@loftafi

Description

@loftafi

I was looking for the best way to integrate the macOS bluetooth API with Zig and stumbled across your project here. It looks great, thanks for sharing it.

To use the Bluetooth API you need to start a CFRunLoop and register for callbacks such as:

peripheralManager = [[CBPeripheralManager alloc] initWithDelegate:de queue:nil];
centralManager = [[CBCentralManager alloc] initWithDelegate:de queue:nil];
CFRunLoopRun();
- (void)centralManagerDidUpdateState:(CBCentralManager *)central {
   //
}
- (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error {
    //
}

I don't see any examples/tests in your source that indicate if this might or might not be possible, I am guessing it is not. But I thought I would ask here just in case it might be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions