- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Federico,
Probably, it is a correct approach.
But there are may important things that you have to take care when you merge mesh with other application codes.
VictorZ_46 explained regarding this in detailed in the thread Re: Can provisioned mesh nodes be non-mesh beacon as well?
Please go through it. And let me know if you have any doubt.
Also, could you please share your fully edited application code here, so that I can take a look at it and give you feedback.
Thanks,
-Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Federico,
Probably, it is a correct approach.
But there are may important things that you have to take care when you merge mesh with other application codes.
VictorZ_46 explained regarding this in detailed in the thread Re: Can provisioned mesh nodes be non-mesh beacon as well?
Please go through it. And let me know if you have any doubt.
Also, could you please share your fully edited application code here, so that I can take a look at it and give you feedback.
Thanks,
-Dheeraj