6 Replies Latest reply on Apr 29, 2019 2:55 AM by AnjanaM_61

    iBeacon function to transmit UUID, Major,Minor per 7s

    YaTr_3516311

      Dear friends,

       

      I 'm new to CYBT-343026. I want to realize a iBeacon function which is transmitting UUID, Major,Minor per 7s. I do a demo one via WICED-Studio which add uuid information. When I use Blutooth assist tool APP to search this device. I can search the corsponding name, but no my designed UUID(0x87, 0xf8, 0xac, 0xb5, 0x9a, 0xd0, 0x29, 0xa7, 0x20, 0x4c, 0xf0, 0x80, 0xe2, 0xb5, 0x5c, 0x0e). I don't know where is the problem. Is my way is wrong? If it is, how can I add uuid, major, minor information?

       

       

      Below is my modify code.

      // 0x0f, 0x00 Broadcom  (Company Identifier 2 bytes)
      uint8_t mybeacon_uuid[18] = {0x0f, 0x00, 0x87, 0xf8, 0xac, 0xb5, 0x9a, 0xd0, 0x29, 0xa7, 0x20, 0x4c, 0xf0, 0x80, 0xe2, 0xb5, 0x5c, 0x0e};

      /* Set Advertisement Data */
      void treacybeacon_set_advertisement_data( void )
      {
          wiced_bt_ble_advert_elem_t adv_elem[3] = { 0 };
          uint8_t adv_flag = BTM_BLE_GENERAL_DISCOVERABLE_FLAG | BTM_BLE_BREDR_NOT_SUPPORTED;
          uint8_t num_elem = 0;

          /* Advertisement Element for Flags */
          adv_elem[num_elem].advert_type = BTM_BLE_ADVERT_TYPE_FLAG;
          adv_elem[num_elem].len = sizeof(uint8_t);
          adv_elem[num_elem].p_data = &adv_flag;
          num_elem++;

          /* Advertisement Element for Name */
          adv_elem[num_elem].advert_type = BTM_BLE_ADVERT_TYPE_NAME_COMPLETE;
          adv_elem[num_elem].len = strlen((const char*)BT_LOCAL_NAME);
          adv_elem[num_elem].p_data = BT_LOCAL_NAME;
          num_elem++;


          /* Advertisement Element for UUID */
          adv_elem[num_elem].advert_type = BTM_BLE_ADVERT_TYPE_MANUFACTURER;
          adv_elem[num_elem].len = 18;
          adv_elem[num_elem].p_data = mybeacon_uuid;
          num_elem++;

          /* Set Raw Advertisement Data */
          wiced_bt_ble_set_raw_advertisement_data(num_elem, adv_elem);
      }

       

       

      Attach is Blutooth assist tool APP search result.

       

      BR,

      Treacy

        • 1. Re: iBeacon function to transmit UUID, Major,Minor per 7s
          AnjanaM_61

          Hi,

           

          Can you please let me know your app details?

          I tried searching it in my android play store , but couldn't bale to get.

           

          Your code seems to be fine.

          May be the app is not showing the result correctly.

          Can you share your project? I shall test it at my side and will let you know the updates.

           

          Thanks,
          Anjana

          • 2. Re: iBeacon function to transmit UUID, Major,Minor per 7s
            YaTr_3516311

            Dear Anjana,

             

            I tried other APPs today, and still find no customized UUID information. One APP is named "BLE debugger" on HUAWEI. The other is "BlueSee" on Iphone. Below are the corresponding screenshots.

            BLE Debugger.png

            bluesee.PNG

            Below are my other doubts:

            1. How can I add Major Minor information? Just like the UUID to add it in treacybeacon_set_advertisement_data function?

            2. If Mass production, all BT devices will use the same UUID, major, minor information and transmit per 7s. How can I modify this information if I want to change the parameters?(For example, I want to change the minor information and 7s information)

            • 3. Re: iBeacon function to transmit UUID, Major,Minor per 7s
              YaTr_3516311

              Sorry that I forgot to attach my project. Please see link:https://pan.baidu.com/s/1iCDRm1Xc16tOQU-OgKVPLw,  password:p9pa.

              • 4. Re: iBeacon function to transmit UUID, Major,Minor per 7s
                AnjanaM_61

                Hi Treacy,

                 

                I couldn't able to download the project. However I understood the issue. (next time please attach the zip file of project in the interaction itself )

                 

                The issue is the adv data is more than standard value.

                BLE adv data length is 31 bytes.  You have to adjust the data appropriately to fit inside this 31 bytes.In this 31 bytes, few will go for defining flag settings and adv type .

                Please have a look at the attached screenshot.

                If you want to include UUID + major minor , either reduce the device name length or skip UUID in the packet.

                 

                1. How can I add Major Minor information? Just like the UUID to add it in treacybeacon_set_advertisement_data function?

                A) Yes, you have to add it as a manufacture data

                2. If Mass production, all BT devices will use the same UUID, major, minor information and transmit per 7s. How can I modify this information if I want to change the parameters?(For example, I want to change the minor information and 7s information)

                A) you mean you want to dynamically change in application? If then,  modify only the data and you need to call the same function (treacybeacon_set_advertisement_data) again whenever you want.

                 

                Thanks,
                Anjana

                • 5. Re: iBeacon function to transmit UUID, Major,Minor per 7s
                  YaTr_3516311

                  Dear Anjana,

                   

                  1. Yes, you are correct. We I reduce the length to less than 31 bytes, it is OK now. Thank you very much.

                  2. A) you mean you want to dynamically change in application? If then,  modify only the data and you need to call the same function (treacybeacon_set_advertisement_data) again whenever you want.

                   

                  I mean if Mass production, all BT devices will use the same UUID, major, minor information and transmit per 7s beacuse I use the same FW code. If my client have use this product and want to modify the minor parameter(iBeacon function is used to locate some devices. Right?), How can I do?  Do I use some AT command or API to change the parameter?

                  3. BLE adv data length is 31 bytes. If I want to add more information(more than 31 bytes), is there any way to realize this function?

                  • 6. Re: iBeacon function to transmit UUID, Major,Minor per 7s
                    AnjanaM_61

                    Hi,

                     

                    2) Yes, you can change the data.  If you are using WICED SDK, you can change the data by calling the set advertisement API again.

                    3) If you want to add more data, you can send it in scan response data packet (31 more bytes). But only the Observer / Central device which is using active scan will get these packet. Refer section11 ADVERTISING AND SCAN RESPONSE DATA FORMAT BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 3, Part C

                     

                     

                    Thanks,

                    Anjana

                    2 of 2 people found this helpful