mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ESP-BLE-Mesh: Printf the current on/off state to the application during the GET request
This commit is contained in:
parent
b06f251c3b
commit
8aeacd7478
@ -208,6 +208,7 @@ static void example_ble_mesh_provisioning_cb(esp_ble_mesh_prov_cb_event_t event,
|
||||
static void example_ble_mesh_generic_server_cb(esp_ble_mesh_generic_server_cb_event_t event,
|
||||
esp_ble_mesh_generic_server_cb_param_t *param)
|
||||
{
|
||||
esp_ble_mesh_gen_onoff_srv_t *srv;
|
||||
ESP_LOGI(TAG, "event 0x%02x, opcode 0x%04x, src 0x%04x, dst 0x%04x",
|
||||
event, param->ctx.recv_op, param->ctx.addr, param->ctx.recv_dst);
|
||||
|
||||
@ -223,6 +224,8 @@ static void example_ble_mesh_generic_server_cb(esp_ble_mesh_generic_server_cb_ev
|
||||
case ESP_BLE_MESH_GENERIC_SERVER_RECV_GET_MSG_EVT:
|
||||
ESP_LOGI(TAG, "ESP_BLE_MESH_GENERIC_SERVER_RECV_GET_MSG_EVT");
|
||||
if (param->ctx.recv_op == ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_GET) {
|
||||
srv = param->model->user_data;
|
||||
ESP_LOGI(TAG, "onoff 0x%02x", srv->state.onoff);
|
||||
example_handle_gen_onoff_msg(param->model, ¶m->ctx, NULL);
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user