espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.53k stars 7.26k forks source link

BLE-MESH messages between SIG models and Vendor models (IDFGH-3314) #5297

Open fgilcc opened 4 years ago

fgilcc commented 4 years ago

Environment

Problem Description

I can send messages with generic Opcodes from vendor models to SIG models, but I can't receive generic messages on vendor models even though I've also registered a generic Opcode for my server model.

esp_ble_mesh_model_op_t test_onoff_srv_op[] = { ESP_BLE_MESH_MODEL_OP(ESP_BLE_MESH_VND_MODEL_OP_TEST_ONOFF_GET, 1), ESP_BLE_MESH_MODEL_OP(ESP_BLE_MESH_VND_MODEL_OP_TEST_ONOFF_SET, 1), ESP_BLE_MESH_MODEL_OP(ESP_BLE_MESH_VND_MODEL_OP_TEST_ONOFF_SET_UNACK, 1), ESP_BLE_MESH_MODEL_OP(ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET_UNACK, 1), ESP_BLE_MESH_MODEL_OP_END, };

Expected Behavior

I expected messages with ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET_UNACK Opcode to trigger the callback function for custom server models.

Actual Behavior

Message is completely ignored and callback function is never called.

Steps to reproduce

  1. Setup a BLE MESH node with a SIG GENERIC ONOFF client model and another node with a Vendor server model with the above Opcodes.
  2. Trigger sending a message with ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET_UNACK Opcode
  3. Verify nothing is received on node with vendor server model.
Campou commented 4 years ago

Hi @Mantaba

Sorry for the late reply.

Because for a vendor model, the opcode of its message must be 3 octets. If using the SIG-defined opcodes for vendor models, and when the message is received, the mesh stack will find the corresponding model based on the received opcode among SIG models, no proper model will be found, thus the message will be ignored.

Thanks.

Alvin1Zhang commented 4 years ago

@Mantaba Thanks for reporting and sorry for the slow turnaround, would you please help share if any updates of this issue?Thanks.