1 2 3 Previous Next 38 Replies Latest reply on Aug 14, 2015 5:33 PM by mkochhal

    128-bit UUID support on WICED SDK 3.3.1

    mkochhal

      Hi.

       

      I wish to know a work around for this and when will it be supported?

       

      Currently, WICED SDK 3.3.1 claims to support BLE but misses out on the most important and basic requirement of being able to advertise Vendor Specific 128-bit UUID for custom services and characteristics.

       

      This issue was identified while trying to customize the ble_proximity_reporter application. See question posted on the forum yesterday ...Wiced SDK 3.3.1: Customizing the ble proximity reporter for Vendor Specific Services and Attributes

       

      I am still waiting on a workaround or an answer as to how to fix it or when will the fix be available?

       

      Thanks!

       

      Regards,

      Manish

        • 1. Re: 128-bit UUID support on WICED SDK 3.3.1
          mifo

          I checked with the developers on the BLE side (2073X/2070X) and they confirmed that the functionality you require is definitely included.

           

          They realize that the API is not well documented, but they believe there is an API there that can be used to create any type of advertisement packet.

           

          Unfortunately, it does not look like we provide a sample app.

           

          They said to check if there is wiced_bt_ble_set_advertisement_data in the documentation or in the header files.

           

          user_305201620 grga

          • 2. Re: 128-bit UUID support on WICED SDK 3.3.1
            mkochhal

            So does this mean, there is an API in the WICED SDK 3.3.1 that will allow me to advertise BLE 128-bit UUID on the BCM943341 platform?

             

            Please provide more details ... I will search for this API.

            • 3. Re: 128-bit UUID support on WICED SDK 3.3.1
              mkochhal

              I have already modified my init function to do just that ... But this does not work, am I missing something? Is there a format in which the UUIDs should be set ...in the structure field uuid128? Also, check the flags that I set using the API wiced_bt_ble_set_advertisment_data()

               

              /* Initialize Proximity Reporter */

              static void ble_proximity_reporter_init( void )

              {

                  wiced_bt_ble_advert_data_t adv_data;

                  wiced_bt_ble_128service_t  ble_adv_128_serv_data;

                 

                  /* Set the advertised service with 128-bit UUID */

                  ble_adv_128_serv_data.list_cmpl = WICED_TRUE;

                  ble_adv_128_serv_data.uuid128[0] = 0x06;

                  ble_adv_128_serv_data.uuid128[1] = 0xF1;

                  ble_adv_128_serv_data.uuid128[2] = 0x98;

                  ble_adv_128_serv_data.uuid128[3] = 0x1E;

                  ble_adv_128_serv_data.uuid128[4] = 0x47;

                  ble_adv_128_serv_data.uuid128[5] = 0x7A;

                  ble_adv_128_serv_data.uuid128[6] = 0x41;

                  ble_adv_128_serv_data.uuid128[7] = 0x7F;

                  ble_adv_128_serv_data.uuid128[8] = 0xA7;

                  ble_adv_128_serv_data.uuid128[9] = 0x61;

                  ble_adv_128_serv_data.uuid128[10] = 0x15;

                  ble_adv_128_serv_data.uuid128[11] = 0x24;

                  ble_adv_128_serv_data.uuid128[12] = 0x54;

                  ble_adv_128_serv_data.uuid128[13] = 0xC4;

                  ble_adv_128_serv_data.uuid128[14] = 0x52;

                  ble_adv_128_serv_data.uuid128[15] = 0xD0;

                 

                  adv_data.p_services_128b = &ble_adv_128_serv_data;

                 

                  /* Set advertising data: device name and discoverable flag */

                  adv_data.flag = BTM_BLE_ADVERT_TYPE_128SRV_COMPLETE;//0x06;

                  wiced_bt_ble_set_advertisement_data( BTM_BLE_ADVERT_BIT_FLAGS | BTM_BLE_ADVERT_BIT_DEV_NAME | BTM_BLE_ADVERT_BIT_SERVICE_128, &adv_data );

               

               

                  /* Enable privacy */

                  wiced_bt_ble_enable_privacy( TRUE );

               

               

                  /* Register for gatt event notifications */

                  wiced_bt_gatt_register( &ble_proximity_gatt_cback );

               

               

                  /* Initialize GATT database */

                  wiced_bt_gatt_db_init( (uint8_t *) gatt_db, gatt_db_size );

               

               

                  /* Enable Bluetooth LE advertising and connectability */

               

               

                  /* start LE advertising */

                  wiced_bt_start_advertisements( BTM_BLE_ADVERT_UNDIRECTED_HIGH, 0, NULL );

                  WPRINT_BT_APP_INFO( ("Waiting for proximity monitor to connect...\n") );

              }

              • 4. Re: 128-bit UUID support on WICED SDK 3.3.1
                mkochhal

                Basically, after compiling and downloading the binaries to run on BCM943341 eval board, I will show that on light blue it shows a different 128-bit UUID.

                 

                In essence the WICED SDK3.3.1 completely ignores the user specified UUID and randomly generates a new 128-bit UUID at compile time and probably dumps this new value into the DCT. When the application runs, it reads this new value ... So the problem is that "Is it possible that the SDK i.e 3.3.1 on BCM943341 has some code in the BLE stack that uses random UUID generation for some special case and considers the BLE Proximity Application as one such example of this case?IMG_7411.PNGIMG_7412.PNGIMG_7413.PNG

                • 5. Re: 128-bit UUID support on WICED SDK 3.3.1
                  mifo

                  I have asked the AE team to respond.

                  • 6. Re: 128-bit UUID support on WICED SDK 3.3.1
                    mkochhal

                    A quick and dirty sample app that is advertising 128-bit UUID will be great ... I will also post my application in a zipped format, so that folks can test it out with the Light Blue App.

                     

                    Thanks!

                    • 7. Re: 128-bit UUID support on WICED SDK 3.3.1
                      mkochhal

                      1. Please find the code attached. Place this under snip/bluetooth folder.

                      2. Compile the code using command:

                          make.exe snip.bluetooth.hifitablet_attr_handler-BCM943341WCD1

                      3. Download and run the code using command:

                          make.exe snip.bluetooth.hifitablet_attr_handler-BCM943341WCD1 download run

                      4. Open the LightBlue app on the ios device and connect to the HiFiTablet service.

                       

                      Please let me know, if you are not able to reproduce the issue.

                       

                      Thanks!

                       

                      Regards,

                      Manish

                      • 8. Re: 128-bit UUID support on WICED SDK 3.3.1
                        mifo

                        I asked one of our developers to look through the code you provided and he found a couple of issues:

                         

                        1. Given the dev name they’re using, they’re trying to include 33 bytes into the advertisement payload, ie:

                        • ADVERT_BIT_FLAGS data = 1B Length + 1B Type + 1B Data = 3 Bytes
                        • ADVERT_BIT_DEV_NAME data = 1B Length + 1B Type + 10B Data (“HiFiTablet”) = 12 Bytes
                        • ADVERT_BIT_SERVICE_128 data = 1B Length + 1B Type + 16B Data = 18 Bytes
                        • TOTAL = 3 + 12 +18 = 33 Bytes (too large)

                         

                        2. You are also not configuring it correctly in your code.

                         

                        So essentially, you need to keep in mind that that max adv data payload is 31 bytes, so the ADVERT_BIT_FLAGS data + ADVERT_BIT_DEV_NAME data + ADVERT_BIT_SERVICE_128 data needs to add up to no more than 31 bytes, or else the 128bit service data will not be included.

                         

                        Below is an example of how you should be setting this up if you want all three of these advertising data elements included.

                         

                        Attached is also a capture of the advertisement data with this change to ble_proximity_reporter captured OTA.

                         

                            wiced_bt_ble_128service_t my_128bit_service_uuid;
                            uint8_t i;

                            memset( &adv_data, 0, sizeof( wiced_bt_ble_advert_data_t ) );
                            memset( &my_128bit_service_uuid, 0, sizeof( my_128bit_service_uuid ) );

                            adv_data.flag = BTM_BLE_GENERAL_DISCOVERABLE_FLAG | BTM_BLE_BREDR_NOT_SUPPORTED;

                            my_128bit_service_uuid.list_cmpl = TRUE;

                            for ( i = 0; i < 16; i++ )
                            {
                                my_128bit_service_uuid.uuid128[i] = i;
                            }

                            adv_data.p_services_128b = &my_128bit_service_uuid;

                            wiced_bt_ble_set_advertisement_data( BTM_BLE_ADVERT_BIT_FLAGS | BTM_BLE_ADVERT_BIT_SERVICE_128 | BTM_BLE_ADVERT_BIT_DEV_NAME, &adv_data );

                         

                        user_305201620 john.battin grga vikr seyhan jtate_1939431

                        • 9. Re: 128-bit UUID support on WICED SDK 3.3.1
                          mkochhal

                          Hi,

                           

                          I tried the fix that you provided.

                           

                          The service UUID seems to not change after every download and reset. However, it still misses to advertise the UUID that I have set in the GATT.

                           

                          //let kUUID_TabletService                     = "06F1981E-477A-417F-A761-152454C452D0" //this is what the UUID should appear as in the iOS-App/LightBlue

                          #define __UUID_TABLET                                   0xd0, 0x52, 0xc4, 0x54, 0x24, 0x15, 0x61, 0xa7, 0x7f, 0x41, 0x7a, 0x47, 0x1e, 0x98, 0xf1, 0x06

                          #define __UUID_TABLET_BATTERY_LEVEL                     0x7b, 0x31, 0x03, 0x2f, 0x14, 0x64, 0x6c, 0x89, 0xb3, 0x4e, 0xcb, 0xbc, 0x65, 0x79, 0x74, 0x45

                          #define __UUID_TABLET_TABLET_NAME                       0xba, 0xdf, 0x6d, 0xcd, 0x6a, 0x40, 0xd5, 0x9f, 0x32, 0x4f, 0xd3, 0xf3, 0xa4, 0x70, 0xf9, 0xa6

                           

                          Also, in the sample code recommended in the earlier post, I don't understand why do you set the uuid to 0..15

                          for ( i = 0; i < 16; i++ )

                              {

                                  my_128bit_service_uuid.uuid128[i] = i;

                              }

                          • 10. Re: 128-bit UUID support on WICED SDK 3.3.1
                            jgui

                            "Also, in the sample code recommended in the earlier post, I don't understand why do you set the uuid to 0..15", this was just an example of how to set the service uuid in the advertisement data. You can look at the .png file that mwf_mmfae attached which is an OTA capture showing the updated advertisment data. You'll see the Complete List of 128-bit UUID with UUID = 0...15. The for loop should be replaced by you with whatever service uuid you want to include in your adv data.

                             

                            Please keep in mind you will not be able to include 3 128-bit service uuids in the adv data because it's too big.

                             

                            For the #defines you're updating, it looks like you're actually including 3 128-bit services in the GATT database, and not the adv data, right? A GATT client will not see these service uuids until Service Discovery is performed.

                            • 11. Re: 128-bit UUID support on WICED SDK 3.3.1
                              mkochhal

                              Actually, I did change the uuid[16] bit array to include my service UUID,

                               

                              See code below ... I have tried both endian-ness and I don't see the service UUID in light blue ..

                               

                               

                               

                              /* Initialize Proximity Reporter */

                              static void ble_proximity_reporter_init( void )

                              {

                                wiced_bt_ble_advert_data_t adv_data;

                                 

                                  wiced_bt_ble_128service_t my_128bit_service_uuid;

                                  uint8_t i;

                                  memset( &adv_data, 0, sizeof( wiced_bt_ble_advert_data_t ) );

                                  memset( &my_128bit_service_uuid, 0, sizeof( my_128bit_service_uuid ) );

                                  adv_data.flag = BTM_BLE_GENERAL_DISCOVERABLE_FLAG | BTM_BLE_BREDR_NOT_SUPPORTED;

                                  my_128bit_service_uuid.list_cmpl = TRUE;

                               

                                  my_128bit_service_uuid.uuid128[15] = 0x06;

                                  my_128bit_service_uuid.uuid128[14] = 0xF1;

                                  my_128bit_service_uuid.uuid128[13] = 0x98;

                                  my_128bit_service_uuid.uuid128[12] = 0x1E;

                                  my_128bit_service_uuid.uuid128[11] = 0x47;

                                  my_128bit_service_uuid.uuid128[10] = 0x7A;

                                  my_128bit_service_uuid.uuid128[9] = 0x41;

                                  my_128bit_service_uuid.uuid128[8] = 0x7F;

                                  my_128bit_service_uuid.uuid128[7] = 0xA7;

                                  my_128bit_service_uuid.uuid128[6] = 0x61;

                                  my_128bit_service_uuid.uuid128[5] = 0x15;

                                  my_128bit_service_uuid.uuid128[4] = 0x24;

                                  my_128bit_service_uuid.uuid128[3] = 0x54;

                                  my_128bit_service_uuid.uuid128[2] = 0xC4;

                                  my_128bit_service_uuid.uuid128[1] = 0x52;

                                  my_128bit_service_uuid.uuid128[0] = 0xD0;

                                

                              #if 0  

                                  for ( i = 0; i < 16; i++ )

                                  {

                                      my_128bit_service_uuid.uuid128[i] = i;

                                  }

                              #endif

                               

                               

                                  adv_data.p_services_128b = &my_128bit_service_uuid;

                                  wiced_bt_ble_set_advertisement_data( BTM_BLE_ADVERT_BIT_FLAGS | BTM_BLE_ADVERT_BIT_SERVICE_128 | BTM_BLE_ADVERT_BIT_DEV_NAME, &adv_data );

                               

                                  /* Enable privacy */

                                  wiced_bt_ble_enable_privacy( TRUE );

                               

                               

                                  /* Register for gatt event notifications */

                                  wiced_bt_gatt_register( &ble_proximity_gatt_cback );

                               

                               

                                  /* Initialize GATT database */

                                  wiced_bt_gatt_db_init( (uint8_t *) gatt_db, gatt_db_size );

                               

                               

                                  /* Enable Bluetooth LE advertising and connectability */

                               

                               

                                  /* start LE advertising */

                                  wiced_bt_start_advertisements( BTM_BLE_ADVERT_UNDIRECTED_HIGH, 0, NULL );

                                  WPRINT_BT_APP_INFO( ("Waiting for proximity monitor to connect...\n") );

                              }

                              • 12. Re: 128-bit UUID support on WICED SDK 3.3.1
                                jgui

                                Are you able to get an OTA capture? Also, did you shorten your device name? HiFiTablet” is too long if you're trying to include this + the 128-bit service uuid.

                                • 13. Re: 128-bit UUID support on WICED SDK 3.3.1
                                  mkochhal

                                  I don't have an OTA capture. But I will shorten the name and try again.

                                  • 14. Re: 128-bit UUID support on WICED SDK 3.3.1
                                    mkochhal

                                    Which tool or sniffer do you use for an OTA capture?

                                     

                                    user_305201620

                                    1 2 3 Previous Next