- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I am working with the board CYBT213043 kit .
Mesh-Demo-213043MESH.light_smart is working properly
Mesh-Demo-213043MESH.switch_smart is working properly
a combination of above 2 is working properly ( adding a sensor into the light_smart)
For a function of overide with button, the demo of Mesh-Snip-213043MESH.mesh_light_lc_client is used. The goal is set the Light LC onoff with a button.
First having problem with create event. After setting as below the event is created.
wiced_bt_mesh_event_t *p_event = wiced_bt_mesh_create_event(0,MESH_COMPANY_ID_BT_SIG,WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LC_SRV, 0xffff, 0xffff);
Now the problem is that the light_smart LC model can not be set by the funtion below.
wiced_bt_mesh_model_light_lc_client_send_light_onoff_set(p_event, &set_data);
From MeshClient on windows, the light_smart LC model can be set properly.
Do hope someone may help me out. Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you please try to create mesh event with destination 0. It will get the info from publication.
wiced_bt_mesh_create_event(0,MESH_COMPANY_ID_BT_SIG,WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LC_SRV, 0, 0);
Also, I see setting LC is already defined in the process_button_push in https://github.com/Infineon/mtb-example-btsdk-mesh-demo-switch-smart. This is on_off_switch.c. Please check.
Thanks,
-Dheeraj.P.K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you please try to create mesh event with destination 0. It will get the info from publication.
wiced_bt_mesh_create_event(0,MESH_COMPANY_ID_BT_SIG,WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LC_SRV, 0, 0);
Also, I see setting LC is already defined in the process_button_push in https://github.com/Infineon/mtb-example-btsdk-mesh-demo-switch-smart. This is on_off_switch.c. Please check.
Thanks,
-Dheeraj.P.K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if (p_event == NULL)
return;
if (p_event == NULL)
{
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Update:
Please use the latest SDK - v3.3. When i tested the switch smart application the switch control is working fine. If we configure the publication of smart switch and light properly, we can control the LED of the light smart using the button of switch smart app.
If my understanding is correct about the requirement, I guess what you need is the same code inside process_button_push() function which will create a mesh event and send light LC on/off to the light smart. Please check the code. If you copy it to the appropriate place for example, e93196_int_proc, mesh_sensor_presence_detected_timer_callback or mesh_sensor_value_changed, I guess, you can achieve the goal you have described.
Example Code:
static uint8_t onoff_state = 0;
wiced_bt_mesh_light_lc_light_onoff_set_data_t set_data;
wiced_bt_mesh_event_t *p_event = wiced_bt_mesh_create_event(element_idx, MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LC_CLNT, 0, 0);
if (p_event == NULL)
return;
if (WICED_BT_MESH_IS_UNICAST_ADDR(p_event->dst))
{
p_event->reply = WICED_TRUE;
}
set_data.light_onoff = (onoff_state == 1) ? 0 : 1;
set_data.transition_time = WICED_BT_MESH_TRANSITION_TIME_DEFAULT;
set_data.delay = 0;
WICED_BT_TRACE("onoff set target:%d\n", set_data.light_onoff);
wiced_bt_mesh_model_light_lc_client_send_light_onoff_set(p_event, &set_data);
// If we do not receive status from the bulb, we will just toggle between on and off.
// If we receive status, the state will be updated. For example, if the bulb is the
// light controller, it may execute state machine and go off on timeout. Then this
// application will receive the state Off and will send On again on the button push.
onoff_state ^= 1;