ble_mesh: Add and use transport macro definitions [Zephyr]

This commit is contained in:
lly
2020-03-27 11:18:02 +08:00
committed by bot
parent df525bf0b3
commit 25dfee4bdd
8 changed files with 36 additions and 29 deletions
@@ -71,9 +71,9 @@ static esp_err_t ble_mesh_model_send_msg(esp_ble_mesh_model_t *model,
}
if (act == BTC_BLE_MESH_ACT_MODEL_PUBLISH) {
mic_len = 4;
mic_len = ESP_BLE_MESH_MIC_SHORT;
} else {
mic_len = ctx->send_rel ? 8 : 4;
mic_len = ctx->send_rel ? ESP_BLE_MESH_MIC_LONG : ESP_BLE_MESH_MIC_SHORT;
}
if (op_len + length + mic_len > MIN(ESP_BLE_MESH_SDU_MAX_LEN, ESP_BLE_MESH_TX_SDU_MAX)) {
@@ -38,6 +38,12 @@ extern "C" {
/*!< The maximum length of a BLE Mesh message, including Opcode, Payload and TransMIC */
#define ESP_BLE_MESH_SDU_MAX_LEN 384
/*!< Length of a short Mesh MIC. */
#define ESP_BLE_MESH_MIC_SHORT 4
/*!< Length of a long Mesh MIC. */
#define ESP_BLE_MESH_MIC_LONG 8
/*!< The maximum length of a BLE Mesh provisioned node name */
#define ESP_BLE_MESH_NODE_NAME_MAX_LEN 31