This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Where to start?

I have been using the SPPLEDemo_Lite on my MSP430 experimenter board with the CC256X board attached.

I have developed an iOS application that can connect to my device while it is running the SPPLEDemo_Lite project. My iOS application has a single button on it. I simply want to turn on an LED on my board when the button is pressed.

Using the Bluetopia API, how does the SPPLEDemo_Lite actually handle events that come in? I have been banging my head trying to trace it back to a place where it handles characteristic changes. You see, in LightBlue (a freely available iOS application currently on the App Store), I can subscribe to, read and write from characteristics of a service that is hosted on the Bluetopia stack in my board, but how does it work, exactly? Where does it detect changes?

It brings about so many questions in my mind, like...what is the best profile to use for my application? Has anyone come up with a tutorial video or something describing how this API works and what the best ways to handle specific designs are? Where do I start...?!

  • Guys? Anyone? I would really appreciate some guidance with this stuff so that I can create a working prototype!

  • have you had a look at:

    Gatt_ServerEventCallback()

    All the characteristic changes occur in there, for example an etGatt_Server_Write_Event will go off with the data as a parameter. Basically all the events are callbacks that are subscribed to when either the LE or BR/EDR server is started.

  • Thanks, Barak! This has helped me greatly; I will continue to do some digging into this method. It was tough because the method deadlocks if you try to set breakpoints (a note in the comment of the method explains this) so you literally have to debug it by printing stuff to the terminal...which, well, it took me a little while to figure out how to launch that terminal within CCS. I'm new to everything here.

    I have some questions for you or anyone else in the community, though (any insight is greatly appreciated even if someone can't answer all the questions or can only answer one of them, etc, I'd like to know your opinion(s) please):

    - Is straight read/write/notify of characteristics the correct way to interface between my iOS device and my experimenter board or is there supposed to be some more standard way to do this communication?

    - How are characteristics defined in the SPP LE Lite Demo? I know I can access them using LightBlue and modify them, but how are they defined and where?

    - Do you always have to use a Bluetooth profile in a Bluetooth device? For instance, is GATT the layer below SPP? I'm still a little iffy on this.

  • Please can anyone shed some more light for me?

  • NVM, I got it now...the service registers with GATT_Register_Service which passes in an array of service attributes:

    BTPSCONST GATT_Service_Attribute_Entry_t SPPLE_Service[] =
    {
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetPrimaryService128, (Byte_t *)&SPPLE_Service_UUID}, //0
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicDeclaration128, (Byte_t *)&SPPLE_Tx_Declaration}, //1
    {0, aetCharacteristicValue128, (Byte_t *)&SPPLE_Tx_Value}, //2
    {GATT_ATTRIBUTE_FLAGS_READABLE_WRITABLE, aetCharacteristicDescriptor16, (Byte_t *)&Client_Characteristic_Configuration}, //3
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicDeclaration128, (Byte_t *)&SPPLE_Tx_Credits_Declaration}, //4
    {GATT_ATTRIBUTE_FLAGS_READABLE_WRITABLE, aetCharacteristicValue128, (Byte_t *)&SPPLE_Tx_Credits_Value}, //5
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicDeclaration128, (Byte_t *)&SPPLE_Rx_Declaration}, //6
    {GATT_ATTRIBUTE_FLAGS_WRITABLE, aetCharacteristicValue128, (Byte_t *)&SPPLE_Rx_Value}, //7
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicDeclaration128, (Byte_t *)&SPPLE_Rx_Credits_Declaration}, //8
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicValue128, (Byte_t *)&SPPLE_Rx_Credits_Value}, //9
    {GATT_ATTRIBUTE_FLAGS_READABLE_WRITABLE, aetCharacteristicDescriptor16, (Byte_t *)&Client_Characteristic_Configuration}, //10
    };

    Thanks, Barak!