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.

characteristic in SimpleBLEPeripheral

Hi,

I am using sample program 'SimpleBLEPeripheral'.

I already have an iOS app to control my BLE113. I connected an LED to P1_2.

And, I wanted it to turn on when I send 1 from my IPhone. But in order to do that I need to know the UUID of my characteristic.

How can I find that?

I made changes in simpleBLEPeripheral_ProcessOSALMsg( osal_event_hdr_t *pMsg )

Where can I find the UUID of this characteristic?

Regards,

Swarika Jain

  • Hi Swarika,

    You can find the UUIDs in simpleGATTprofile.h:

    // Simple Profile Service UUID
    #define SIMPLEPROFILE_SERV_UUID               0xFFF0
       
    // Key Pressed UUID
    #define SIMPLEPROFILE_CHAR1_UUID            0xFFF1
    #define SIMPLEPROFILE_CHAR2_UUID            0xFFF2
    #define SIMPLEPROFILE_CHAR3_UUID            0xFFF3
    #define SIMPLEPROFILE_CHAR4_UUID            0xFFF4
    #define SIMPLEPROFILE_CHAR5_UUID            0xFFF5

    Let me know you have further questions.

    Regards,
    Zahid

  • Hi Zahid,

    I am sending data through characteristic 2 from my iOS..but I don't understand how to read it in my program.

    Please tell me which function reads the data received from iOS and how to process that data.

    Thank you.

    Regards,

    Swarika Jain

  • Hi Swarika,

    You can read using readValueForCharacteristic function to initiate reading.

    Then you will get the updated value in didUpdateValueForCharacteristic function.

     

    Regards,
    Zahid

  • Hi Zahid,

    In which file is this function defined and called?

    Thanks!

    Regards,

    Swarika Jain

  • Hi Zahid,

    I couldn't explain myself well.

    I want to ask -

    1. Which function is used to read a value in SimpleBLEPeripheral program in IAR workbench? I am sending 0x01 through app and code i am using is :

    uint8_t i = 0x01;
    NSData *data = [NSData dataWithBytes: &i length:1];
    [discoveredPeripheral writeValue:data forCharacteristic:CHARAC type:CBCharacteristicWriteWithResponse];

    Is the above code fine?

    In which function should i check in IAR workbench and which kind of data will i get,do i have to do any type of typecasting in IAR workbench code?

    2. Similarly, which function is used to send value from SimpleBLEPeripheral to my app?

    Can you share the code snippets of the above functionality?

    Thanks for cooperating.

    Regards,

    Swarika Jain