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.

CC2640R2F: GATT services commands required for SDK 1.50.00.71

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2540,

Hi,

For SDK 1.50.00.71 Host test example.

Can you share flow of commands to add characteristics those used in simple peripheral example of same SDK ?

Regards,

Bhavin

 

  • Bhavin,

    Forgive me if I'm missing the exact question you are asking. To clarify, you are trying to add your own custom profile/services to host test correct?

    As noted this e2e post for a CC2540, we recommend that you take a look at the other Network Processor (NWP) options.

    http://processors.wiki.ti.com/index.php/CC254X_WITH_EXT_MCU

    It may be best to opt for the network processor custom solution, in order to avoid parsing and handling all ATT trafic on your host MCU. This would mean that you add your own custom service to host test, rebuild the example and follow the guidance given here: http://processors.wiki.ti.com/index.php/BLE_HostTest_Add_Cmds

    I should note that the link above is dated and written for CC254x but the concept still applies.

    It may also be helpful to review SimpleLink Academy to learn more about the CC2640R2 in general. 

  • Hi Evan,

    Yes exactly i want to add custom profile and services to host test.

    But i want to use SDK 1.50.00.71 and i want commands used for this SDK.... can you share an example to add one characteristic of write using 128 bit UUID and the commands for the same ( which is major req.)

    Regards,
    Bhavin
  • Bhavin,

    As stated in the previous post, to do a custom NWP profile with Host Test is quite complex and requires knowledge of BLE & the TI_BLE_Vendor_Specific_HCI_Guide.pdf which you can find in your SDK (simplelink_cc2640r2_sdk\docs\blestack\ble_user_guide).

    We do not have an exact example of what you are asking, but maybe you can take portions of the  "Custom Profile SimpleLink Academy" and adjust the host test example accordingly. 

    Aside from these resources, I do not know of any further resources that would be exactly what you're looking for. 

  • Part Number: CC2640R2F

    Hi,

    I am using host test of SDK 1.50.00.71.

    I used some commands to run peripheral example using HCI commands and its advertising using HCI tester tool on PC.

    Now i want  to make connection with generic app available in google store " BLE scanner ", so when i connect , it gets connected but what are the services device have its not displaying.  so is there any commands to show the characteristics and services or need some setting during sending of peripheral HCI commands ?

    Regards,

    Bhavin

  • Hi Bhavin,

    This seems related to your inquiry here:
    e2e.ti.com/.../671743
    So I am merging your threads.

    The BLE scanner application will not be able to discover any services on your device if you have not added them.
  • Hi Sean,

    By default any services or characteristics defined in host test ?

    If yes should it display ? Like default displays in simple peripheral example.

    Regards,
    Bhavin
  • Hi Sean,

    Adding to above query,
    I refered doc (LPRF_BLE_NetworkProcessorGATT.pdf)you hared for cc2540 example in which it has enabled GATT_DB_OFF_CHIP so in my case (SDK1.50.00.71 for CC2640R2F ) also required to enable ?

    When i enabling GATT_DB_OFF_CHIP and connecting with 1MBPS mode for both Primary and secondary PHY my mobile app not able to connect but when i remove GATT_DB_OFF_CHIP and connecting with 1MBPS mode for both Primary and secondary PHY my mobile app able to connect and shows two services (1) Generic Access (2) Generic attributes.

    Regards,
    Bhavin
  • Hi Bhavin,

    Don't use GATT DB OFFCHIP, this is much more complicated and requires you to respond to every single ATT request that ins coming over the wire.

    You are correct that when GATT_DB_OFFCHIP is not defined, the Generic Access Service and Generic attribute service will be included.

    I would recommend the following:

    1. Study the code to understand how these services are added and handled
    2. Add your own services using this same manner
    3. If you need to set/get the values of the characteristics in this service, you need to define your own serial commands to do so. Most of the guidance in the CC254x wiki page that you have found is relevant for this.
  • Hi Sean,

    Thank you for guidance...

    Actually currently i am able to discover characteristics using HCI commands but device of which i am discovering characteristics is programmed with simple peripheral example with SDK 1.50.00.58.

    Now my next task is to read characteristics of that device which is programmed by hosttest of SDK 1.50.00.71 and does advertise with HCI commands.

    I will follow steps you explained and will get back to you if i face any issue.

    Regards,
    Bhavin
  • Hi Sean,

    As you suggested to add services means it has to be add in host test code or need to add via commands ?

    When i give "Send_GATT_AddService 0x2800, 3, 16" command it gives Failure response but when i add GATT_DB_OFF_CHIP its response comes success.

    Regards,
    Bhavin
  • Hi Bhavin,

    Please add the services to host test directly, in the same manner that the device information services is added.
    Then you can serial commands to set and get the values.
  • Hi Sean,

    We are using CC2640R2 chip for development with SDK1.50.00.71 host test example and its size is already around 128K...almost full.

    What can be the size approx it will require if i want to add at least 3 characteristics with UUID 128 bit and its respective command set as per your input.

    Regards,
    Bhavin
  • Bhavin,

    You will have to implement this and profile the size per your implementation.
    You can refer to the existing services on the device (device info service, etc) to get an idea of how large a service is.

    The commands should not be very large as the framework is already in place, you just need to add handlers.
  • Hi Sean,

    Now i am able to add services via HCI commands with SDK 1.50.00.71 host test example and also able to discover the same.

    What i did changes in this is....

    1) Removed GATT_DB_OFF_CHIP from Preprocessor setting
    2) Commented "//#if defined(GATT_DB_OFF_CHIP) " code from function "static uint8_t processExtMsgGATT(uint8_t cmdID, hciExtCmd_t *pCmd, uint8_t *pRspDataLen)" to access command " case : HCI_EXT_GATT_ADD_SERVICE " available in file "icall_hci_ti.c "

    I also commented addAttrRec , *findUUIDRec & freeAttrRecs along with this.

    Can you confirm these won't affect performance ahead as you alert me in previous reply about using GATT_DB_OFF_CHIP macro.

    Regards,
    Bhavin
  • Hi Bhavin,

    1) looks okay
    2) I do not recommend doing this. You are mixing adding services via transport layer and on the device. Instead you can call you add service function directly in host_test_app's init function just as is the case with Device Info Service and GAP GATT service
  • Hi Sean,

    I am not able to find api to add custom services in host_test_app init function. I tried to enable GATT_TEST as well as GATT_QUAL macros to add test service and qual service but when compiling it gives error about no definition.

    I enabled MACRO through Preprocessor, can you give any example or reference how to add custom service in this ?

    Regards,
    Bhavin
  • Hi Sean,

    Can you tell what API should i call to add custom service in host test example ?

    Regards,
    Bhavin
  • Hi Sean,

    After searching too much it has been concluded that I was compiling host test in IAR while it could be seen that there is difference in host test compiled in both IAR and CCS and the difference is that CCS have Profile folder in host test app project while in case of IAR it doesn't have, you can see at your end.

    Now working with CCS i want to add SIMPLEPROFILE_SERVICE which is already part of stack that and this service i want to discover whenever connection gets established, so i used " VOID GATTTest_AddService(SIMPLEPROFILE_SERVICE ); " api in host_test_app.c file init function but even after that this service is not getting discover.

    Can you tell me is there any other way to discover this simple profile service ?

    Regards,
    Bhavin