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.

Try to modify simpleGATTprofile, adding notify parameter

Hi, I'm trying to use simpleGATTProfile but I don't know if I can change the number of the caratteristic or the type.

For example, I need 3 parameter Read/Write and other 3 parameter as notify.

Also if I change the congig byte and I call setparameter, the notif doesn't start.

I don't qrite english very well but i hope to be clear.

Thanks

  • Hi,

    You need to edit the Attribute Table in simpleGATTProfile. 

    For the characteristics which you need  'READ/WRITE' permit, change the Characteristic permission type as show below,

    // Characteristic Value 1
    {
    { ATT_BT_UUID_SIZE, simpleProfilechar1UUID },
    GATT_PERMIT_READ | GATT_PERMIT_WRITE,
    0,
    &simpleProfileChar1
    },

    Also for enabling notification, please edit the client characteristic configuration of the attribute  to

    static uint8 simpleProfileChar1Props = GATT_PROP_NOTIFY;

    Regards,

    Arun

  • Hi, thank you to be so fast.

    I just did your suggestion but it doesn't work.

    Using BTool I change the config parameter and then, even if  I call setparameter, the notify doesn't start.

    I'm using UUID 0xFFF0 until 0xFFF6

    Can you confirm that I can change the quantity and the kind of every parameter?

    Thank

    remo

  • Hi Remo,

    You will need to modify the _ReadAttrCB and _WriteAttrCB functions to your needs as well.

    Best Regards

    Joakim

  • Can you post what you are doing in SetParameter? 

    After you have enabled notification through Btool by changing the value of Client Characteristic configuration, then please change the value of the simpleProfileChar1 and call SetParam for SIMPLEPROFILE_CHAR1.

    The corresponding code in setParam should look like this,

    case SIMPLEPROFILE_CHAR1:
    if ( len == sizeof ( uint8 ) )
    {
    simpleProfileChar1 = *((uint8*)value);

    // See if Notification has been enabled
    GATTServApp_ProcessCharCfg( simpleProfileChar1Config, &simpleProfileChar1, FALSE,
    simpleProfileAttrTbl, GATT_NUM_ATTRS( simpleProfileAttrTbl ),
    INVALID_TASK_ID );
    }
    else
    {
    ret = bleInvalidRange;
    }
    break;

    You can debug to check if the simpleProfileChar1Config.value is changed after editing from Btool.

    Regards,
    Arun

  • YYYYYEEEEESSSSSSSSSS,

    I haven't modified the ReadAttrCBt but know it works !!!!!

    I didn't know it was to modify.

    thank you from Italy.

    by

    remo