|
|
@@ -59,7 +59,7 @@ static void send_gen_onoff_status(struct bt_mesh_model *model,
|
|
|
if (publish == false) {
|
|
|
msg = bt_mesh_alloc_buf(length + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -93,7 +93,7 @@ static void gen_onoff_get(struct bt_mesh_model *model,
|
|
|
struct bt_mesh_gen_onoff_srv *srv = model->user_data;
|
|
|
|
|
|
if (srv == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -111,7 +111,7 @@ static void gen_onoff_get(struct bt_mesh_model *model,
|
|
|
void gen_onoff_publish(struct bt_mesh_model *model)
|
|
|
{
|
|
|
if (model->user_data == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -129,13 +129,13 @@ static void gen_onoff_set(struct bt_mesh_model *model,
|
|
|
s64_t now = 0;
|
|
|
|
|
|
if (srv == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
onoff = net_buf_simple_pull_u8(buf);
|
|
|
if (onoff > BLE_MESH_STATE_ON) {
|
|
|
- BT_ERR("%s, Invalid OnOff value 0x%02x", __func__, onoff);
|
|
|
+ BT_ERR("Invalid OnOff value 0x%02x", onoff);
|
|
|
return;
|
|
|
}
|
|
|
tid = net_buf_simple_pull_u8(buf);
|
|
|
@@ -231,7 +231,7 @@ static void send_gen_level_status(struct bt_mesh_model *model,
|
|
|
if (publish == false) {
|
|
|
msg = bt_mesh_alloc_buf(length + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -274,7 +274,7 @@ static void gen_level_get(struct bt_mesh_model *model,
|
|
|
struct bt_mesh_gen_level_srv *srv = model->user_data;
|
|
|
|
|
|
if (srv == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -292,7 +292,7 @@ static void gen_level_get(struct bt_mesh_model *model,
|
|
|
void gen_level_publish(struct bt_mesh_model *model)
|
|
|
{
|
|
|
if (model->user_data == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -311,7 +311,7 @@ static void gen_level_set(struct bt_mesh_model *model,
|
|
|
s64_t now = 0;
|
|
|
|
|
|
if (srv == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -407,7 +407,7 @@ static void gen_delta_set(struct bt_mesh_model *model,
|
|
|
s64_t now = 0;
|
|
|
|
|
|
if (srv == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -529,7 +529,7 @@ static void gen_move_set(struct bt_mesh_model *model,
|
|
|
s64_t now = 0;
|
|
|
|
|
|
if (srv == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -660,7 +660,7 @@ static void send_gen_def_trans_time_status(struct bt_mesh_model *model,
|
|
|
if (publish == false) {
|
|
|
msg = bt_mesh_alloc_buf(length + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -689,7 +689,7 @@ static void gen_def_trans_time_get(struct bt_mesh_model *model,
|
|
|
struct bt_mesh_gen_def_trans_time_srv *srv = model->user_data;
|
|
|
|
|
|
if (srv == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -712,13 +712,13 @@ static void gen_def_trans_time_set(struct bt_mesh_model *model,
|
|
|
u8_t trans_time = 0U;
|
|
|
|
|
|
if (srv == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
trans_time = net_buf_simple_pull_u8(buf);
|
|
|
if ((trans_time & 0x3F) == 0x3F) {
|
|
|
- BT_WARN("%s, Invalid Transaction Number of Steps 0x3F", __func__);
|
|
|
+ BT_WARN("Invalid Transaction Number of Steps 0x3f");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -766,7 +766,7 @@ static void send_gen_onpowerup_status(struct bt_mesh_model *model,
|
|
|
if (publish == false) {
|
|
|
msg = bt_mesh_alloc_buf(length + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -789,7 +789,7 @@ static void send_gen_onpowerup_status(struct bt_mesh_model *model,
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
- BT_ERR("%s, Invalid Generic Power OnOff Server 0x%04x", __func__, model->id);
|
|
|
+ BT_ERR("Invalid Generic Power OnOff Server 0x%04x", model->id);
|
|
|
if (publish == false) {
|
|
|
bt_mesh_free_buf(msg);
|
|
|
}
|
|
|
@@ -812,7 +812,7 @@ static void gen_onpowerup_get(struct bt_mesh_model *model,
|
|
|
struct bt_mesh_gen_power_onoff_srv *srv = model->user_data;
|
|
|
|
|
|
if (srv == NULL || srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -831,7 +831,7 @@ static void gen_onpowerup_get(struct bt_mesh_model *model,
|
|
|
void gen_onpowerup_publish(struct bt_mesh_model *model)
|
|
|
{
|
|
|
if (model->user_data == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -839,7 +839,7 @@ void gen_onpowerup_publish(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_POWER_ONOFF_SRV: {
|
|
|
struct bt_mesh_gen_power_onoff_srv *srv = model->user_data;
|
|
|
if (srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid Generic Power OnOff Server state", __func__);
|
|
|
+ BT_ERR("Invalid Generic Power OnOff Server state");
|
|
|
return;
|
|
|
}
|
|
|
break;
|
|
|
@@ -847,13 +847,13 @@ void gen_onpowerup_publish(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV: {
|
|
|
struct bt_mesh_gen_power_onoff_setup_srv *srv = model->user_data;
|
|
|
if (srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid Generic Power OnOff Setup Server state", __func__);
|
|
|
+ BT_ERR("Invalid Generic Power OnOff Setup Server state");
|
|
|
return;
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
- BT_ERR("%s, Invalid Generic Power OnOff Server 0x%04x", __func__, model->id);
|
|
|
+ BT_ERR("Invalid Generic Power OnOff Server 0x%04x", model->id);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -869,13 +869,13 @@ static void gen_onpowerup_set(struct bt_mesh_model *model,
|
|
|
u8_t onpowerup = 0U;
|
|
|
|
|
|
if (srv == NULL || srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
onpowerup = net_buf_simple_pull_u8(buf);
|
|
|
if (onpowerup > BLE_MESH_STATE_RESTORE) {
|
|
|
- BT_WARN("%s, Invalid OnPowerUp value 0x%02x", __func__, onpowerup);
|
|
|
+ BT_WARN("Invalid OnPowerUp value 0x%02x", onpowerup);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -923,7 +923,7 @@ static void send_gen_power_level_status(struct bt_mesh_model *model,
|
|
|
if (publish == false) {
|
|
|
msg = bt_mesh_alloc_buf(length + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -973,7 +973,7 @@ static void send_gen_power_level_status(struct bt_mesh_model *model,
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
|
- BT_WARN("%s, Unknown Generic Power status opcode 0x%04x", __func__, opcode);
|
|
|
+ BT_WARN("Unknown Generic Power status opcode 0x%04x", opcode);
|
|
|
if (publish == false) {
|
|
|
bt_mesh_free_buf(msg);
|
|
|
}
|
|
|
@@ -997,7 +997,7 @@ static void gen_power_level_get(struct bt_mesh_model *model,
|
|
|
u16_t opcode = 0U;
|
|
|
|
|
|
if (srv == NULL || srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1022,7 +1022,7 @@ static void gen_power_level_get(struct bt_mesh_model *model,
|
|
|
opcode = BLE_MESH_MODEL_OP_GEN_POWER_RANGE_STATUS;
|
|
|
break;
|
|
|
default:
|
|
|
- BT_WARN("%s, Unknown Generic Power Get opcode 0x%04x", __func__, ctx->recv_op);
|
|
|
+ BT_WARN("Unknown Generic Power Get opcode 0x%04x", ctx->recv_op);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1033,7 +1033,7 @@ static void gen_power_level_get(struct bt_mesh_model *model,
|
|
|
void gen_power_level_publish(struct bt_mesh_model *model, u16_t opcode)
|
|
|
{
|
|
|
if (model->user_data == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1041,7 +1041,7 @@ void gen_power_level_publish(struct bt_mesh_model *model, u16_t opcode)
|
|
|
case BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_SRV: {
|
|
|
struct bt_mesh_gen_power_level_srv *srv = model->user_data;
|
|
|
if (srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid Generic Power Level Server state", __func__);
|
|
|
+ BT_ERR("Invalid Generic Power Level Server state");
|
|
|
return;
|
|
|
}
|
|
|
break;
|
|
|
@@ -1049,13 +1049,13 @@ void gen_power_level_publish(struct bt_mesh_model *model, u16_t opcode)
|
|
|
case ESP_BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_SETUP_SRV: {
|
|
|
struct bt_mesh_gen_power_level_setup_srv *srv = model->user_data;
|
|
|
if (srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid Generic Power Level Setup Server state", __func__);
|
|
|
+ BT_ERR("Invalid Generic Power Level Setup Server state");
|
|
|
return;
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
- BT_ERR("%s, Invalid Generic Power Level Server 0x%04x", __func__, model->id);
|
|
|
+ BT_ERR("Invalid Generic Power Level Server 0x%04x", model->id);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1074,7 +1074,7 @@ static void gen_power_level_set(struct bt_mesh_model *model,
|
|
|
s64_t now = 0;
|
|
|
|
|
|
if (srv == NULL || srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1182,7 +1182,7 @@ static void gen_power_default_set(struct bt_mesh_model *model,
|
|
|
u16_t power = 0U;
|
|
|
|
|
|
if (srv == NULL || srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1232,7 +1232,7 @@ static void gen_power_range_set(struct bt_mesh_model *model,
|
|
|
u16_t range_min = 0U, range_max = 0U;
|
|
|
|
|
|
if (srv == NULL || srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1240,8 +1240,8 @@ static void gen_power_range_set(struct bt_mesh_model *model,
|
|
|
range_max = net_buf_simple_pull_le16(buf);
|
|
|
|
|
|
if (range_min > range_max) {
|
|
|
- BT_ERR("%s, Range Min 0x%04x is greater than Range Max 0x%04x",
|
|
|
- __func__, range_min, range_max);
|
|
|
+ BT_ERR("Range min 0x%04x is greater than range max 0x%04x",
|
|
|
+ range_min, range_max);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1296,7 +1296,7 @@ static void gen_battery_get(struct bt_mesh_model *model,
|
|
|
NET_BUF_SIMPLE_DEFINE(msg, 2 + 8 + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
|
|
|
if (srv == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1331,7 +1331,7 @@ static void send_gen_location_status(struct bt_mesh_model *model,
|
|
|
if (publish == false) {
|
|
|
msg = bt_mesh_alloc_buf(length + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -1374,7 +1374,7 @@ static void send_gen_location_status(struct bt_mesh_model *model,
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
|
- BT_WARN("%s, Unknown Generic Location status opcode 0x%04x", __func__, opcode);
|
|
|
+ BT_WARN("Unknown Generic Location status opcode 0x%04x", opcode);
|
|
|
if (publish == false) {
|
|
|
bt_mesh_free_buf(msg);
|
|
|
}
|
|
|
@@ -1398,7 +1398,7 @@ static void gen_location_get(struct bt_mesh_model *model,
|
|
|
u16_t opcode = 0U;
|
|
|
|
|
|
if (srv == NULL || srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1417,7 +1417,7 @@ static void gen_location_get(struct bt_mesh_model *model,
|
|
|
opcode = BLE_MESH_MODEL_OP_GEN_LOC_LOCAL_STATUS;
|
|
|
break;
|
|
|
default:
|
|
|
- BT_WARN("%s, Unknown Generic Location Get opcode 0x%04x", __func__, ctx->recv_op);
|
|
|
+ BT_WARN("Unknown Generic Location Get opcode 0x%04x", ctx->recv_op);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1434,7 +1434,7 @@ static void gen_location_set(struct bt_mesh_model *model,
|
|
|
u16_t opcode = 0U;
|
|
|
|
|
|
if (srv == NULL || srv->state == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1526,7 +1526,7 @@ static void gen_location_set(struct bt_mesh_model *model,
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
- BT_WARN("%s, Unknown Generic Location Set opcode 0x%04x", __func__, ctx->recv_op);
|
|
|
+ BT_WARN("Unknown Generic Location Set opcode 0x%04x", ctx->recv_op);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1540,8 +1540,8 @@ static void gen_location_set(struct bt_mesh_model *model,
|
|
|
}
|
|
|
|
|
|
/* Generic User Property Server message handlers */
|
|
|
-struct bt_mesh_generic_property *gen_get_user_property(struct bt_mesh_model *model,
|
|
|
- u16_t property_id)
|
|
|
+static struct bt_mesh_generic_property *gen_get_user_property(struct bt_mesh_model *model,
|
|
|
+ u16_t property_id)
|
|
|
{
|
|
|
struct bt_mesh_gen_user_prop_srv *srv = model->user_data;
|
|
|
int i;
|
|
|
@@ -1564,13 +1564,13 @@ static void send_gen_user_prop_status(struct bt_mesh_model *model,
|
|
|
u16_t length = 0U;
|
|
|
|
|
|
if (property_id == BLE_MESH_INVALID_DEVICE_PROPERTY_ID) {
|
|
|
- BT_ERR("%s, Invalid User Property ID 0x%04x", __func__, property_id);
|
|
|
+ BT_ERR("Invalid User Property ID 0x%04x", property_id);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
property = gen_get_user_property(model, property_id);
|
|
|
if (property == NULL) {
|
|
|
- BT_WARN("%s, User property 0x%04x not exist", __func__, property_id);
|
|
|
+ BT_WARN("User property 0x%04x not exists", property_id);
|
|
|
length = sizeof(property_id);
|
|
|
} else {
|
|
|
length = sizeof(property->id) + sizeof(property->user_access) + property->val->len;
|
|
|
@@ -1579,7 +1579,7 @@ static void send_gen_user_prop_status(struct bt_mesh_model *model,
|
|
|
if (publish == false) {
|
|
|
msg = bt_mesh_alloc_buf(1 + length + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -1622,7 +1622,7 @@ static void gen_user_prop_get(struct bt_mesh_model *model,
|
|
|
struct bt_mesh_gen_user_prop_srv *srv = model->user_data;
|
|
|
|
|
|
if (srv == NULL || srv->property_count == 0U || srv->properties == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1651,7 +1651,7 @@ static void gen_user_prop_get(struct bt_mesh_model *model,
|
|
|
u8_t i;
|
|
|
msg = bt_mesh_alloc_buf(1 + srv->property_count * 2 + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
bt_mesh_model_msg_init(msg, BLE_MESH_MODEL_OP_GEN_USER_PROPERTIES_STATUS);
|
|
|
@@ -1671,7 +1671,7 @@ static void gen_user_prop_get(struct bt_mesh_model *model,
|
|
|
return;
|
|
|
}
|
|
|
default:
|
|
|
- BT_WARN("%s, Unknown Generic User Property Get opcode 0x%04x", __func__, ctx->recv_op);
|
|
|
+ BT_WARN("Unknown Generic User Property Get opcode 0x%04x", ctx->recv_op);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -1686,7 +1686,7 @@ static void gen_user_prop_set(struct bt_mesh_model *model,
|
|
|
u8_t expect_len = 0U;
|
|
|
|
|
|
if (srv == NULL || srv->property_count == 0U || srv->properties == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1720,8 +1720,8 @@ static void gen_user_prop_set(struct bt_mesh_model *model,
|
|
|
*/
|
|
|
expect_len = bt_mesh_get_dev_prop_len(property_id);
|
|
|
if (buf->len != expect_len) {
|
|
|
- BT_ERR("%s, Invalid User Property length, ID 0x%04x, expect %d, actual %d",
|
|
|
- __func__, property_id, expect_len, buf->len);
|
|
|
+ BT_ERR("Invalid User Property 0x%04x length, expect %d, actual %d",
|
|
|
+ property_id, expect_len, buf->len);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1744,8 +1744,8 @@ static void gen_user_prop_set(struct bt_mesh_model *model,
|
|
|
}
|
|
|
|
|
|
/* Generic Admin Property Server message handlers */
|
|
|
-struct bt_mesh_generic_property *gen_get_admin_property(struct bt_mesh_model *model,
|
|
|
- u16_t property_id)
|
|
|
+static struct bt_mesh_generic_property *gen_get_admin_property(struct bt_mesh_model *model,
|
|
|
+ u16_t property_id)
|
|
|
{
|
|
|
struct bt_mesh_gen_admin_prop_srv *srv = model->user_data;
|
|
|
int i;
|
|
|
@@ -1768,13 +1768,13 @@ static void send_gen_admin_prop_status(struct bt_mesh_model *model,
|
|
|
u16_t length = 0U;
|
|
|
|
|
|
if (property_id == BLE_MESH_INVALID_DEVICE_PROPERTY_ID) {
|
|
|
- BT_ERR("%s, Invalid User Property ID 0x%04x", __func__, property_id);
|
|
|
+ BT_ERR("Invalid Admin Property ID 0x%04x", property_id);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
property = gen_get_admin_property(model, property_id);
|
|
|
if (property == NULL) {
|
|
|
- BT_WARN("%s, Admin property 0x%04x not exist", __func__, property_id);
|
|
|
+ BT_WARN("Admin property 0x%04x not exists", property_id);
|
|
|
length = sizeof(property_id);
|
|
|
} else {
|
|
|
length = sizeof(property->id) + sizeof(property->admin_access) + property->val->len;
|
|
|
@@ -1783,7 +1783,7 @@ static void send_gen_admin_prop_status(struct bt_mesh_model *model,
|
|
|
if (publish == false) {
|
|
|
msg = bt_mesh_alloc_buf(1 + length + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -1821,7 +1821,7 @@ static void gen_admin_prop_get(struct bt_mesh_model *model,
|
|
|
struct bt_mesh_gen_admin_prop_srv *srv = model->user_data;
|
|
|
|
|
|
if (srv == NULL || srv->property_count == 0U || srv->properties == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1846,7 +1846,7 @@ static void gen_admin_prop_get(struct bt_mesh_model *model,
|
|
|
u8_t i = 0U;
|
|
|
msg = bt_mesh_alloc_buf(1 + srv->property_count * 2 + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
bt_mesh_model_msg_init(msg, BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTIES_STATUS);
|
|
|
@@ -1863,7 +1863,7 @@ static void gen_admin_prop_get(struct bt_mesh_model *model,
|
|
|
return;
|
|
|
}
|
|
|
default:
|
|
|
- BT_WARN("%s, Unknown Generic Admin Property Get opcode 0x%04x", __func__, ctx->recv_op);
|
|
|
+ BT_WARN("Unknown Generic Admin Property Get opcode 0x%04x", ctx->recv_op);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -1878,14 +1878,14 @@ static void gen_admin_prop_set(struct bt_mesh_model *model,
|
|
|
u8_t access = 0U;
|
|
|
|
|
|
if (srv == NULL || srv->property_count == 0U || srv->properties == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
property_id = net_buf_simple_pull_le16(buf);
|
|
|
access = net_buf_simple_pull_u8(buf);
|
|
|
if (access > ADMIN_ACCESS_READ_WRITE) {
|
|
|
- BT_ERR("%s, Invalid Admin Access 0x%02x", __func__, access);
|
|
|
+ BT_ERR("Invalid Admin Access 0x%02x", access);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1932,8 +1932,8 @@ static void gen_admin_prop_set(struct bt_mesh_model *model,
|
|
|
}
|
|
|
|
|
|
/* Generic Manufacturer Property Server message handlers */
|
|
|
-struct bt_mesh_generic_property *gen_get_manu_property(struct bt_mesh_model *model,
|
|
|
- u16_t property_id)
|
|
|
+static struct bt_mesh_generic_property *gen_get_manu_property(struct bt_mesh_model *model,
|
|
|
+ u16_t property_id)
|
|
|
{
|
|
|
struct bt_mesh_gen_manu_prop_srv *srv = model->user_data;
|
|
|
int i;
|
|
|
@@ -1956,13 +1956,13 @@ static void send_gen_manu_prop_status(struct bt_mesh_model *model,
|
|
|
u16_t length = 0U;
|
|
|
|
|
|
if (property_id == BLE_MESH_INVALID_DEVICE_PROPERTY_ID) {
|
|
|
- BT_ERR("%s, Invalid User Property ID 0x%04x", __func__, property_id);
|
|
|
+ BT_ERR("Invalid Manu Property ID 0x%04x", property_id);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
property = gen_get_manu_property(model, property_id);
|
|
|
if (property == NULL) {
|
|
|
- BT_WARN("%s, Manufacturer property 0x%04x not exist", __func__, property_id);
|
|
|
+ BT_WARN("Manu property 0x%04x not exists", property_id);
|
|
|
length = sizeof(property_id);
|
|
|
} else {
|
|
|
length = sizeof(property->id) + sizeof(property->manu_access) + property->val->len;
|
|
|
@@ -1971,7 +1971,7 @@ static void send_gen_manu_prop_status(struct bt_mesh_model *model,
|
|
|
if (publish == false) {
|
|
|
msg = bt_mesh_alloc_buf(1 + length + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -2006,7 +2006,7 @@ static void gen_manu_prop_get(struct bt_mesh_model *model,
|
|
|
struct bt_mesh_gen_manu_prop_srv *srv = model->user_data;
|
|
|
|
|
|
if (srv == NULL || srv->property_count == 0U || srv->properties == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -2031,7 +2031,7 @@ static void gen_manu_prop_get(struct bt_mesh_model *model,
|
|
|
u8_t i = 0U;
|
|
|
msg = bt_mesh_alloc_buf(1 + srv->property_count * 2 + BLE_MESH_SERVER_TRANS_MIC_SIZE);
|
|
|
if (msg == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
bt_mesh_model_msg_init(msg, BLE_MESH_MODEL_OP_GEN_MANU_PROPERTIES_STATUS);
|
|
|
@@ -2048,7 +2048,7 @@ static void gen_manu_prop_get(struct bt_mesh_model *model,
|
|
|
return;
|
|
|
}
|
|
|
default:
|
|
|
- BT_WARN("%s, Unknown Generic Manufacturer Property Get opcode 0x%04x", __func__, ctx->recv_op);
|
|
|
+ BT_WARN("Unknown Generic Manu Property Get opcode 0x%04x", ctx->recv_op);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -2063,14 +2063,14 @@ static void gen_manu_prop_set(struct bt_mesh_model *model,
|
|
|
u8_t access = 0U;
|
|
|
|
|
|
if (srv == NULL || srv->property_count == 0U || srv->properties == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
property_id = net_buf_simple_pull_le16(buf);
|
|
|
access = net_buf_simple_pull_u8(buf);
|
|
|
if (access > MANU_ACCESS_READ) {
|
|
|
- BT_ERR("%s, Invalid Manufacturer Access 0x%02x", __func__, access);
|
|
|
+ BT_ERR("Invalid Manu Access 0x%02x", access);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -2153,7 +2153,7 @@ static void gen_client_prop_get(struct bt_mesh_model *model,
|
|
|
int i, index = 0;
|
|
|
|
|
|
if (srv == NULL || srv->id_count == 0U || srv->property_ids == NULL) {
|
|
|
- BT_ERR("%s, Invalid model user_data", __func__);
|
|
|
+ BT_ERR("%s, Invalid model user data", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -2184,7 +2184,7 @@ static void gen_client_prop_get(struct bt_mesh_model *model,
|
|
|
|
|
|
sdu = bt_mesh_alloc_buf(MIN(BLE_MESH_TX_SDU_MAX, BLE_MESH_SERVER_RSP_MAX_LEN));
|
|
|
if (sdu == NULL) {
|
|
|
- BT_ERR("%s, Failed to allocate memory", __func__);
|
|
|
+ BT_ERR("%s, Out of memory", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -2336,7 +2336,7 @@ static inline int property_id_compare(const void *p1, const void *p2)
|
|
|
static int generic_server_init(struct bt_mesh_model *model)
|
|
|
{
|
|
|
if (model->user_data == NULL) {
|
|
|
- BT_ERR("%s, No Generic Server context provided, model_id 0x%04x", __func__, model->id);
|
|
|
+ BT_ERR("Invalid Generic Server user data, model id 0x%04x", model->id);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2367,7 +2367,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_POWER_ONOFF_SRV: {
|
|
|
struct bt_mesh_gen_power_onoff_srv *srv = model->user_data;
|
|
|
if (srv->state == NULL) {
|
|
|
- BT_ERR("%s, NULL Generic OnPowerUp State", __func__);
|
|
|
+ BT_ERR("Invalid Generic OnPowerUp State");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
srv->model = model;
|
|
|
@@ -2376,7 +2376,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV: {
|
|
|
struct bt_mesh_gen_power_onoff_setup_srv *srv = model->user_data;
|
|
|
if (srv->state == NULL) {
|
|
|
- BT_ERR("%s, NULL Generic OnPowerUp State", __func__);
|
|
|
+ BT_ERR("Invalid Generic OnPowerUp State");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
srv->model = model;
|
|
|
@@ -2385,7 +2385,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_SRV: {
|
|
|
struct bt_mesh_gen_power_level_srv *srv = model->user_data;
|
|
|
if (srv->state == NULL) {
|
|
|
- BT_ERR("%s, NULL Generic Power Level State", __func__);
|
|
|
+ BT_ERR("Invalid Generic Power Level State");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
if (srv->rsp_ctrl.set_auto_rsp == BLE_MESH_SERVER_AUTO_RSP) {
|
|
|
@@ -2398,7 +2398,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_SETUP_SRV: {
|
|
|
struct bt_mesh_gen_power_level_setup_srv *srv = model->user_data;
|
|
|
if (srv->state == NULL) {
|
|
|
- BT_ERR("%s, NULL Generic Power Level State", __func__);
|
|
|
+ BT_ERR("Invalid Generic Power Level State");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
srv->model = model;
|
|
|
@@ -2412,7 +2412,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_LOCATION_SRV: {
|
|
|
struct bt_mesh_gen_location_srv *srv = model->user_data;
|
|
|
if (srv->state == NULL) {
|
|
|
- BT_ERR("%s, NULL Generic Location State", __func__);
|
|
|
+ BT_ERR("Invalid Generic Location State");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
srv->model = model;
|
|
|
@@ -2421,7 +2421,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_LOCATION_SETUP_SRV: {
|
|
|
struct bt_mesh_gen_location_setup_srv *srv = model->user_data;
|
|
|
if (srv->state == NULL) {
|
|
|
- BT_ERR("%s, NULL Generic Location State", __func__);
|
|
|
+ BT_ERR("Invalid Generic Location State");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
srv->model = model;
|
|
|
@@ -2430,7 +2430,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_USER_PROP_SRV: {
|
|
|
struct bt_mesh_gen_user_prop_srv *srv = model->user_data;
|
|
|
if (srv->property_count == 0U || srv->properties == NULL) {
|
|
|
- BT_ERR("%s, NULL Generic User Property State", __func__);
|
|
|
+ BT_ERR("Invalid Generic User Property State");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
srv->model = model;
|
|
|
@@ -2439,7 +2439,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_ADMIN_PROP_SRV: {
|
|
|
struct bt_mesh_gen_admin_prop_srv *srv = model->user_data;
|
|
|
if (srv->property_count == 0U || srv->properties == NULL) {
|
|
|
- BT_ERR("%s, NULL Generic Admin Property State", __func__);
|
|
|
+ BT_ERR("Invalid Generic Admin Property State");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
srv->model = model;
|
|
|
@@ -2448,7 +2448,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_MANUFACTURER_PROP_SRV: {
|
|
|
struct bt_mesh_gen_manu_prop_srv *srv = model->user_data;
|
|
|
if (srv->property_count == 0U || srv->properties == NULL) {
|
|
|
- BT_ERR("%s, NULL Generic Manufacturer Property State", __func__);
|
|
|
+ BT_ERR("Invalid Generic Manufacturer Property State");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
srv->model = model;
|
|
|
@@ -2457,7 +2457,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_CLIENT_PROP_SRV: {
|
|
|
struct bt_mesh_gen_client_prop_srv *srv = model->user_data;
|
|
|
if (srv->id_count == 0U || srv->property_ids == NULL) {
|
|
|
- BT_ERR("%s, NULL Generic Client Property State", __func__);
|
|
|
+ BT_ERR("Invalid Generic Client Property State");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
/* Quick sort the Client Property IDs in ascending order */
|
|
|
@@ -2466,7 +2466,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
- BT_WARN("%s, Unknown Generic Server Model, model_id 0x%04x", __func__, model->id);
|
|
|
+ BT_WARN("Unknown Generic Server, model id 0x%04x", model->id);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2478,7 +2478,7 @@ static int generic_server_init(struct bt_mesh_model *model)
|
|
|
int bt_mesh_gen_onoff_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic OnOff Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic OnOff Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2488,7 +2488,7 @@ int bt_mesh_gen_onoff_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_level_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Level Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Level Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2498,7 +2498,7 @@ int bt_mesh_gen_level_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_def_trans_time_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Default Trans Time Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Default Trans Time Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2508,7 +2508,7 @@ int bt_mesh_gen_def_trans_time_srv_init(struct bt_mesh_model *model, bool primar
|
|
|
int bt_mesh_gen_power_onoff_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Power OnOff Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Power OnOff Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2517,7 +2517,7 @@ int bt_mesh_gen_power_onoff_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
*/
|
|
|
struct bt_mesh_elem *element = bt_mesh_model_elem(model);
|
|
|
if (bt_mesh_model_find(element, BLE_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV) == NULL) {
|
|
|
- BT_WARN("%s, Generic Power OnOff Setup Server is not present", __func__);
|
|
|
+ BT_WARN("Generic Power OnOff Setup Server not present");
|
|
|
/* Just give a warning here, continue with the initialization */
|
|
|
}
|
|
|
return generic_server_init(model);
|
|
|
@@ -2531,7 +2531,7 @@ int bt_mesh_gen_power_onoff_setup_srv_init(struct bt_mesh_model *model, bool pri
|
|
|
int bt_mesh_gen_power_level_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Power Level Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Power Level Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2540,7 +2540,7 @@ int bt_mesh_gen_power_level_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
*/
|
|
|
struct bt_mesh_elem *element = bt_mesh_model_elem(model);
|
|
|
if (bt_mesh_model_find(element, BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_SETUP_SRV) == NULL) {
|
|
|
- BT_WARN("%s, Generic Power Level Setup Server is not present", __func__);
|
|
|
+ BT_WARN("Generic Power Level Setup Server not present");
|
|
|
/* Just give a warning here, continue with the initialization */
|
|
|
}
|
|
|
return generic_server_init(model);
|
|
|
@@ -2554,7 +2554,7 @@ int bt_mesh_gen_power_level_setup_srv_init(struct bt_mesh_model *model, bool pri
|
|
|
int bt_mesh_gen_battery_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Battery Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Battery Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2564,7 +2564,7 @@ int bt_mesh_gen_battery_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_location_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Location Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Location Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2578,7 +2578,7 @@ int bt_mesh_gen_location_setup_srv_init(struct bt_mesh_model *model, bool primar
|
|
|
*/
|
|
|
struct bt_mesh_elem *element = bt_mesh_model_elem(model);
|
|
|
if (bt_mesh_model_find(element, BLE_MESH_MODEL_ID_GEN_LOCATION_SETUP_SRV) == NULL) {
|
|
|
- BT_WARN("%s, Generic Location Setup Server is not present", __func__);
|
|
|
+ BT_WARN("Generic Location Setup Server not present");
|
|
|
/* Just give a warning here, continue with the initialization */
|
|
|
}
|
|
|
return generic_server_init(model);
|
|
|
@@ -2587,7 +2587,7 @@ int bt_mesh_gen_location_setup_srv_init(struct bt_mesh_model *model, bool primar
|
|
|
int bt_mesh_gen_user_prop_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic User Property has no publication support", __func__);
|
|
|
+ BT_ERR("Generic User Property Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2597,7 +2597,7 @@ int bt_mesh_gen_user_prop_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_admin_prop_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Admin Property has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Admin Property Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2607,7 +2607,7 @@ int bt_mesh_gen_admin_prop_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_manu_prop_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Manufacturer Property has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Manufacturer Property Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2617,7 +2617,7 @@ int bt_mesh_gen_manu_prop_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_client_prop_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Client Property has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Client Property Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2627,7 +2627,7 @@ int bt_mesh_gen_client_prop_srv_init(struct bt_mesh_model *model, bool primary)
|
|
|
static int generic_server_deinit(struct bt_mesh_model *model)
|
|
|
{
|
|
|
if (model->user_data == NULL) {
|
|
|
- BT_ERR("%s, No Generic Server context provided, model_id 0x%04x", __func__, model->id);
|
|
|
+ BT_ERR("Invalid Generic Server user data, model id 0x%04x", model->id);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2651,7 +2651,7 @@ static int generic_server_deinit(struct bt_mesh_model *model)
|
|
|
case BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_SRV: {
|
|
|
struct bt_mesh_gen_power_level_srv *srv = model->user_data;
|
|
|
if (srv->state == NULL) {
|
|
|
- BT_ERR("%s, NULL Generic Power Level State", __func__);
|
|
|
+ BT_ERR("Invalid Generic Power Level State");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
if (srv->rsp_ctrl.set_auto_rsp == BLE_MESH_SERVER_AUTO_RSP) {
|
|
|
@@ -2661,7 +2661,7 @@ static int generic_server_deinit(struct bt_mesh_model *model)
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
- BT_WARN("%s, Unknown Generic Server Model, model_id 0x%04x", __func__, model->id);
|
|
|
+ BT_WARN("Unknown Generic Server, model id 0x%04x", model->id);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2673,7 +2673,7 @@ static int generic_server_deinit(struct bt_mesh_model *model)
|
|
|
int bt_mesh_gen_onoff_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic OnOff Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic OnOff Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2683,7 +2683,7 @@ int bt_mesh_gen_onoff_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_level_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Level Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Level Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2693,7 +2693,7 @@ int bt_mesh_gen_level_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_def_trans_time_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Default Trans Time Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Default Trans Time Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2703,7 +2703,7 @@ int bt_mesh_gen_def_trans_time_srv_deinit(struct bt_mesh_model *model, bool prim
|
|
|
int bt_mesh_gen_power_onoff_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Power OnOff Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Power OnOff Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2718,7 +2718,7 @@ int bt_mesh_gen_power_onoff_setup_srv_deinit(struct bt_mesh_model *model, bool p
|
|
|
int bt_mesh_gen_power_level_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Power Level Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Power Level Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2733,7 +2733,7 @@ int bt_mesh_gen_power_level_setup_srv_deinit(struct bt_mesh_model *model, bool p
|
|
|
int bt_mesh_gen_battery_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Battery Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Battery Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2743,7 +2743,7 @@ int bt_mesh_gen_battery_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_location_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Location Server has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Location Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2758,7 +2758,7 @@ int bt_mesh_gen_location_setup_srv_deinit(struct bt_mesh_model *model, bool prim
|
|
|
int bt_mesh_gen_user_prop_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic User Property has no publication support", __func__);
|
|
|
+ BT_ERR("Generic User Property Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2768,7 +2768,7 @@ int bt_mesh_gen_user_prop_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_admin_prop_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Admin Property has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Admin Property Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2778,7 +2778,7 @@ int bt_mesh_gen_admin_prop_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_manu_prop_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Manufacturer Property has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Manufacturer Property Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
@@ -2788,7 +2788,7 @@ int bt_mesh_gen_manu_prop_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
int bt_mesh_gen_client_prop_srv_deinit(struct bt_mesh_model *model, bool primary)
|
|
|
{
|
|
|
if (model->pub == NULL) {
|
|
|
- BT_ERR("%s, Generic Client Property has no publication support", __func__);
|
|
|
+ BT_ERR("Generic Client Property Server has no publication support");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|