ble_mesh: stack: Minor updates for BQB test log

This commit is contained in:
lly 2023-03-16 14:23:22 +08:00 committed by wangjialiang
parent 14d90c4534
commit 4737b4865d
2 changed files with 15 additions and 13 deletions

View File

@ -150,20 +150,20 @@ enum BLE_MESH_BQB_TEST_LOG_LEVEL {
BLE_MESH_BQB_TEST_LOG_LEVEL_SUB_ID_HM = BIT(19),
};
#define BLE_MESH_BQB_TEST_LOG_LEVEL_OUTPUT_NONE 0x000FFFFF
#define BLE_MESH_BQB_TEST_LOG_LEVEL_OUTPUT_NONE 0x000FFFFF
#endif /* CONFIG_BLE_MESH_BQB_TEST_LOG */
#if (CONFIG_BLE_MESH_BQB_TEST_LOG && !CONFIG_BLE_MESH_NO_LOG)
extern bool bt_mesh_bqb_test_flag_check(uint32_t module_mask);
extern bool bt_mesh_bqb_test_flag_check(uint32_t flag_mask);
extern int bt_mesh_bqb_test_flag_set(uint32_t value);
#define BT_BQB(module_mask, fmt, args...) \
do { \
if (bt_mesh_bqb_test_flag_check(module_mask)) \
BLE_MESH_PRINT_I("BLE_MESH_BQB", fmt, ## args); \
#define BT_BQB(flag_mask, fmt, args...) \
do { \
if (bt_mesh_bqb_test_flag_check(flag_mask)) \
BLE_MESH_PRINT_I("BLE_MESH_BQB", fmt, ## args); \
} while (0)
#else
#define BT_BQB(module_mask, fmt, args...)
#define BT_BQB(flag_mask, fmt, args...)
#endif
#ifdef __cplusplus

View File

@ -75,22 +75,24 @@ uint32_t bt_mesh_bqb_test_flag_get(void)
return bt_mesh_bqb_test_flag(BLE_MESH_BQB_TEST_FLAG_OP_GET, 0);
}
int bt_mesh_bqb_test_flag_set(uint32_t module_mask)
int bt_mesh_bqb_test_flag_set(uint32_t flag_mask)
{
if (module_mask > BLE_MESH_BQB_TEST_LOG_LEVEL_OUTPUT_NONE) {
BT_ERR("BT_BQB module mask error : overflow");
BT_ERR("Invalid BQB test flag mask 0x%08x", flag_mask);
return -EINVAL;
}
return (bt_mesh_bqb_test_flag(BLE_MESH_BQB_TEST_FLAG_OP_SET, module_mask) == module_mask) ? 0 : -EINVAL;
return (bt_mesh_bqb_test_flag(BLE_MESH_BQB_TEST_FLAG_OP_SET, flag_mask) == flag_mask) ? 0 : -EINVAL;
}
bool bt_mesh_bqb_test_flag_check(uint32_t module_mask)
bool bt_mesh_bqb_test_flag_check(uint32_t flag_mask)
{
if (module_mask > BLE_MESH_BQB_TEST_LOG_LEVEL_OUTPUT_NONE) {
BT_ERR("BT_BQB module mask error : overflow");
BT_ERR("Invalid BQB test flag mask 0x%08x", flag_mask);
return false;
}
return ((bt_mesh_bqb_test_flag_get() & module_mask) == module_mask);
return ((bt_mesh_bqb_test_flag_get() & flag_mask) == flag_mask);
}
#endif /* CONFIG_BLE_MESH_BQB_TEST_LOG */