1 Reply Latest reply on Oct 25, 2019 3:46 AM by DheerajP_41

    Coexistance of beacon  Eddystone and iBeacon with mesh functionality

    FeCh_4356296

      Hi,

      i'm developing a  wonderful Lighting application with CYBT-213043-02 and mesh BT SDK 1.4.

      it would be really useful to integrate the beacon capability (with standard Eddystone and iBeacon format) in

      mesh device and setting the behavior via vendor model. I tried to "mix" the examples Mesh_LightDimmable with beacon example but unpredictable results can appear.

      the code added in mesh_app_init:

       

      void mesh_app_init(wiced_bool_t is_provisioned)

      {

      .....

      .....

      .....

          if (is_provisioned)

          {

                /* Set the advertising params and make the device discoverable */

                beacon_set_app_advertisement_data();

       

                /* Fill the adv data and start advertisements */

                beacon_set_eddystone_ibecon_advertisement_data();

                beacon_start_advertisement();

       

                result =  wiced_bt_start_advertisements(BTM_BLE_ADVERT_UNDIRECTED_HIGH, 0, NULL);

                WICED_BT_TRACE("wiced_bt_start_advertisements %d\n", result);

          }

      }

       

      void beacon_set_app_advertisement_data(void)

      {

          wiced_result_t         result;

          wiced_bt_ble_advert_elem_t adv_elem[2];

          uint8_t num_elem = 0;

         

          uint8_t flag =BTM_BLE_BREDR_NOT_SUPPORTED;

       

          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       = &flag;

          num_elem++;

         

          adv_elem[num_elem].advert_type  = BTM_BLE_ADVERT_TYPE_NAME_COMPLETE;

          adv_elem[num_elem].len          = strlen((const char *)wiced_bt_cfg_settings.device_name);

          adv_elem[num_elem].p_data       = (uint8_t*)wiced_bt_cfg_settings.device_name;

          num_elem++;

       

          result =   wiced_bt_ble_set_raw_advertisement_data(num_elem, adv_elem);

          WICED_BT_TRACE("wiced_bt_ble_set_raw_advertisements %d\n", result);

      }

       

      The instance are the same of beacon example:

       

      /* Multi advertisement instance ID */

      #define BEACON_EDDYSTONE_UID       3

      #define BEACON_EDDYSTONE_URL      4

      #define BEACON_EDDYSTONE_EID       5

      #define BEACON_EDDYSTONE_TLM      6

      #define BEACON_IBEACON                     7

       

      i can't understand the interaction of

      wiced_bt_ble_set_raw_advertisement_data

      wiced_set_multi_advertisement_data

      wiced_set_multi_advertisement_params

      wiced_start_multi_advertisements

      with mesh library and how iinterfere with advertising bearer.

      I can see only Eddystone-URL, Eddystone-EID, Eddystone-UID (with Locate app) and mesh functionality seem ok .

      Is this a correct procedure to follow or can create problem?

       

      many thanks!

      Federico