mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/remove_-Wno-formate_in_ble_mesh_examples' into 'master'
ble_mesh: example: Remove -Wno-format compile option for BLE Mesh examples See merge request espressif/esp-idf!21523
This commit is contained in:
commit
7283a406e4
@ -11,4 +11,3 @@ set(COMPONENT_ADD_INCLUDEDIRS ". include")
|
|||||||
set(COMPONENT_REQUIRES bt nvs_flash example_nvs)
|
set(COMPONENT_REQUIRES bt nvs_flash example_nvs)
|
||||||
|
|
||||||
register_component()
|
register_component()
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
// Copyright (C) 2018-2020 Alibaba Group Holding Limited
|
|
||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2018-2020 Alibaba Group Holding Limited
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* SPDX-FileContributor: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_random.h"
|
#include "esp_random.h"
|
||||||
@ -247,7 +249,7 @@ static void genie_model_retry_timer_cb(void *args)
|
|||||||
/* start new timer */
|
/* start new timer */
|
||||||
if (!genie_dlist_is_empty(p_head)) {
|
if (!genie_dlist_is_empty(p_head)) {
|
||||||
util_timer_start(&g_vnd_msg_timer, nearest);
|
util_timer_start(&g_vnd_msg_timer, nearest);
|
||||||
ESP_LOGD(TAG, "restart retry timer, timeout: %d", nearest);
|
ESP_LOGD(TAG, "restart retry timer, timeout: %" PRIu32, nearest);
|
||||||
} else {
|
} else {
|
||||||
util_timer_stop(&g_vnd_msg_timer);
|
util_timer_stop(&g_vnd_msg_timer);
|
||||||
ESP_LOGD(TAG, "list empty, stop timer");
|
ESP_LOGD(TAG, "list empty, stop timer");
|
||||||
@ -631,5 +633,5 @@ void genie_model_dispatch(uint32_t opcode, esp_ble_mesh_model_t *model,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESP_LOGW(TAG, "not find callback function for opcode: 0x%02x", opcode);
|
ESP_LOGW(TAG, "not find callback function for opcode: 0x%02" PRIu32, opcode);
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,15 @@
|
|||||||
// Copyright (C) 2018-2020 Alibaba Group Holding Limited
|
/*
|
||||||
// Adaptations to ESP-IDF Copyright (c) 2020 Espressif Systems (Shanghai) Co. Ltd.
|
* SPDX-FileCopyrightText: 2018-2020 Alibaba Group Holding Limited
|
||||||
//
|
*
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
// you may not use this file except in compliance with the License.
|
*
|
||||||
// You may obtain a copy of the License at
|
* SPDX-FileContributor: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||||
//
|
*/
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "genie_mesh.h"
|
#include "genie_mesh.h"
|
||||||
#include "genie_event.h"
|
#include "genie_event.h"
|
||||||
@ -333,7 +327,7 @@ static void genie_timer_update(void *args)
|
|||||||
k_work_submit(&g_genie_timer.work);
|
k_work_submit(&g_genie_timer.work);
|
||||||
|
|
||||||
if (g_genie_timer.unix_time % 60 == 0) {
|
if (g_genie_timer.unix_time % 60 == 0) {
|
||||||
ESP_LOGI(TAG, "genie_timer_update %d", g_genie_timer.unix_time);
|
ESP_LOGI(TAG, "genie_timer_update %" PRIu32, g_genie_timer.unix_time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -534,7 +528,7 @@ int genie_timer_start(uint8_t index, uint32_t unix_time, genie_timer_attr_data_t
|
|||||||
return -GENIE_TIMER_ERR_PARAM;
|
return -GENIE_TIMER_ERR_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGI(TAG, "timer start index %d expect unix_time %d attr_type %d",
|
ESP_LOGI(TAG, "timer start index %d expect unix_time %" PRIu32 " attr_type %d",
|
||||||
index, unix_time, attr_data->type);
|
index, unix_time, attr_data->type);
|
||||||
|
|
||||||
if (!g_genie_timer.init) {
|
if (!g_genie_timer.init) {
|
||||||
@ -634,7 +628,7 @@ int genie_timer_periodic_start(uint8_t index, uint16_t periodic_time, uint8_t sc
|
|||||||
|
|
||||||
vendor_timer->unixtime_match = convert_utc_to_unix(&utc) + periodic_time - g_timing_data.timezone * HOUR;
|
vendor_timer->unixtime_match = convert_utc_to_unix(&utc) + periodic_time - g_timing_data.timezone * HOUR;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "periodic timer unixtime_match %d", vendor_timer->unixtime_match);
|
ESP_LOGI(TAG, "periodic timer unixtime_match %" PRIu32, vendor_timer->unixtime_match);
|
||||||
|
|
||||||
VT_LOCK;
|
VT_LOCK;
|
||||||
genie_slist_append(&g_genie_timer.timer_list_active, &vendor_timer->next);
|
genie_slist_append(&g_genie_timer.timer_list_active, &vendor_timer->next);
|
||||||
@ -704,7 +698,7 @@ int genie_timer_remove(uint8_t index)
|
|||||||
void genie_timer_local_time_show(void)
|
void genie_timer_local_time_show(void)
|
||||||
{
|
{
|
||||||
ENTER_FUNC();
|
ENTER_FUNC();
|
||||||
ESP_LOGI(TAG, "unix_time revert %d", convert_utc_to_unix(&local_time));
|
ESP_LOGI(TAG, "unix_time revert %" PRIu32, convert_utc_to_unix(&local_time));
|
||||||
ESP_LOGI(TAG, "%4d/%2d/%2d %2d:%2d:%d weekday %2d %04d",
|
ESP_LOGI(TAG, "%4d/%2d/%2d %2d:%2d:%d weekday %2d %04d",
|
||||||
local_time.year, local_time.month + 1, local_time.day,
|
local_time.year, local_time.month + 1, local_time.day,
|
||||||
local_time.hour, local_time.minutes, local_time.seconds,
|
local_time.hour, local_time.minutes, local_time.seconds,
|
||||||
@ -780,12 +774,12 @@ int genie_timer_local_time_update(uint32_t unix_time)
|
|||||||
|
|
||||||
local_time = convert_unix_to_utc(unix_time + g_timing_data.timezone * HOUR);
|
local_time = convert_unix_to_utc(unix_time + g_timing_data.timezone * HOUR);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "unix_time %d", unix_time);
|
ESP_LOGI(TAG, "unix_time %" PRIu32, unix_time);
|
||||||
ESP_LOGI(TAG, "localtime update %4d/%2d/%2d %2d:%2d:%d weekday %2d",
|
ESP_LOGI(TAG, "localtime update %4d/%2d/%2d %2d:%2d:%d weekday %2d",
|
||||||
local_time.year, local_time.month + 1, local_time.day,
|
local_time.year, local_time.month + 1, local_time.day,
|
||||||
local_time.hour, local_time.minutes, local_time.seconds,
|
local_time.hour, local_time.minutes, local_time.seconds,
|
||||||
local_time.weekday);
|
local_time.weekday);
|
||||||
ESP_LOGI(TAG, "unix_time revert %d", convert_utc_to_unix(&local_time));
|
ESP_LOGI(TAG, "unix_time revert %" PRIu32, convert_utc_to_unix(&local_time));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,15 @@
|
|||||||
// Copyright (C) 2018-2020 Alibaba Group Holding Limited
|
/*
|
||||||
// Adaptations to ESP-IDF Copyright (c) 2020 Espressif Systems (Shanghai) Co. Ltd.
|
* SPDX-FileCopyrightText: 2018-2020 Alibaba Group Holding Limited
|
||||||
//
|
*
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
// you may not use this file except in compliance with the License.
|
*
|
||||||
// You may obtain a copy of the License at
|
* SPDX-FileContributor: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||||
//
|
*/
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
|
||||||
@ -63,7 +57,7 @@ void util_timer_start(util_timer_t *timer, uint32_t timeout)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGD(TAG, "timer: %p, timeout: %u", timer, timeout);
|
ESP_LOGD(TAG, "timer: %p, timeout: %" PRIu32, timer, timeout);
|
||||||
|
|
||||||
util_timer_stop(timer);
|
util_timer_stop(timer);
|
||||||
|
|
||||||
|
@ -5,4 +5,3 @@ set(COMPONENT_SRCS "board.c"
|
|||||||
set(COMPONENT_ADD_INCLUDEDIRS ". include")
|
set(COMPONENT_ADD_INCLUDEDIRS ". include")
|
||||||
|
|
||||||
register_component()
|
register_component()
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_mac.h"
|
#include "esp_mac.h"
|
||||||
@ -857,7 +858,7 @@ static void prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32
|
|||||||
{
|
{
|
||||||
ENTER_FUNC();
|
ENTER_FUNC();
|
||||||
ESP_LOGI(TAG, "net_idx: 0x%04x, addr: 0x%04x", net_idx, addr);
|
ESP_LOGI(TAG, "net_idx: 0x%04x, addr: 0x%04x", net_idx, addr);
|
||||||
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08x", flags, iv_index);
|
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08" PRIx32, flags, iv_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void example_ble_mesh_provisioning_cb(esp_ble_mesh_prov_cb_event_t event,
|
static void example_ble_mesh_provisioning_cb(esp_ble_mesh_prov_cb_event_t event,
|
||||||
@ -1021,7 +1022,7 @@ static void example_ble_mesh_config_server_cb(esp_ble_mesh_cfg_server_cb_event_t
|
|||||||
static void example_ble_mesh_generic_server_cb(esp_ble_mesh_generic_server_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_generic_server_cb_param_t *param)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "event 0x%02x, opcode 0x%04x, src 0x%04x, dst 0x%04x",
|
ESP_LOGD(TAG, "event 0x%02x, opcode 0x%04" PRIx32 ", src 0x%04x, dst 0x%04x",
|
||||||
event, param->ctx.recv_op, param->ctx.addr, param->ctx.recv_dst);
|
event, param->ctx.recv_op, param->ctx.addr, param->ctx.recv_dst);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
@ -1090,7 +1091,7 @@ static void example_ble_mesh_lighting_server_cb(esp_ble_mesh_lighting_server_cb_
|
|||||||
#endif
|
#endif
|
||||||
esp_ble_mesh_server_state_value_t state = {0};
|
esp_ble_mesh_server_state_value_t state = {0};
|
||||||
|
|
||||||
ESP_LOGD(TAG, "event 0x%02x, opcode 0x%04x, src 0x%04x, dst 0x%04x",
|
ESP_LOGD(TAG, "event 0x%02x, opcode 0x%04" PRIx32 ", src 0x%04x, dst 0x%04x",
|
||||||
event, param->ctx.recv_op, param->ctx.addr, param->ctx.recv_dst);
|
event, param->ctx.recv_op, param->ctx.addr, param->ctx.recv_dst);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
@ -1208,15 +1209,15 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
case ESP_BLE_MESH_MODEL_OPERATION_EVT:
|
case ESP_BLE_MESH_MODEL_OPERATION_EVT:
|
||||||
ESP_LOGD(TAG, "ESP_BLE_MESH_MODEL_OPERATION_EVT");
|
ESP_LOGD(TAG, "ESP_BLE_MESH_MODEL_OPERATION_EVT");
|
||||||
ESP_LOGD(TAG, "opcode: 0x%06x", param->model_operation.opcode);
|
ESP_LOGD(TAG, "opcode: 0x%06" PRIx32, param->model_operation.opcode);
|
||||||
genie_model_dispatch(param->model_operation.opcode, param->model_operation.model,
|
genie_model_dispatch(param->model_operation.opcode, param->model_operation.model,
|
||||||
param->model_operation.ctx, param->model_operation.msg, param->model_operation.length);
|
param->model_operation.ctx, param->model_operation.msg, param->model_operation.length);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_SEND_COMP_EVT:
|
case ESP_BLE_MESH_MODEL_SEND_COMP_EVT:
|
||||||
ESP_LOGD(TAG, "ESP_BLE_MESH_MODEL_SEND_COMP_EVT");
|
ESP_LOGD(TAG, "ESP_BLE_MESH_MODEL_SEND_COMP_EVT");
|
||||||
ESP_LOGD(TAG, "opcode: 0x%06x", param->model_send_comp.opcode);
|
ESP_LOGD(TAG, "opcode: 0x%06" PRIx32, param->model_send_comp.opcode);
|
||||||
if (param->model_send_comp.err_code) {
|
if (param->model_send_comp.err_code) {
|
||||||
ESP_LOGE(TAG, "Failed to send message: 0x%06x, err: %d", param->model_send_comp.opcode, param->model_send_comp.err_code);
|
ESP_LOGE(TAG, "Failed to send message: 0x%06" PRIx32 ", err: %d", param->model_send_comp.opcode, param->model_send_comp.err_code);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* AliGenie - Example
|
* AliGenie - Example
|
||||||
*
|
*
|
||||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
@ -215,7 +216,7 @@ uint8_t *mac_str2hex(const char *mac_str, uint8_t *mac_hex)
|
|||||||
{
|
{
|
||||||
uint32_t mac_data[6] = {0};
|
uint32_t mac_data[6] = {0};
|
||||||
|
|
||||||
sscanf(mac_str, "%02x%02x%02x%02x%02x%02x",
|
sscanf(mac_str, "%02" PRIx32 "%02" PRIx32 "%02" PRIx32 "%02" PRIx32 "%02" PRIx32 "%02" PRIx32,
|
||||||
mac_data, mac_data + 1, mac_data + 2, mac_data + 3, mac_data + 4, mac_data + 5);
|
mac_data, mac_data + 1, mac_data + 2, mac_data + 3, mac_data + 4, mac_data + 5);
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
|
@ -9,5 +9,3 @@ idf_component_register(SRCS "${srcs}"
|
|||||||
INCLUDE_DIRS "."
|
INCLUDE_DIRS "."
|
||||||
REQUIRES console nvs_flash bt
|
REQUIRES console nvs_flash bt
|
||||||
REQUIRED_IDF_TARGETS esp32)
|
REQUIRED_IDF_TARGETS esp32)
|
||||||
|
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* ESP BLE Mesh Example
|
* ESP BLE Mesh Example
|
||||||
*
|
*
|
||||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "ble_unit.h"
|
#include "ble_unit.h"
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
#define TAG "BLE_UINT"
|
#define TAG "BLE_UINT"
|
||||||
@ -102,7 +104,7 @@ static void ble_gap_util_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_pa
|
|||||||
&& (memcmp(default_adv_data, param->scan_rst.ble_adv, sizeof(default_adv_data)) == 0)) {
|
&& (memcmp(default_adv_data, param->scan_rst.ble_adv, sizeof(default_adv_data)) == 0)) {
|
||||||
scan_count.adv_count += 1;
|
scan_count.adv_count += 1;
|
||||||
if (scan_count.adv_count % 10 == 0) {
|
if (scan_count.adv_count % 10 == 0) {
|
||||||
ESP_LOGI(TAG, "adv count:%d scan_res count %d\n", scan_count.adv_count, scan_count.scan_res_count);
|
ESP_LOGI(TAG, "adv count:%" PRIu32 " scan_res count %" PRIu32, scan_count.adv_count, scan_count.scan_res_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "run_tc.h"
|
#include "run_tc.h"
|
||||||
#include "test_env.h"
|
#include "test_env.h"
|
||||||
#include "wifi_unit.h"
|
#include "wifi_unit.h"
|
||||||
@ -48,7 +50,7 @@ static void wifi_tc_sta_throughput_timeout(void *arg)
|
|||||||
uint32_t speed = report[1] * 8 / (now - last_timestamp);
|
uint32_t speed = report[1] * 8 / (now - last_timestamp);
|
||||||
accumulate_speed += speed;
|
accumulate_speed += speed;
|
||||||
statistic_count += 1;
|
statistic_count += 1;
|
||||||
printf("speed: %d kbps average speed: %lld kbps\n", speed, accumulate_speed / statistic_count );
|
printf("speed: %" PRIu32 " kbps average speed: %lld kbps\n", speed, accumulate_speed / statistic_count );
|
||||||
report[1] = 0;
|
report[1] = 0;
|
||||||
report[0] = now;
|
report[0] = now;
|
||||||
}
|
}
|
||||||
|
@ -13,4 +13,3 @@ set(srcs "ble_mesh_adapter.c"
|
|||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_ble_mesh_networking_api.h"
|
#include "esp_ble_mesh_networking_api.h"
|
||||||
#include "ble_mesh_adapter.h"
|
#include "ble_mesh_adapter.h"
|
||||||
|
|
||||||
@ -120,7 +122,7 @@ void ble_mesh_deinit_node_prestore_params(void)
|
|||||||
void ble_mesh_node_statistics_get(void)
|
void ble_mesh_node_statistics_get(void)
|
||||||
{
|
{
|
||||||
xSemaphoreTake(ble_mesh_node_sema, portMAX_DELAY);
|
xSemaphoreTake(ble_mesh_node_sema, portMAX_DELAY);
|
||||||
ESP_LOGI(TAG, "Statistics:%d\n", ble_mesh_node_statistics.package_num);
|
ESP_LOGI(TAG, "Statistics:%" PRIu32, ble_mesh_node_statistics.package_num);
|
||||||
xSemaphoreGive(ble_mesh_node_sema);
|
xSemaphoreGive(ble_mesh_node_sema);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,7 +231,7 @@ void ble_mesh_test_performance_client_model_get(void)
|
|||||||
rtt = (int)(sum_time / succeed_packet_count);
|
rtt = (int)(sum_time / succeed_packet_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGI(TAG, "VendorModel:Statistics,%d,%d\n", failed_packet_num, rtt);
|
ESP_LOGI(TAG, "VendorModel:Statistics,%" PRIu32 ",%" PRIu32, failed_packet_num, rtt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ble_mesh_test_performance_client_model_get_received_percent(void)
|
void ble_mesh_test_performance_client_model_get_received_percent(void)
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_vfs_dev.h"
|
#include "esp_vfs_dev.h"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Console example - various system commands
|
* Console example - various system commands
|
||||||
*
|
*
|
||||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -9,6 +9,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_console.h"
|
#include "esp_console.h"
|
||||||
@ -57,7 +58,7 @@ static void register_restart(void)
|
|||||||
|
|
||||||
static int free_mem(int argc, char **argv)
|
static int free_mem(int argc, char **argv)
|
||||||
{
|
{
|
||||||
printf("freeheap:%d\n", esp_get_free_heap_size());
|
printf("freeheap:%" PRIu32 "\n", esp_get_free_heap_size());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_timer.h"
|
#include "esp_timer.h"
|
||||||
#include "ble_mesh_adapter.h"
|
#include "ble_mesh_adapter.h"
|
||||||
|
|
||||||
@ -36,7 +38,7 @@ void ble_mesh_generic_onoff_client_model_cb(esp_ble_mesh_generic_client_cb_event
|
|||||||
{
|
{
|
||||||
uint32_t opcode = param->params->opcode;
|
uint32_t opcode = param->params->opcode;
|
||||||
|
|
||||||
ESP_LOGD(TAG, "enter %s: event is %d, error code is %d, opcode is 0x%x\n",
|
ESP_LOGD(TAG, "enter %s: event is %d, error code is %d, opcode is 0x%" PRIx32,
|
||||||
__func__, event, param->error_code, opcode);
|
__func__, event, param->error_code, opcode);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_bt.h"
|
#include "esp_bt.h"
|
||||||
#include "esp_timer.h"
|
#include "esp_timer.h"
|
||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
@ -197,7 +199,7 @@ void ble_mesh_generic_server_model_cb(esp_ble_mesh_generic_server_cb_event_t eve
|
|||||||
uint32_t opcode = param->ctx.recv_op;
|
uint32_t opcode = param->ctx.recv_op;
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
ESP_LOGD(TAG, "enter %s: event is %d, opcode is 0x%x\n", __func__, event, opcode);
|
ESP_LOGD(TAG, "enter %s: event is %d, opcode is 0x%04" PRIx32, __func__, event, opcode);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case ESP_BLE_MESH_GENERIC_SERVER_STATE_CHANGE_EVT:
|
case ESP_BLE_MESH_GENERIC_SERVER_STATE_CHANGE_EVT:
|
||||||
@ -280,7 +282,7 @@ void ble_mesh_prov_cb(esp_ble_mesh_prov_cb_event_t event, esp_ble_mesh_prov_cb_p
|
|||||||
ESP_LOGI(TAG, "Node:LinkClose,OK,%d", param->node_prov_link_close.bearer);
|
ESP_LOGI(TAG, "Node:LinkClose,OK,%d", param->node_prov_link_close.bearer);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_NODE_PROV_OUTPUT_NUMBER_EVT:
|
case ESP_BLE_MESH_NODE_PROV_OUTPUT_NUMBER_EVT:
|
||||||
ESP_LOGI(TAG, "Node:OutPut,%d,%d", param->node_prov_output_num.action, param->node_prov_output_num.number);
|
ESP_LOGI(TAG, "Node:OutPut,%d,%" PRIu32, param->node_prov_output_num.action, param->node_prov_output_num.number);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_NODE_PROV_OUTPUT_STRING_EVT:
|
case ESP_BLE_MESH_NODE_PROV_OUTPUT_STRING_EVT:
|
||||||
ESP_LOGI(TAG, "Node:OutPutStr,%s", param->node_prov_output_str.string);
|
ESP_LOGI(TAG, "Node:OutPutStr,%s", param->node_prov_output_str.string);
|
||||||
@ -461,7 +463,7 @@ void ble_mesh_model_cb(esp_ble_mesh_model_cb_event_t event, esp_ble_mesh_model_c
|
|||||||
ESP_LOGI(TAG, "PublishSend,OK,0x%x,%d,", param->model_publish_comp.model->model_id, param->model_publish_comp.model->pub->msg->len);
|
ESP_LOGI(TAG, "PublishSend,OK,0x%x,%d,", param->model_publish_comp.model->model_id, param->model_publish_comp.model->pub->msg->len);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT:
|
case ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT:
|
||||||
ESP_LOGI(TAG, "Node:PublishReceive,OK,0x%04X,%d,%d", param->client_recv_publish_msg.opcode, param->client_recv_publish_msg.length, param->client_recv_publish_msg.msg[1]);
|
ESP_LOGI(TAG, "Node:PublishReceive,OK,0x%04" PRIx32 ",%d,%d", param->client_recv_publish_msg.opcode, param->client_recv_publish_msg.length, param->client_recv_publish_msg.msg[1]);
|
||||||
if (trans) {
|
if (trans) {
|
||||||
uint64_t current_time = esp_timer_get_time();
|
uint64_t current_time = esp_timer_get_time();
|
||||||
outcome = ble_mesh_test_performance_client_model_accumulate_time(((uint32_t)(current_time - *start_time) / 2000), param->client_recv_publish_msg.msg,
|
outcome = ble_mesh_test_performance_client_model_accumulate_time(((uint32_t)(current_time - *start_time) / 2000), param->client_recv_publish_msg.msg,
|
||||||
@ -473,7 +475,7 @@ void ble_mesh_model_cb(esp_ble_mesh_model_cb_event_t event, esp_ble_mesh_model_c
|
|||||||
ESP_LOGI(TAG, "PublishUpdate,OK");
|
ESP_LOGI(TAG, "PublishUpdate,OK");
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT:
|
case ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT:
|
||||||
ESP_LOGI(TAG, "Node:TimeOut, 0x%04X", param->client_send_timeout.opcode);
|
ESP_LOGI(TAG, "Node:TimeOut, 0x%04" PRIx32, param->client_send_timeout.opcode);
|
||||||
if (trans) {
|
if (trans) {
|
||||||
transaction_set_events(trans, TRANS_MESH_SEND_MESSAGE_EVT);
|
transaction_set_events(trans, TRANS_MESH_SEND_MESSAGE_EVT);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
@ -29,7 +30,7 @@ static void transaction_reset(transaction_t *trans)
|
|||||||
{
|
{
|
||||||
EventBits_t bits;
|
EventBits_t bits;
|
||||||
|
|
||||||
ESP_LOGV(TAG, "transaction reset: %x", (uint32_t) trans);
|
ESP_LOGV(TAG, "transaction reset: %" PRIx32, (uint32_t)trans);
|
||||||
// set to inactive state and clear all bits of the transaction
|
// set to inactive state and clear all bits of the transaction
|
||||||
xSemaphoreTakeRecursive(trans_mutex, portMAX_DELAY);
|
xSemaphoreTakeRecursive(trans_mutex, portMAX_DELAY);
|
||||||
trans->type = 0;
|
trans->type = 0;
|
||||||
@ -64,7 +65,7 @@ esp_err_t transaction_set_events(transaction_t *trans, EventBits_t events)
|
|||||||
trans->current_bits |= events;
|
trans->current_bits |= events;
|
||||||
xEventGroupSetBits(trans->event_group, events);
|
xEventGroupSetBits(trans->event_group, events);
|
||||||
}
|
}
|
||||||
ESP_LOGD(TAG, "transactions set events: %x, %x, %x, %x; ret: %x", (uint32_t) trans, trans->type, trans->sub_type, events, ret);
|
ESP_LOGD(TAG, "transactions set events: %" PRIx32 ", %x, %" PRIx32 ", %" PRIx32 "; ret: %x", (uint32_t)trans, trans->type, trans->sub_type, events, ret);
|
||||||
} else {
|
} else {
|
||||||
ret = TRANS_RET_INVALID_TRNSACTION;
|
ret = TRANS_RET_INVALID_TRNSACTION;
|
||||||
}
|
}
|
||||||
@ -85,7 +86,7 @@ esp_err_t transaction_test_events(transaction_t *trans, EventBits_t events)
|
|||||||
ret = ESP_OK;
|
ret = ESP_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESP_LOGV(TAG, "transactions test events: %x, %x; ret: %x", (uint32_t) trans, events, ret);
|
ESP_LOGV(TAG, "transactions test events: %" PRIx32 ", %" PRIx32 "; ret: %x", (uint32_t)trans, events, ret);
|
||||||
} else {
|
} else {
|
||||||
ret = TRANS_RET_INVALID_TRNSACTION;
|
ret = TRANS_RET_INVALID_TRNSACTION;
|
||||||
}
|
}
|
||||||
@ -104,7 +105,7 @@ esp_err_t transaction_clear_events(transaction_t *trans, EventBits_t events)
|
|||||||
trans->current_bits &= ~events;
|
trans->current_bits &= ~events;
|
||||||
xEventGroupClearBits(trans->event_group, events);
|
xEventGroupClearBits(trans->event_group, events);
|
||||||
}
|
}
|
||||||
ESP_LOGD(TAG, "transactions clear events: %x, %x, %x, %x; ret: %x", (uint32_t) trans, trans->type, trans->sub_type, events, ret);
|
ESP_LOGD(TAG, "transactions clear events: %" PRIx32 ", %x, %" PRIx32 ", %" PRIx32 "; ret: %x", (uint32_t)trans, trans->type, trans->sub_type, events, ret);
|
||||||
} else {
|
} else {
|
||||||
ret = TRANS_RET_INVALID_TRNSACTION;
|
ret = TRANS_RET_INVALID_TRNSACTION;
|
||||||
}
|
}
|
||||||
@ -123,7 +124,7 @@ esp_err_t transaction_abort(transaction_t *trans, esp_err_t reason)
|
|||||||
trans->ret = reason;
|
trans->ret = reason;
|
||||||
xEventGroupSetBits(trans->event_group, TRANSACTION_ABORT_EVENT);
|
xEventGroupSetBits(trans->event_group, TRANSACTION_ABORT_EVENT);
|
||||||
}
|
}
|
||||||
ESP_LOGD(TAG, "transactions abort: %x, %x, %x, %x; ret: %x", (uint32_t) trans, trans->type, trans->sub_type, reason, ret);
|
ESP_LOGD(TAG, "transactions abort: %" PRIx32 ", %x, %" PRIx32 ", %x; ret: %x", (uint32_t)trans, trans->type, trans->sub_type, reason, ret);
|
||||||
} else {
|
} else {
|
||||||
ret = TRANS_RET_INVALID_TRNSACTION;
|
ret = TRANS_RET_INVALID_TRNSACTION;
|
||||||
}
|
}
|
||||||
@ -166,7 +167,7 @@ esp_err_t transaction_init(transaction_t **trans, uint8_t type, uint32_t sub_typ
|
|||||||
xSemaphoreGiveRecursive(trans_mutex);
|
xSemaphoreGiveRecursive(trans_mutex);
|
||||||
|
|
||||||
if (ret == ESP_OK) {
|
if (ret == ESP_OK) {
|
||||||
ESP_LOGD(TAG, "transaction created: %x, %x, %x; ret: %x", type, sub_type, (uint32_t) *trans, ret);
|
ESP_LOGD(TAG, "transaction created: %x, %" PRIx32 ", %" PRIx32 "; ret: %x", type, sub_type, (uint32_t)*trans, ret);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -186,7 +187,7 @@ esp_err_t transaction_run(transaction_t *trans)
|
|||||||
wait_time = start_time + trans->timeout - utils_get_system_ts();
|
wait_time = start_time + trans->timeout - utils_get_system_ts();
|
||||||
|
|
||||||
if ( wait_time < 0 ) {
|
if ( wait_time < 0 ) {
|
||||||
ESP_LOGI(TAG, "transaction timeout: %x, %x, %x, %x, %x", (uint32_t) trans, trans->type, trans->sub_type, trans->wait_events, trans->current_bits);
|
ESP_LOGI(TAG, "transaction timeout: %" PRIx32 ", %x, %" PRIx32 ", %" PRIx32 ", %" PRIx32, (uint32_t)trans, trans->type, trans->sub_type, trans->wait_events, trans->current_bits);
|
||||||
ret = TRANS_RET_TIMEOUT;
|
ret = TRANS_RET_TIMEOUT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -215,11 +216,11 @@ esp_err_t transaction_run(transaction_t *trans)
|
|||||||
}
|
}
|
||||||
xSemaphoreGiveRecursive(trans_mutex);
|
xSemaphoreGiveRecursive(trans_mutex);
|
||||||
}
|
}
|
||||||
ESP_LOGD(TAG, "transaction run: %x, %x, %x; ret: %x", (uint32_t) trans, trans->type, trans->sub_type, ret);
|
ESP_LOGD(TAG, "transaction run: %" PRIx32 ", %x, %" PRIx32 "; ret: %x", (uint32_t)trans, trans->type, trans->sub_type, ret);
|
||||||
// reset after it's finished
|
// reset after it's finished
|
||||||
transaction_reset(trans);
|
transaction_reset(trans);
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGD(TAG, "transaction run: %x; ret: %x", (uint32_t) trans, ret);
|
ESP_LOGD(TAG, "transaction run: %" PRIx32 "; ret: %x", (uint32_t)trans, ret);
|
||||||
ret = TRANS_RET_INVALID_TRNSACTION;
|
ret = TRANS_RET_INVALID_TRNSACTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,7 +248,7 @@ transaction_t *transaction_get(uint8_t type, uint32_t sub_type, transaction_t *s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
xSemaphoreGiveRecursive(trans_mutex);
|
xSemaphoreGiveRecursive(trans_mutex);
|
||||||
ESP_LOGV(TAG, "transaction get: %x, %x, %x, %x", type, sub_type, (uint32_t) start, (uint32_t) trans);
|
ESP_LOGV(TAG, "transaction get: %x, %" PRIx32 ", %" PRIx32 ", %" PRIx32, type, sub_type, (uint32_t) start, (uint32_t)trans);
|
||||||
return trans;
|
return trans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
idf_component_register(SRCS "main.c"
|
idf_component_register(SRCS "main.c"
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
@ -324,7 +325,7 @@ static void example_custom_model_callback(esp_ble_mesh_model_cb_event_t event,
|
|||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_INFO_STATUS:
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_INFO_STATUS:
|
||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NET_KEY_STATUS:
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NET_KEY_STATUS:
|
||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_ADDR_STATUS: {
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_ADDR_STATUS: {
|
||||||
ESP_LOGI(TAG, "%s: Fast Prov Client Model receives status, opcode 0x%04x", __func__, opcode);
|
ESP_LOGI(TAG, "%s: Fast Prov Client Model receives status, opcode 0x%04" PRIx32, __func__, opcode);
|
||||||
err = example_fast_prov_client_recv_status(param->model_operation.model,
|
err = example_fast_prov_client_recv_status(param->model_operation.model,
|
||||||
param->model_operation.ctx,
|
param->model_operation.ctx,
|
||||||
param->model_operation.length,
|
param->model_operation.length,
|
||||||
@ -336,7 +337,7 @@ static void example_custom_model_callback(esp_ble_mesh_model_cb_event_t event,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ESP_LOGI(TAG, "%s: opcode 0x%04x", __func__, param->model_operation.opcode);
|
ESP_LOGI(TAG, "%s: opcode 0x%04" PRIx32, __func__, param->model_operation.opcode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -350,11 +351,11 @@ static void example_custom_model_callback(esp_ble_mesh_model_cb_event_t event,
|
|||||||
param->model_publish_comp.err_code);
|
param->model_publish_comp.err_code);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT:
|
case ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT:
|
||||||
ESP_LOGI(TAG, "ESP_BLE_MESH_MODEL_CLIENT_RECV_PUBLISH_MSG_EVT, opcode 0x%04x",
|
ESP_LOGI(TAG, "ESP_BLE_MESH_MODEL_CLIENT_RECV_PUBLISH_MSG_EVT, opcode 0x%04" PRIx32,
|
||||||
param->client_recv_publish_msg.opcode);
|
param->client_recv_publish_msg.opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT:
|
case ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT:
|
||||||
ESP_LOGI(TAG, "ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT, opcode 0x%04x, dst 0x%04x",
|
ESP_LOGI(TAG, "ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT, opcode 0x%04" PRIx32 ", dst 0x%04x",
|
||||||
param->client_send_timeout.opcode, param->client_send_timeout.ctx->addr);
|
param->client_send_timeout.opcode, param->client_send_timeout.ctx->addr);
|
||||||
err = example_fast_prov_client_recv_timeout(param->client_send_timeout.opcode,
|
err = example_fast_prov_client_recv_timeout(param->client_send_timeout.opcode,
|
||||||
param->client_send_timeout.model,
|
param->client_send_timeout.model,
|
||||||
@ -390,7 +391,7 @@ static void example_config_client_callback(esp_ble_mesh_cfg_client_cb_event_t ev
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (param->error_code) {
|
if (param->error_code) {
|
||||||
ESP_LOGE(TAG, "Failed to send config client message, opcode: 0x%04x", opcode);
|
ESP_LOGE(TAG, "Failed to send config client message, opcode: 0x%04" PRIx32, opcode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -491,7 +492,7 @@ static void example_generic_client_callback(esp_ble_mesh_generic_client_cb_event
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (param->error_code) {
|
if (param->error_code) {
|
||||||
ESP_LOGE(TAG, "Failed to send generic client message, opcode: 0x%04x", opcode);
|
ESP_LOGE(TAG, "Failed to send generic client message, opcode: 0x%04" PRIx32, opcode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,4 +3,3 @@ set(srcs "main.c"
|
|||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
@ -21,7 +22,7 @@ struct _led_state led_state[3] = {
|
|||||||
|
|
||||||
void board_output_number(esp_ble_mesh_output_action_t action, uint32_t number)
|
void board_output_number(esp_ble_mesh_output_action_t action, uint32_t number)
|
||||||
{
|
{
|
||||||
ESP_LOGI(TAG, "Board output number %d", number);
|
ESP_LOGI(TAG, "Board output number %" PRIu32, number);
|
||||||
}
|
}
|
||||||
|
|
||||||
void board_prov_complete(void)
|
void board_prov_complete(void)
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
@ -173,7 +174,7 @@ static void example_change_led_state(uint8_t onoff)
|
|||||||
static void node_prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
static void node_prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
||||||
{
|
{
|
||||||
ESP_LOGI(TAG, "net_idx: 0x%04x, unicast_addr: 0x%04x", net_idx, addr);
|
ESP_LOGI(TAG, "net_idx: 0x%04x, unicast_addr: 0x%04x", net_idx, addr);
|
||||||
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08x", flags, iv_index);
|
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08" PRIx32, flags, iv_index);
|
||||||
board_prov_complete();
|
board_prov_complete();
|
||||||
/* Updates the net_idx used by Fast Prov Server model, and it can also
|
/* Updates the net_idx used by Fast Prov Server model, and it can also
|
||||||
* be updated if the Fast Prov Info Set message contains a valid one.
|
* be updated if the Fast Prov Info Set message contains a valid one.
|
||||||
@ -449,7 +450,7 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_ADDR_GET:
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_ADDR_GET:
|
||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_GROUP_ADD:
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_GROUP_ADD:
|
||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_GROUP_DELETE: {
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_GROUP_DELETE: {
|
||||||
ESP_LOGI(TAG, "%s: Fast prov server receives msg, opcode 0x%04x", __func__, opcode);
|
ESP_LOGI(TAG, "%s: Fast prov server receives msg, opcode 0x%04" PRIx32, __func__, opcode);
|
||||||
struct net_buf_simple buf = {
|
struct net_buf_simple buf = {
|
||||||
.len = param->model_operation.length,
|
.len = param->model_operation.length,
|
||||||
.data = param->model_operation.msg,
|
.data = param->model_operation.msg,
|
||||||
@ -465,7 +466,7 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_INFO_STATUS:
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_INFO_STATUS:
|
||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NET_KEY_STATUS:
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NET_KEY_STATUS:
|
||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_ADDR_ACK: {
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_ADDR_ACK: {
|
||||||
ESP_LOGI(TAG, "%s: Fast prov client receives msg, opcode 0x%04x", __func__, opcode);
|
ESP_LOGI(TAG, "%s: Fast prov client receives msg, opcode 0x%04" PRIx32, __func__, opcode);
|
||||||
err = example_fast_prov_client_recv_status(param->model_operation.model,
|
err = example_fast_prov_client_recv_status(param->model_operation.model,
|
||||||
param->model_operation.ctx,
|
param->model_operation.ctx,
|
||||||
param->model_operation.length,
|
param->model_operation.length,
|
||||||
@ -477,7 +478,7 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ESP_LOGI(TAG, "%s: opcode 0x%04x", __func__, param->model_operation.opcode);
|
ESP_LOGI(TAG, "%s: opcode 0x%04" PRIx32, __func__, param->model_operation.opcode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -507,11 +508,11 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
param->model_publish_comp.err_code);
|
param->model_publish_comp.err_code);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT:
|
case ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT:
|
||||||
ESP_LOGI(TAG, "ESP_BLE_MESH_MODEL_CLIENT_RECV_PUBLISH_MSG_EVT, opcode 0x%04x",
|
ESP_LOGI(TAG, "ESP_BLE_MESH_MODEL_CLIENT_RECV_PUBLISH_MSG_EVT, opcode 0x%04" PRIx32,
|
||||||
param->client_recv_publish_msg.opcode);
|
param->client_recv_publish_msg.opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT:
|
case ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT:
|
||||||
ESP_LOGI(TAG, "ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT, opcode 0x%04x, dst 0x%04x",
|
ESP_LOGI(TAG, "ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT, opcode 0x%04" PRIx32 ", dst 0x%04x",
|
||||||
param->client_send_timeout.opcode, param->client_send_timeout.ctx->addr);
|
param->client_send_timeout.opcode, param->client_send_timeout.ctx->addr);
|
||||||
err = example_fast_prov_client_recv_timeout(param->client_send_timeout.opcode,
|
err = example_fast_prov_client_recv_timeout(param->client_send_timeout.opcode,
|
||||||
param->client_send_timeout.model,
|
param->client_send_timeout.model,
|
||||||
@ -547,7 +548,7 @@ static void example_ble_mesh_config_client_cb(esp_ble_mesh_cfg_client_cb_event_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (param->error_code) {
|
if (param->error_code) {
|
||||||
ESP_LOGE(TAG, "Failed to send config client message, opcode: 0x%04x", opcode);
|
ESP_LOGE(TAG, "Failed to send config client message, opcode: 0x%04" PRIx32, opcode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -651,7 +652,7 @@ static void example_ble_mesh_config_server_cb(esp_ble_mesh_cfg_server_cb_event_t
|
|||||||
{
|
{
|
||||||
esp_err_t err;
|
esp_err_t err;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "%s, event = 0x%02x, opcode = 0x%04x, addr: 0x%04x",
|
ESP_LOGI(TAG, "%s, event = 0x%02x, opcode = 0x%04" PRIx32 ", addr: 0x%04x",
|
||||||
__func__, event, param->ctx.recv_op, param->ctx.addr);
|
__func__, event, param->ctx.recv_op, param->ctx.addr);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
@ -678,7 +679,7 @@ static void example_ble_mesh_config_server_cb(esp_ble_mesh_cfg_server_cb_event_t
|
|||||||
static void example_ble_mesh_generic_server_cb(esp_ble_mesh_generic_server_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_generic_server_cb_param_t *param)
|
||||||
{
|
{
|
||||||
ESP_LOGI(TAG, "event 0x%02x, opcode 0x%04x, src 0x%04x, dst 0x%04x",
|
ESP_LOGI(TAG, "event 0x%02x, opcode 0x%04" PRIx32 ", src 0x%04x, dst 0x%04x",
|
||||||
event, param->ctx.recv_op, param->ctx.addr, param->ctx.recv_dst);
|
event, param->ctx.recv_op, param->ctx.addr, param->ctx.recv_dst);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
@ -3,4 +3,3 @@ set(srcs "main.c"
|
|||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
@ -120,7 +121,7 @@ static void mesh_example_info_restore(void)
|
|||||||
static void prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
static void prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
||||||
{
|
{
|
||||||
ESP_LOGI(TAG, "net_idx: 0x%04x, addr: 0x%04x", net_idx, addr);
|
ESP_LOGI(TAG, "net_idx: 0x%04x, addr: 0x%04x", net_idx, addr);
|
||||||
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08x", flags, iv_index);
|
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08" PRIx32, flags, iv_index);
|
||||||
board_led_operation(LED_G, LED_OFF);
|
board_led_operation(LED_G, LED_OFF);
|
||||||
store.net_idx = net_idx;
|
store.net_idx = net_idx;
|
||||||
/* mesh_example_info_store() shall not be invoked here, because if the device
|
/* mesh_example_info_store() shall not be invoked here, because if the device
|
||||||
@ -201,7 +202,7 @@ void example_ble_mesh_send_gen_onoff_set(void)
|
|||||||
static void example_ble_mesh_generic_client_cb(esp_ble_mesh_generic_client_cb_event_t event,
|
static void example_ble_mesh_generic_client_cb(esp_ble_mesh_generic_client_cb_event_t event,
|
||||||
esp_ble_mesh_generic_client_cb_param_t *param)
|
esp_ble_mesh_generic_client_cb_param_t *param)
|
||||||
{
|
{
|
||||||
ESP_LOGI(TAG, "Generic client, event %u, error code %d, opcode is 0x%04x",
|
ESP_LOGI(TAG, "Generic client, event %u, error code %d, opcode is 0x%04" PRIx32,
|
||||||
event, param->error_code, param->params->opcode);
|
event, param->error_code, param->params->opcode);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
@ -3,4 +3,3 @@ set(srcs "main.c"
|
|||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
@ -111,7 +112,7 @@ static esp_ble_mesh_prov_t provision = {
|
|||||||
static void prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
static void prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
||||||
{
|
{
|
||||||
ESP_LOGI(TAG, "net_idx: 0x%04x, addr: 0x%04x", net_idx, addr);
|
ESP_LOGI(TAG, "net_idx: 0x%04x, addr: 0x%04x", net_idx, addr);
|
||||||
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08x", flags, iv_index);
|
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08" PRIx32, flags, iv_index);
|
||||||
board_led_operation(LED_G, LED_OFF);
|
board_led_operation(LED_G, LED_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,7 +212,7 @@ static void example_ble_mesh_generic_server_cb(esp_ble_mesh_generic_server_cb_ev
|
|||||||
esp_ble_mesh_generic_server_cb_param_t *param)
|
esp_ble_mesh_generic_server_cb_param_t *param)
|
||||||
{
|
{
|
||||||
esp_ble_mesh_gen_onoff_srv_t *srv;
|
esp_ble_mesh_gen_onoff_srv_t *srv;
|
||||||
ESP_LOGI(TAG, "event 0x%02x, opcode 0x%04x, src 0x%04x, dst 0x%04x",
|
ESP_LOGI(TAG, "event 0x%02x, opcode 0x%04" PRIx32 ", src 0x%04x, dst 0x%04x",
|
||||||
event, param->ctx.recv_op, param->ctx.addr, param->ctx.recv_dst);
|
event, param->ctx.recv_op, param->ctx.addr, param->ctx.recv_dst);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
@ -2,4 +2,3 @@ set(srcs "main.c")
|
|||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
@ -355,11 +356,11 @@ static void example_ble_mesh_config_client_cb(esp_ble_mesh_cfg_client_cb_event_t
|
|||||||
opcode = param->params->opcode;
|
opcode = param->params->opcode;
|
||||||
addr = param->params->ctx.addr;
|
addr = param->params->ctx.addr;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "%s, error_code = 0x%02x, event = 0x%02x, addr: 0x%04x, opcode: 0x%04x",
|
ESP_LOGI(TAG, "%s, error_code = 0x%02x, event = 0x%02x, addr: 0x%04x, opcode: 0x%04" PRIx32,
|
||||||
__func__, param->error_code, event, param->params->ctx.addr, opcode);
|
__func__, param->error_code, event, param->params->ctx.addr, opcode);
|
||||||
|
|
||||||
if (param->error_code) {
|
if (param->error_code) {
|
||||||
ESP_LOGE(TAG, "Send config client message failed, opcode 0x%04x", opcode);
|
ESP_LOGE(TAG, "Send config client message failed, opcode 0x%04" PRIx32, opcode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -495,11 +496,11 @@ static void example_ble_mesh_generic_client_cb(esp_ble_mesh_generic_client_cb_ev
|
|||||||
opcode = param->params->opcode;
|
opcode = param->params->opcode;
|
||||||
addr = param->params->ctx.addr;
|
addr = param->params->ctx.addr;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "%s, error_code = 0x%02x, event = 0x%02x, addr: 0x%04x, opcode: 0x%04x",
|
ESP_LOGI(TAG, "%s, error_code = 0x%02x, event = 0x%02x, addr: 0x%04x, opcode: 0x%04" PRIx32,
|
||||||
__func__, param->error_code, event, param->params->ctx.addr, opcode);
|
__func__, param->error_code, event, param->params->ctx.addr, opcode);
|
||||||
|
|
||||||
if (param->error_code) {
|
if (param->error_code) {
|
||||||
ESP_LOGE(TAG, "Send generic client message failed, opcode 0x%04x", opcode);
|
ESP_LOGE(TAG, "Send generic client message failed, opcode 0x%04" PRIx32, opcode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,4 +3,3 @@ set(srcs "main.c"
|
|||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
@ -291,7 +292,7 @@ static void example_ble_mesh_config_client_cb(esp_ble_mesh_cfg_client_cb_event_t
|
|||||||
esp_ble_mesh_node_t *node = NULL;
|
esp_ble_mesh_node_t *node = NULL;
|
||||||
esp_err_t err = ESP_OK;
|
esp_err_t err = ESP_OK;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Config client, event %u, addr 0x%04x, opcode 0x%04x",
|
ESP_LOGI(TAG, "Config client, event %u, addr 0x%04x, opcode 0x%04" PRIx32,
|
||||||
event, param->params->ctx.addr, param->params->opcode);
|
event, param->params->ctx.addr, param->params->opcode);
|
||||||
|
|
||||||
if (param->error_code) {
|
if (param->error_code) {
|
||||||
@ -444,7 +445,7 @@ void example_ble_mesh_send_sensor_message(uint32_t opcode)
|
|||||||
|
|
||||||
err = esp_ble_mesh_sensor_client_get_state(&common, &get);
|
err = esp_ble_mesh_sensor_client_get_state(&common, &get);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "Failed to send sensor message 0x%04x", opcode);
|
ESP_LOGE(TAG, "Failed to send sensor message 0x%04" PRIx32, opcode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -452,34 +453,34 @@ static void example_ble_mesh_sensor_timeout(uint32_t opcode)
|
|||||||
{
|
{
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_DESCRIPTOR_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_DESCRIPTOR_GET:
|
||||||
ESP_LOGW(TAG, "Sensor Descriptor Get timeout, opcode 0x%04x", opcode);
|
ESP_LOGW(TAG, "Sensor Descriptor Get timeout, opcode 0x%04" PRIx32, opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_GET:
|
||||||
ESP_LOGW(TAG, "Sensor Cadence Get timeout, opcode 0x%04x", opcode);
|
ESP_LOGW(TAG, "Sensor Cadence Get timeout, opcode 0x%04" PRIx32, opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_SET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_SET:
|
||||||
ESP_LOGW(TAG, "Sensor Cadence Set timeout, opcode 0x%04x", opcode);
|
ESP_LOGW(TAG, "Sensor Cadence Set timeout, opcode 0x%04" PRIx32, opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTINGS_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTINGS_GET:
|
||||||
ESP_LOGW(TAG, "Sensor Settings Get timeout, opcode 0x%04x", opcode);
|
ESP_LOGW(TAG, "Sensor Settings Get timeout, opcode 0x%04" PRIx32, opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_GET:
|
||||||
ESP_LOGW(TAG, "Sensor Setting Get timeout, opcode 0x%04x", opcode);
|
ESP_LOGW(TAG, "Sensor Setting Get timeout, opcode 0x%04" PRIx32, opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_SET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_SET:
|
||||||
ESP_LOGW(TAG, "Sensor Setting Set timeout, opcode 0x%04x", opcode);
|
ESP_LOGW(TAG, "Sensor Setting Set timeout, opcode 0x%04" PRIx32, opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_GET:
|
||||||
ESP_LOGW(TAG, "Sensor Get timeout 0x%04x", opcode);
|
ESP_LOGW(TAG, "Sensor Get timeout, 0x%04" PRIx32, opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_COLUMN_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_COLUMN_GET:
|
||||||
ESP_LOGW(TAG, "Sensor Column Get timeout, opcode 0x%04x", opcode);
|
ESP_LOGW(TAG, "Sensor Column Get timeout, opcode 0x%04" PRIx32, opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_SERIES_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_SERIES_GET:
|
||||||
ESP_LOGW(TAG, "Sensor Series Get timeout, opcode 0x%04x", opcode);
|
ESP_LOGW(TAG, "Sensor Series Get timeout, opcode 0x%04" PRIx32, opcode);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGE(TAG, "Unknown Sensor Get/Set opcode 0x%04x", opcode);
|
ESP_LOGE(TAG, "Unknown Sensor Get/Set opcode 0x%04" PRIx32, opcode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,7 +509,7 @@ static void example_ble_mesh_sensor_client_cb(esp_ble_mesh_sensor_client_cb_even
|
|||||||
case ESP_BLE_MESH_SENSOR_CLIENT_GET_STATE_EVT:
|
case ESP_BLE_MESH_SENSOR_CLIENT_GET_STATE_EVT:
|
||||||
switch (param->params->opcode) {
|
switch (param->params->opcode) {
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_DESCRIPTOR_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_DESCRIPTOR_GET:
|
||||||
ESP_LOGI(TAG, "Sensor Descriptor Status, opcode 0x%04x", param->params->ctx.recv_op);
|
ESP_LOGI(TAG, "Sensor Descriptor Status, opcode 0x%04" PRIx32, param->params->ctx.recv_op);
|
||||||
if (param->status_cb.descriptor_status.descriptor->len != ESP_BLE_MESH_SENSOR_SETTING_PROPERTY_ID_LEN &&
|
if (param->status_cb.descriptor_status.descriptor->len != ESP_BLE_MESH_SENSOR_SETTING_PROPERTY_ID_LEN &&
|
||||||
param->status_cb.descriptor_status.descriptor->len % ESP_BLE_MESH_SENSOR_DESCRIPTOR_LEN) {
|
param->status_cb.descriptor_status.descriptor->len % ESP_BLE_MESH_SENSOR_DESCRIPTOR_LEN) {
|
||||||
ESP_LOGE(TAG, "Invalid Sensor Descriptor Status length %d", param->status_cb.descriptor_status.descriptor->len);
|
ESP_LOGE(TAG, "Invalid Sensor Descriptor Status length %d", param->status_cb.descriptor_status.descriptor->len);
|
||||||
@ -525,19 +526,19 @@ static void example_ble_mesh_sensor_client_cb(esp_ble_mesh_sensor_client_cb_even
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_GET:
|
||||||
ESP_LOGI(TAG, "Sensor Cadence Status, opcode 0x%04x, Sensor Property ID 0x%04x",
|
ESP_LOGI(TAG, "Sensor Cadence Status, opcode 0x%04" PRIx32 ", Sensor Property ID 0x%04x",
|
||||||
param->params->ctx.recv_op, param->status_cb.cadence_status.property_id);
|
param->params->ctx.recv_op, param->status_cb.cadence_status.property_id);
|
||||||
ESP_LOG_BUFFER_HEX("Sensor Cadence", param->status_cb.cadence_status.sensor_cadence_value->data,
|
ESP_LOG_BUFFER_HEX("Sensor Cadence", param->status_cb.cadence_status.sensor_cadence_value->data,
|
||||||
param->status_cb.cadence_status.sensor_cadence_value->len);
|
param->status_cb.cadence_status.sensor_cadence_value->len);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTINGS_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTINGS_GET:
|
||||||
ESP_LOGI(TAG, "Sensor Settings Status, opcode 0x%04x, Sensor Property ID 0x%04x",
|
ESP_LOGI(TAG, "Sensor Settings Status, opcode 0x%04" PRIx32 ", Sensor Property ID 0x%04x",
|
||||||
param->params->ctx.recv_op, param->status_cb.settings_status.sensor_property_id);
|
param->params->ctx.recv_op, param->status_cb.settings_status.sensor_property_id);
|
||||||
ESP_LOG_BUFFER_HEX("Sensor Settings", param->status_cb.settings_status.sensor_setting_property_ids->data,
|
ESP_LOG_BUFFER_HEX("Sensor Settings", param->status_cb.settings_status.sensor_setting_property_ids->data,
|
||||||
param->status_cb.settings_status.sensor_setting_property_ids->len);
|
param->status_cb.settings_status.sensor_setting_property_ids->len);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_GET:
|
||||||
ESP_LOGI(TAG, "Sensor Setting Status, opcode 0x%04x, Sensor Property ID 0x%04x, Sensor Setting Property ID 0x%04x",
|
ESP_LOGI(TAG, "Sensor Setting Status, opcode 0x%04" PRIx32 ", Sensor Property ID 0x%04x, Sensor Setting Property ID 0x%04x",
|
||||||
param->params->ctx.recv_op, param->status_cb.setting_status.sensor_property_id,
|
param->params->ctx.recv_op, param->status_cb.setting_status.sensor_property_id,
|
||||||
param->status_cb.setting_status.sensor_setting_property_id);
|
param->status_cb.setting_status.sensor_setting_property_id);
|
||||||
if (param->status_cb.setting_status.op_en) {
|
if (param->status_cb.setting_status.op_en) {
|
||||||
@ -547,7 +548,7 @@ static void example_ble_mesh_sensor_client_cb(esp_ble_mesh_sensor_client_cb_even
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_GET:
|
||||||
ESP_LOGI(TAG, "Sensor Status, opcode 0x%04x", param->params->ctx.recv_op);
|
ESP_LOGI(TAG, "Sensor Status, opcode 0x%04" PRIx32, param->params->ctx.recv_op);
|
||||||
if (param->status_cb.sensor_status.marshalled_sensor_data->len) {
|
if (param->status_cb.sensor_status.marshalled_sensor_data->len) {
|
||||||
ESP_LOG_BUFFER_HEX("Sensor Data", param->status_cb.sensor_status.marshalled_sensor_data->data,
|
ESP_LOG_BUFFER_HEX("Sensor Data", param->status_cb.sensor_status.marshalled_sensor_data->data,
|
||||||
param->status_cb.sensor_status.marshalled_sensor_data->len);
|
param->status_cb.sensor_status.marshalled_sensor_data->len);
|
||||||
@ -573,32 +574,32 @@ static void example_ble_mesh_sensor_client_cb(esp_ble_mesh_sensor_client_cb_even
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_COLUMN_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_COLUMN_GET:
|
||||||
ESP_LOGI(TAG, "Sensor Column Status, opcode 0x%04x, Sensor Property ID 0x%04x",
|
ESP_LOGI(TAG, "Sensor Column Status, opcode 0x%04" PRIx32 ", Sensor Property ID 0x%04x",
|
||||||
param->params->ctx.recv_op, param->status_cb.column_status.property_id);
|
param->params->ctx.recv_op, param->status_cb.column_status.property_id);
|
||||||
ESP_LOG_BUFFER_HEX("Sensor Column", param->status_cb.column_status.sensor_column_value->data,
|
ESP_LOG_BUFFER_HEX("Sensor Column", param->status_cb.column_status.sensor_column_value->data,
|
||||||
param->status_cb.column_status.sensor_column_value->len);
|
param->status_cb.column_status.sensor_column_value->len);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_SERIES_GET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_SERIES_GET:
|
||||||
ESP_LOGI(TAG, "Sensor Series Status, opcode 0x%04x, Sensor Property ID 0x%04x",
|
ESP_LOGI(TAG, "Sensor Series Status, opcode 0x%04" PRIx32 ", Sensor Property ID 0x%04x",
|
||||||
param->params->ctx.recv_op, param->status_cb.series_status.property_id);
|
param->params->ctx.recv_op, param->status_cb.series_status.property_id);
|
||||||
ESP_LOG_BUFFER_HEX("Sensor Series", param->status_cb.series_status.sensor_series_value->data,
|
ESP_LOG_BUFFER_HEX("Sensor Series", param->status_cb.series_status.sensor_series_value->data,
|
||||||
param->status_cb.series_status.sensor_series_value->len);
|
param->status_cb.series_status.sensor_series_value->len);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGE(TAG, "Unknown Sensor Get opcode 0x%04x", param->params->ctx.recv_op);
|
ESP_LOGE(TAG, "Unknown Sensor Get opcode 0x%04" PRIx32, param->params->ctx.recv_op);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_SENSOR_CLIENT_SET_STATE_EVT:
|
case ESP_BLE_MESH_SENSOR_CLIENT_SET_STATE_EVT:
|
||||||
switch (param->params->opcode) {
|
switch (param->params->opcode) {
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_SET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_SET:
|
||||||
ESP_LOGI(TAG, "Sensor Cadence Status, opcode 0x%04x, Sensor Property ID 0x%04x",
|
ESP_LOGI(TAG, "Sensor Cadence Status, opcode 0x%04" PRIx32 ", Sensor Property ID 0x%04x",
|
||||||
param->params->ctx.recv_op, param->status_cb.cadence_status.property_id);
|
param->params->ctx.recv_op, param->status_cb.cadence_status.property_id);
|
||||||
ESP_LOG_BUFFER_HEX("Sensor Cadence", param->status_cb.cadence_status.sensor_cadence_value->data,
|
ESP_LOG_BUFFER_HEX("Sensor Cadence", param->status_cb.cadence_status.sensor_cadence_value->data,
|
||||||
param->status_cb.cadence_status.sensor_cadence_value->len);
|
param->status_cb.cadence_status.sensor_cadence_value->len);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_SET:
|
case ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_SET:
|
||||||
ESP_LOGI(TAG, "Sensor Setting Status, opcode 0x%04x, Sensor Property ID 0x%04x, Sensor Setting Property ID 0x%04x",
|
ESP_LOGI(TAG, "Sensor Setting Status, opcode 0x%04" PRIx32 ", Sensor Property ID 0x%04x, Sensor Setting Property ID 0x%04x",
|
||||||
param->params->ctx.recv_op, param->status_cb.setting_status.sensor_property_id,
|
param->params->ctx.recv_op, param->status_cb.setting_status.sensor_property_id,
|
||||||
param->status_cb.setting_status.sensor_setting_property_id);
|
param->status_cb.setting_status.sensor_setting_property_id);
|
||||||
if (param->status_cb.setting_status.op_en) {
|
if (param->status_cb.setting_status.op_en) {
|
||||||
@ -608,7 +609,7 @@ static void example_ble_mesh_sensor_client_cb(esp_ble_mesh_sensor_client_cb_even
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGE(TAG, "Unknown Sensor Set opcode 0x%04x", param->params->ctx.recv_op);
|
ESP_LOGE(TAG, "Unknown Sensor Set opcode 0x%04" PRIx32, param->params->ctx.recv_op);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3,4 +3,3 @@ set(srcs "main.c"
|
|||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
@ -150,7 +151,7 @@ static esp_ble_mesh_prov_t provision = {
|
|||||||
static void prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
static void prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
||||||
{
|
{
|
||||||
ESP_LOGI(TAG, "net_idx 0x%03x, addr 0x%04x", net_idx, addr);
|
ESP_LOGI(TAG, "net_idx 0x%03x, addr 0x%04x", net_idx, addr);
|
||||||
ESP_LOGI(TAG, "flags 0x%02x, iv_index 0x%08x", flags, iv_index);
|
ESP_LOGI(TAG, "flags 0x%02x, iv_index 0x%08" PRIx32, flags, iv_index);
|
||||||
board_led_operation(LED_G, LED_OFF);
|
board_led_operation(LED_G, LED_OFF);
|
||||||
|
|
||||||
/* Initialize the indoor and outdoor temperatures for each sensor. */
|
/* Initialize the indoor and outdoor temperatures for each sensor. */
|
||||||
@ -553,7 +554,7 @@ static void example_ble_mesh_sensor_server_cb(esp_ble_mesh_sensor_server_cb_even
|
|||||||
example_ble_mesh_send_sensor_series_status(param);
|
example_ble_mesh_send_sensor_series_status(param);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGE(TAG, "Unknown Sensor Get opcode 0x%04x", param->ctx.recv_op);
|
ESP_LOGE(TAG, "Unknown Sensor Get opcode 0x%04" PRIx32, param->ctx.recv_op);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -574,7 +575,7 @@ static void example_ble_mesh_sensor_server_cb(esp_ble_mesh_sensor_server_cb_even
|
|||||||
ESP_LOGI(TAG, "ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_SET_UNACK");
|
ESP_LOGI(TAG, "ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_SET_UNACK");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGE(TAG, "Unknown Sensor Set opcode 0x%04x", param->ctx.recv_op);
|
ESP_LOGE(TAG, "Unknown Sensor Set opcode 0x%04" PRIx32, param->ctx.recv_op);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3,4 +3,3 @@ set(srcs "main.c"
|
|||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
@ -346,11 +347,11 @@ static void example_ble_mesh_config_client_cb(esp_ble_mesh_cfg_client_cb_event_t
|
|||||||
esp_ble_mesh_node_t *node = NULL;
|
esp_ble_mesh_node_t *node = NULL;
|
||||||
esp_err_t err;
|
esp_err_t err;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Config client, err_code %d, event %u, addr 0x%04x, opcode 0x%04x",
|
ESP_LOGI(TAG, "Config client, err_code %d, event %u, addr 0x%04x, opcode 0x%04" PRIx32,
|
||||||
param->error_code, event, param->params->ctx.addr, param->params->opcode);
|
param->error_code, event, param->params->ctx.addr, param->params->opcode);
|
||||||
|
|
||||||
if (param->error_code) {
|
if (param->error_code) {
|
||||||
ESP_LOGE(TAG, "Send config client message failed, opcode 0x%04x", param->params->opcode);
|
ESP_LOGE(TAG, "Send config client message failed, opcode 0x%04" PRIx32, param->params->opcode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -469,7 +470,7 @@ void example_ble_mesh_send_vendor_message(bool resend)
|
|||||||
err = esp_ble_mesh_client_model_send_msg(vendor_client.model, &ctx, opcode,
|
err = esp_ble_mesh_client_model_send_msg(vendor_client.model, &ctx, opcode,
|
||||||
sizeof(store.vnd_tid), (uint8_t *)&store.vnd_tid, MSG_TIMEOUT, true, MSG_ROLE);
|
sizeof(store.vnd_tid), (uint8_t *)&store.vnd_tid, MSG_TIMEOUT, true, MSG_ROLE);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "Failed to send vendor message 0x%06x", opcode);
|
ESP_LOGE(TAG, "Failed to send vendor message 0x%06" PRIx32, opcode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,23 +486,23 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
case ESP_BLE_MESH_MODEL_OPERATION_EVT:
|
case ESP_BLE_MESH_MODEL_OPERATION_EVT:
|
||||||
if (param->model_operation.opcode == ESP_BLE_MESH_VND_MODEL_OP_STATUS) {
|
if (param->model_operation.opcode == ESP_BLE_MESH_VND_MODEL_OP_STATUS) {
|
||||||
int64_t end_time = esp_timer_get_time();
|
int64_t end_time = esp_timer_get_time();
|
||||||
ESP_LOGI(TAG, "Recv 0x%06x, tid 0x%04x, time %lldus",
|
ESP_LOGI(TAG, "Recv 0x06%" PRIx32 ", tid 0x%04x, time %lldus",
|
||||||
param->model_operation.opcode, store.vnd_tid, end_time - start_time);
|
param->model_operation.opcode, store.vnd_tid, end_time - start_time);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_SEND_COMP_EVT:
|
case ESP_BLE_MESH_MODEL_SEND_COMP_EVT:
|
||||||
if (param->model_send_comp.err_code) {
|
if (param->model_send_comp.err_code) {
|
||||||
ESP_LOGE(TAG, "Failed to send message 0x%06x", param->model_send_comp.opcode);
|
ESP_LOGE(TAG, "Failed to send message 0x%06" PRIx32, param->model_send_comp.opcode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
start_time = esp_timer_get_time();
|
start_time = esp_timer_get_time();
|
||||||
ESP_LOGI(TAG, "Send 0x%06x", param->model_send_comp.opcode);
|
ESP_LOGI(TAG, "Send 0x%06" PRIx32, param->model_send_comp.opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT:
|
case ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT:
|
||||||
ESP_LOGI(TAG, "Receive publish message 0x%06x", param->client_recv_publish_msg.opcode);
|
ESP_LOGI(TAG, "Receive publish message 0x%06" PRIx32, param->client_recv_publish_msg.opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT:
|
case ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT:
|
||||||
ESP_LOGW(TAG, "Client message 0x%06x timeout", param->client_send_timeout.opcode);
|
ESP_LOGW(TAG, "Client message 0x%06" PRIx32 " timeout", param->client_send_timeout.opcode);
|
||||||
example_ble_mesh_send_vendor_message(true);
|
example_ble_mesh_send_vendor_message(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -3,4 +3,3 @@ set(srcs "main.c"
|
|||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
@ -86,7 +87,7 @@ static esp_ble_mesh_prov_t provision = {
|
|||||||
static void prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
static void prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
||||||
{
|
{
|
||||||
ESP_LOGI(TAG, "net_idx 0x%03x, addr 0x%04x", net_idx, addr);
|
ESP_LOGI(TAG, "net_idx 0x%03x, addr 0x%04x", net_idx, addr);
|
||||||
ESP_LOGI(TAG, "flags 0x%02x, iv_index 0x%08x", flags, iv_index);
|
ESP_LOGI(TAG, "flags 0x%02x, iv_index 0x%08" PRIx32, flags, iv_index);
|
||||||
board_led_operation(LED_G, LED_OFF);
|
board_led_operation(LED_G, LED_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +158,7 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
case ESP_BLE_MESH_MODEL_OPERATION_EVT:
|
case ESP_BLE_MESH_MODEL_OPERATION_EVT:
|
||||||
if (param->model_operation.opcode == ESP_BLE_MESH_VND_MODEL_OP_SEND) {
|
if (param->model_operation.opcode == ESP_BLE_MESH_VND_MODEL_OP_SEND) {
|
||||||
uint16_t tid = *(uint16_t *)param->model_operation.msg;
|
uint16_t tid = *(uint16_t *)param->model_operation.msg;
|
||||||
ESP_LOGI(TAG, "Recv 0x%06x, tid 0x%04x", param->model_operation.opcode, tid);
|
ESP_LOGI(TAG, "Recv 0x%06" PRIx32 ", tid 0x%04x", param->model_operation.opcode, tid);
|
||||||
esp_err_t err = esp_ble_mesh_server_model_send_msg(&vnd_models[0],
|
esp_err_t err = esp_ble_mesh_server_model_send_msg(&vnd_models[0],
|
||||||
param->model_operation.ctx, ESP_BLE_MESH_VND_MODEL_OP_STATUS,
|
param->model_operation.ctx, ESP_BLE_MESH_VND_MODEL_OP_STATUS,
|
||||||
sizeof(tid), (uint8_t *)&tid);
|
sizeof(tid), (uint8_t *)&tid);
|
||||||
@ -168,10 +169,10 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_MODEL_SEND_COMP_EVT:
|
case ESP_BLE_MESH_MODEL_SEND_COMP_EVT:
|
||||||
if (param->model_send_comp.err_code) {
|
if (param->model_send_comp.err_code) {
|
||||||
ESP_LOGE(TAG, "Failed to send message 0x%06x", param->model_send_comp.opcode);
|
ESP_LOGE(TAG, "Failed to send message 0x%06" PRIx32, param->model_send_comp.opcode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ESP_LOGI(TAG, "Send 0x%06x", param->model_send_comp.opcode);
|
ESP_LOGI(TAG, "Send 0x%06" PRIx32, param->model_send_comp.opcode);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -4,4 +4,3 @@ set(srcs "main.c"
|
|||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
@ -21,7 +22,7 @@ struct _led_state led_state[3] = {
|
|||||||
|
|
||||||
void board_output_number(esp_ble_mesh_output_action_t action, uint32_t number)
|
void board_output_number(esp_ble_mesh_output_action_t action, uint32_t number)
|
||||||
{
|
{
|
||||||
ESP_LOGI(TAG, "Board output number %d", number);
|
ESP_LOGI(TAG, "Board output number %" PRIu32, number);
|
||||||
}
|
}
|
||||||
|
|
||||||
void board_prov_complete(void)
|
void board_prov_complete(void)
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_console.h"
|
#include "esp_console.h"
|
||||||
#include "argtable3/argtable3.h"
|
#include "argtable3/argtable3.h"
|
||||||
@ -393,7 +395,8 @@ static int wifi_cmd_iperf(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGI(TAG, "mode=%s-%s sip=%d.%d.%d.%d:%d, dip=%d.%d.%d.%d:%d, interval=%d, time=%d",
|
ESP_LOGI(TAG, "mode=%s-%s sip=%" PRIu32 ".%" PRIu32 ".%" PRIu32 ".%" PRIu32 ":%d, \
|
||||||
|
dip=%" PRIu32 ".%" PRIu32 ".%" PRIu32 ".%" PRIu32 ":%d, interval=%" PRIu32 ", time=%" PRIu32,
|
||||||
cfg.flag & IPERF_FLAG_TCP ? "tcp" : "udp",
|
cfg.flag & IPERF_FLAG_TCP ? "tcp" : "udp",
|
||||||
cfg.flag & IPERF_FLAG_SERVER ? "server" : "client",
|
cfg.flag & IPERF_FLAG_SERVER ? "server" : "client",
|
||||||
cfg.source_ip4 & 0xFF, (cfg.source_ip4 >> 8) & 0xFF, (cfg.source_ip4 >> 16) & 0xFF,
|
cfg.source_ip4 & 0xFF, (cfg.source_ip4 >> 8) & 0xFF, (cfg.source_ip4 >> 16) & 0xFF,
|
||||||
@ -416,7 +419,7 @@ static int restart(int argc, char **argv)
|
|||||||
static int heap_size(int argc, char **argv)
|
static int heap_size(int argc, char **argv)
|
||||||
{
|
{
|
||||||
uint32_t heap_size = heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT);
|
uint32_t heap_size = heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT);
|
||||||
ESP_LOGI(TAG, "min heap size: %u", heap_size);
|
ESP_LOGI(TAG, "min heap size: %" PRIu32, heap_size);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "esp_wifi.h"
|
#include "esp_wifi.h"
|
||||||
@ -184,7 +186,7 @@ static void example_change_led_state(uint8_t onoff)
|
|||||||
static void node_prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
static void node_prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
|
||||||
{
|
{
|
||||||
ESP_LOGI(TAG, "net_idx: 0x%04x, unicast_addr: 0x%04x", net_idx, addr);
|
ESP_LOGI(TAG, "net_idx: 0x%04x, unicast_addr: 0x%04x", net_idx, addr);
|
||||||
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08x", flags, iv_index);
|
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08" PRIx32, flags, iv_index);
|
||||||
board_prov_complete();
|
board_prov_complete();
|
||||||
/* Updates the net_idx used by Fast Prov Server model, and it can also
|
/* Updates the net_idx used by Fast Prov Server model, and it can also
|
||||||
* be updated if the Fast Prov Info Set message contains a valid one.
|
* be updated if the Fast Prov Info Set message contains a valid one.
|
||||||
@ -460,7 +462,7 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_ADDR_GET:
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_ADDR_GET:
|
||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_GROUP_ADD:
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_GROUP_ADD:
|
||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_GROUP_DELETE: {
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_GROUP_DELETE: {
|
||||||
ESP_LOGI(TAG, "%s: Fast prov server receives msg, opcode 0x%04x", __func__, opcode);
|
ESP_LOGI(TAG, "%s: Fast prov server receives msg, opcode 0x%04" PRIx32, __func__, opcode);
|
||||||
struct net_buf_simple buf = {
|
struct net_buf_simple buf = {
|
||||||
.len = param->model_operation.length,
|
.len = param->model_operation.length,
|
||||||
.data = param->model_operation.msg,
|
.data = param->model_operation.msg,
|
||||||
@ -476,7 +478,7 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_INFO_STATUS:
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_INFO_STATUS:
|
||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NET_KEY_STATUS:
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NET_KEY_STATUS:
|
||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_ADDR_ACK: {
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_NODE_ADDR_ACK: {
|
||||||
ESP_LOGI(TAG, "%s: Fast prov client receives msg, opcode 0x%04x", __func__, opcode);
|
ESP_LOGI(TAG, "%s: Fast prov client receives msg, opcode 0x%04" PRIx32, __func__, opcode);
|
||||||
err = example_fast_prov_client_recv_status(param->model_operation.model,
|
err = example_fast_prov_client_recv_status(param->model_operation.model,
|
||||||
param->model_operation.ctx,
|
param->model_operation.ctx,
|
||||||
param->model_operation.length,
|
param->model_operation.length,
|
||||||
@ -488,7 +490,7 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ESP_LOGI(TAG, "%s: opcode 0x%04x", __func__, param->model_operation.opcode);
|
ESP_LOGI(TAG, "%s: opcode 0x%04" PRIx32, __func__, param->model_operation.opcode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -518,11 +520,11 @@ static void example_ble_mesh_custom_model_cb(esp_ble_mesh_model_cb_event_t event
|
|||||||
param->model_publish_comp.err_code);
|
param->model_publish_comp.err_code);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT:
|
case ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT:
|
||||||
ESP_LOGI(TAG, "ESP_BLE_MESH_MODEL_CLIENT_RECV_PUBLISH_MSG_EVT, opcode 0x%04x",
|
ESP_LOGI(TAG, "ESP_BLE_MESH_MODEL_CLIENT_RECV_PUBLISH_MSG_EVT, opcode 0x%04" PRIx32,
|
||||||
param->client_recv_publish_msg.opcode);
|
param->client_recv_publish_msg.opcode);
|
||||||
break;
|
break;
|
||||||
case ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT:
|
case ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT:
|
||||||
ESP_LOGI(TAG, "ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT, opcode 0x%04x, dst 0x%04x",
|
ESP_LOGI(TAG, "ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT, opcode 0x%04" PRIx32 ", dst 0x%04x",
|
||||||
param->client_send_timeout.opcode, param->client_send_timeout.ctx->addr);
|
param->client_send_timeout.opcode, param->client_send_timeout.ctx->addr);
|
||||||
err = example_fast_prov_client_recv_timeout(param->client_send_timeout.opcode,
|
err = example_fast_prov_client_recv_timeout(param->client_send_timeout.opcode,
|
||||||
param->client_send_timeout.model,
|
param->client_send_timeout.model,
|
||||||
@ -558,7 +560,7 @@ static void example_ble_mesh_config_client_cb(esp_ble_mesh_cfg_client_cb_event_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (param->error_code) {
|
if (param->error_code) {
|
||||||
ESP_LOGE(TAG, "Failed to send config client message, opcode: 0x%04x", opcode);
|
ESP_LOGE(TAG, "Failed to send config client message, opcode: 0x%04" PRIx32, opcode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -662,7 +664,7 @@ static void example_ble_mesh_config_server_cb(esp_ble_mesh_cfg_server_cb_event_t
|
|||||||
{
|
{
|
||||||
esp_err_t err;
|
esp_err_t err;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "%s, event = 0x%02x, opcode = 0x%04x, addr: 0x%04x",
|
ESP_LOGI(TAG, "%s, event = 0x%02x, opcode = 0x%04" PRIx32 ", addr: 0x%04x",
|
||||||
__func__, event, param->ctx.recv_op, param->ctx.addr);
|
__func__, event, param->ctx.recv_op, param->ctx.addr);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
@ -689,7 +691,7 @@ static void example_ble_mesh_config_server_cb(esp_ble_mesh_cfg_server_cb_event_t
|
|||||||
static void example_ble_mesh_generic_server_cb(esp_ble_mesh_generic_server_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_generic_server_cb_param_t *param)
|
||||||
{
|
{
|
||||||
ESP_LOGI(TAG, "event 0x%02x, opcode 0x%04x, src 0x%04x, dst 0x%04x",
|
ESP_LOGI(TAG, "event 0x%02x, opcode 0x%04" PRIx32 ", src 0x%04x, dst 0x%04x",
|
||||||
event, param->ctx.recv_op, param->ctx.addr, param->ctx.recv_dst);
|
event, param->ctx.recv_op, param->ctx.addr, param->ctx.recv_dst);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
@ -9,5 +9,3 @@ idf_component_register(SRCS "${srcs}"
|
|||||||
set_source_files_properties(
|
set_source_files_properties(
|
||||||
"ble_mesh_fast_prov_server_model.c"
|
"ble_mesh_fast_prov_server_model.c"
|
||||||
PROPERTIES COMPILE_FLAGS -Wno-address-of-packed-member)
|
PROPERTIES COMPILE_FLAGS -Wno-address-of-packed-member)
|
||||||
|
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_ble_mesh_networking_api.h"
|
#include "esp_ble_mesh_networking_api.h"
|
||||||
#include "esp_ble_mesh_provisioning_api.h"
|
#include "esp_ble_mesh_provisioning_api.h"
|
||||||
@ -425,7 +426,7 @@ esp_err_t example_send_fast_prov_info_set(esp_ble_mesh_model_t *model,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGI(TAG, "min: 0x%04x, max: 0x%04x", set->unicast_min, set->unicast_max);
|
ESP_LOGI(TAG, "min: 0x%04x, max: 0x%04x", set->unicast_min, set->unicast_max);
|
||||||
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08x", set->flags, set->iv_index);
|
ESP_LOGI(TAG, "flags: 0x%02x, iv_index: 0x%08" PRIx32, set->flags, set->iv_index);
|
||||||
ESP_LOGI(TAG, "net_idx: 0x%04x, group_addr: 0x%04x", set->net_idx, set->group_addr);
|
ESP_LOGI(TAG, "net_idx: 0x%04x, group_addr: 0x%04x", set->net_idx, set->group_addr);
|
||||||
ESP_LOGI(TAG, "action: 0x%02x", set->action);
|
ESP_LOGI(TAG, "action: 0x%02x", set->action);
|
||||||
ESP_LOG_BUFFER_HEX("FAST_PROV_OP: match_val", set->match_val, set->match_len);
|
ESP_LOG_BUFFER_HEX("FAST_PROV_OP: match_val", set->match_val, set->match_len);
|
||||||
@ -563,7 +564,7 @@ esp_err_t example_send_fast_prov_status_msg(esp_ble_mesh_model_t *model,
|
|||||||
ctx->send_rel = false;
|
ctx->send_rel = false;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGW(TAG, "%s: Invalid fast prov status opcode 0x%04x", __func__, opcode);
|
ESP_LOGW(TAG, "%s: Invalid fast prov status opcode 0x%04" PRIx32, __func__, opcode);
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "esp_ble_mesh_defs.h"
|
#include "esp_ble_mesh_defs.h"
|
||||||
#include "esp_ble_mesh_local_data_operation_api.h"
|
#include "esp_ble_mesh_local_data_operation_api.h"
|
||||||
@ -580,7 +581,7 @@ esp_err_t example_handle_fast_prov_status_send_comp_evt(int err_code, uint32_t o
|
|||||||
|
|
||||||
srv = (example_fast_prov_server_t *)model->user_data;
|
srv = (example_fast_prov_server_t *)model->user_data;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "%s: opcode 0x%06x", __func__, opcode);
|
ESP_LOGI(TAG, "%s: opcode 0x%06" PRIx32, __func__, opcode);
|
||||||
|
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_INFO_STATUS:
|
case ESP_BLE_MESH_VND_MODEL_OP_FAST_PROV_INFO_STATUS:
|
||||||
|
@ -1377,8 +1377,6 @@ docs/en/conf.py
|
|||||||
docs/zh_CN/conf.py
|
docs/zh_CN/conf.py
|
||||||
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/genie_event.c
|
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/genie_event.c
|
||||||
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/genie_reset.c
|
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/genie_reset.c
|
||||||
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/genie_timer.c
|
|
||||||
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/genie_util.c
|
|
||||||
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/include/genie_dlist.h
|
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/include/genie_dlist.h
|
||||||
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/include/genie_event.h
|
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/include/genie_event.h
|
||||||
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/include/genie_mesh.h
|
examples/bluetooth/esp_ble_mesh/aligenie_demo/components/vendor_model/include/genie_mesh.h
|
||||||
|
Loading…
x
Reference in New Issue
Block a user