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.

CC2541: How to remove few optional Characteristic Declarations from GAP services (0x1800)

Part Number: CC2541

Hello,

I am using CC2541 SimpleBLEPeripheral project. I have few queries on Attribute table and related issues.

1) To my understanding, Attribute table is created in the order where Services are added. In that case whether can I change the order

// Initialize GATT attributes
DevInfo_AddService();                                                       // Device Information Service (0x180A)
GGS_AddService( GATT_ALL_SERVICES );                   // GAP (0x1800)
GATTServApp_AddService( GATT_ALL_SERVICES );  // GATT attributes (0x1801)
SimpleProfile_AddService( GATT_ALL_SERVICES );      // Simple GATT Profile

2) Is it mandatory to have GAP (0x1800) and GATT (0x1801) services. The "service_changed" characteristics is Optional in GATT service. Then in that case whether can I comment GATT service

//GATTServApp_AddService( GATT_ALL_SERVICES );  // GATT attributes (0x1801)

3) For "Device Information" service (0x180A) I removed optional Characteristic declarations, by deleting them from devInfoAttrTbl[]. The same I want to do in case of GAP (0x1800) service. Since it is part of library, how to remove optional Characteristics. Other than "Device Name" I want to remove other Characteristic Declarations. Is there any mask variable or any other ways to do.

Thanks & Regards

Vishnu Beema

  • Hi Vishnu,
    1. Correct, the handles are enumerated based on when they are added. I would not recommend to change the order of the first three as they are mandatory by core specification and might have an impact with regards to interoperability. Why would you want to change order of these?
    2. I'm not sure if this breaks compatibility or not, you will have to test.

    Assigning an expert to comment on the third question.
  • Hello,

    Any inputs on this issue. As part of Generic Access (0x1800) I want only "Device Name" Characteristic declaration. Remaining I want to remove.

    Any macro to mask unwanted Declarations.

    Thanks & Regards

    Vishnu Beema

  • Hello. The only control you have over exclusion of attributes in this service is that you can use the GATT_NO_SERVICE_CHANGED define to remove the service changed characteristic.
  • Hello Tim,

    Can you please give more details.

    As mentioned above, in GAP (0x1800) service, other than "Device Name" I want to remove other Characteristic Declarations. By defining GATT_NO_SERVICE_CHANGED how can I disable Characteristics other than "Device Name".

    If I comment below line, then entire GAP service will be disabled. But I don't want to do that.

    //GGS_AddService( GATT_ALL_SERVICES );                   // GAP (0x1800)

    Thanks & Regards

    Vishnu Beema

  • As I stated, you can not do this. The only characteristic that you can possibly remove is the service changed characteristic.

  • Thank you for your Confirmation