diff --git a/src/NimBLEMeshElement.cpp b/src/NimBLEMeshElement.cpp index f3e99ac..3fba746 100644 --- a/src/NimBLEMeshElement.cpp +++ b/src/NimBLEMeshElement.cpp @@ -64,7 +64,7 @@ NimBLEMeshModel* NimBLEMeshElement::createModel(uint16_t type, NimBLEMeshModelCa case BT_MESH_MODEL_ID_HEALTH_SRV: m_pHealthModel = new NimBLEHealthSrvModel(pCallbacks); pModel = m_pHealthModel; - m_modelsVec.push_back(bt_mesh_model{{type},0,0,0,&pModel->m_opPub,{0},{0},bt_mesh_health_srv_op,&m_pHealthModel->m_healthSrv}); + m_modelsVec.push_back(bt_mesh_model{{type},0,0,0,&pModel->m_opPub,{0},{0},bt_mesh_health_srv_op,&bt_mesh_health_cli_cb,&m_pHealthModel->m_healthSrv}); return pModel; default: @@ -72,7 +72,7 @@ NimBLEMeshModel* NimBLEMeshElement::createModel(uint16_t type, NimBLEMeshModelCa return nullptr; } - m_modelsVec.push_back(bt_mesh_model{{type},0,0,0, &pModel->m_opPub,{0},{0},pModel->m_opList, pModel}); + m_modelsVec.push_back(bt_mesh_model{{type},0,0,0, &pModel->m_opPub,{0},{0},pModel->m_opList,nullptr,pModel}); return pModel; } diff --git a/src/NimBLEMeshNode.cpp b/src/NimBLEMeshNode.cpp index 02386fa..fcd3fbc 100644 --- a/src/NimBLEMeshNode.cpp +++ b/src/NimBLEMeshNode.cpp @@ -161,7 +161,7 @@ bool NimBLEMeshNode::start() { // Config server and primary health models are required in the primary element // create them here and add them as the first models. - m_configSrvModel = new bt_mesh_model{{BT_MESH_MODEL_ID_CFG_SRV},0,0,0,nullptr,{0},{0},bt_mesh_cfg_srv_op,&m_serverConfig}; + m_configSrvModel = new bt_mesh_model{{BT_MESH_MODEL_ID_CFG_SRV},0,0,0,nullptr,{0},{0},bt_mesh_cfg_srv_op,&bt_mesh_cfg_srv_cb,&m_serverConfig}; for(int i = 0; i < CONFIG_BT_MESH_MODEL_KEY_COUNT; i++) { m_configSrvModel->keys[i] = BT_MESH_KEY_UNUSED; }