Using UUIDs and Bluetooth


            

I did some more steps towards accessing Kenwood TH-D74’s services via bluetooth. I struggled for some time understanding how discovery based on UUIDs work. I was not aware that, for each service profile, there is a standard Universally Unique Identifier (UUID) documented in Bluetooth SIG specs. Specifically for Serial Port Profile (SPP) service, the UUID is 0x1101. More information here. So my code is now:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    ...
    thuuid = @[@"0x1108"]; // SPP
    ...
}

And

- (void)startScan {
    [manager scanForPeripheralsWithServices:thuuid options:nil];
}

And

- (void)centralManagerDidUpdateState:(nonnull CBCentralManager *)central {
    switch (central.state) {
        ...
        case CBManagerStatePoweredOn:
            _textField.stringValue = @"Central state is powered on\n";
            [self startScan];
            break;
    }
}

Building and run, gives me this:

Bingo ! More to come.

TH-D74 BLE or “Bluetooth Low Energy”

Struggling to understand how Universal Unique IDs work (see here) I was wrongly assuming that Core Bluetooth is a framework from Apple that covers all aspects of communication with devices via BT. I was WRONG ! scanForPeripheralsWithServices method and, in general, what I tried to do, for almost a week, is NOT good for my intended […]

Why unsupported central manager state ?

Several days ago I received a Kenwood TH D74 portable transceiver. Although I have a Yaesu FT60 and some other smaller and unimportant transceivers, I don’t have any transceiver that is APRS capable. What’s more important, this transceiver is BT and USB capable, providing serial communication, which opens some interesting opportunities. Today I opened XCode […]

Leave a Reply

Your email address will not be published. Required fields are marked *