Search code examples
bluetooth-lowenergycore-bluetoothuuidios-bluetooth

Bluetooth Low Energy Characteristic Value from Byte


Background:

I am following this tutorial from raywenderlich about connecting a bluetooth low energy shield to my project. I am using the Adafruit BLE friend.

Question:

I cannot figure out how to specify the UUID for the BLE friend. Here is a picture of Adafruits information about the characteristics:

Adafruit's documentation on the characteristics

Here is the link to the page on Adafruits page

How can I format the characteristic UUID so it is in this style: F38A2C23-BC54-40FC-BED0-60EDDA139F47

Thanks for any help,

Joel


Solution

  • I believe that the CBUUID constants can be created for the Service and Characteristic as follows.

    let kServiceUART = CBUUID(string: "6E400001-B5A3-F393-­E0A9-­E50E24DCCA9E") // UART Service
    let kCharTX      = CBUUID(string: "6E400002-B5A3-F393-­E0A9-­E50E24DCCA9E") // TX Characteristic (Property = Notify)
    let kCharRX      = CBUUID(string: "6E400003-B5A3-F393-­E0A9-­E50E24DCCA9E") // RX Characteristic (Property = Write without response)
    

    I don't have a BLE Friend available to verify with.