4 Replies Latest reply on Sep 15, 2014 11:31 AM by ArvindS_76 Branched to a new discussion.

    [20732] BLE_PROFILE_CFG parameters question

      Hi Sir,


      I compare the code difference between hello_sensor and ota_firmware_upgrade samples.

      The following three parameters are different.


      After I check the definition, it shows the GATT related stuffs and define the max number is 5.


          UINT16 hdl[HANDLE_NUM_MAX];         // GATT HANDLE number

          UINT16 serv[HANDLE_NUM_MAX];        // GATT service UUID

          UINT16 cha[HANDLE_NUM_MAX];         // GATT characteristic UUID


      In hello sensor,

          /*.hdl                            =*/ {0x00, 0x0063, 0x00, 0x00, 0x00}, // [HANDLE_NUM_MAX];

          /*.serv                           =*/ {0x00, UUID_SERVICE_BATTERY, 0x00, 0x00, 0x00},

          /*.cha                            =*/ {0x00, UUID_CHARACTERISTIC_BATTERY_LEVEL, 0x00, 0x00, 0x00},

      In OTA firmware upgrade,

          /*.hdl                            =*/ {0x00, 0x00, 0x00, 0x00, 0x00}, // [HANDLE_NUM_MAX];

          /*.serv                           =*/ {0x00, 0x00, 0x00, 0x00, 0x00},

          /*.cha                            =*/ {0x00, 0x00, 0x00, 0x00, 0x00},


      My question is how to define the contents of them?




        • 1. Re: [20732] BLE_PROFILE_CFG parameters question

          Within the API documentation, I found that inside of bleprofile.h (this file provides definitions and function prototypes for the BLE GATT profiles), there is a macro: #define HANDLE_NUM_MAX 5, so you are correct in that the max value is 5.


          There is also a series of Typedefs (listed under GATT Profile functions), including one named BLE_ADV_FIELD where the following fields use HANDLE_NUM_MAX as a parameter:


          UINT16 hdl [HANDLE_NUM_MAX]
          UINT16 serv [HANDLE_NUM_MAX]
          UINT16 cha [HANDLE_NUM_MAX]

          Are you asking for a profile or example that uses HANDLE_NUM_MAX?

          • 2. Re: [20732] BLE_PROFILE_CFG parameters question

            I conformed with the developers that HANDLE_NUM_MAX is 5 in the ROM.


            Currently, the only value which may be used by the stack is serv[0].  If application does not define the advertisement, by default the stack will use serv[0] to indicate that the service with that UUID is supported.  All other variables of hdl, serv and cha are for the application to use.  Hello_sensor does not use that area of the API.

            • 3. Re: [20732] BLE_PROFILE_CFG parameters question

              if I have two or more advertisements, is the HANDLE_NUM_MAX the limitation? I mean if except the serv[0], serv[1]~serv[4] are total for 4 advertisements?

              • 4. Re: [20732] BLE_PROFILE_CFG parameters question

                These are not really related to advertisements. These three arrays are there only for convenience if you want to use it to map handles, services and characteristics in your GATT database for later use. You can always use other methods like #defines or variables to do the same.

                1 of 1 people found this helpful