Lines Matching refs:msg
59 bool Contexthub::setOsAppAsDestination(hub_message_t *msg, int hubId) { in setOsAppAsDestination() argument
66 msg->app_name = mCachedHubInfo[hubId].osAppName; in setOsAppAsDestination()
142 const ContextHubMsg &msg) { in sendMessageToHub() argument
147 if (!isValidHubId(hubId) || msg.msg.size() > UINT32_MAX) { in sendMessageToHub()
152 .app_name.id = msg.appName, in sendMessageToHub()
153 .message_type = msg.msgType, in sendMessageToHub()
154 .message_len = static_cast<uint32_t>(msg.msg.size()), // Note the check above in sendMessageToHub()
155 .message = static_cast<const uint8_t *>(msg.msg.data()), in sendMessageToHub()
181 hub_message_t msg; in reboot() local
183 if (setOsAppAsDestination(&msg, hubId) == false) { in reboot()
187 msg.message_type = CONTEXT_HUB_OS_REBOOT; in reboot()
188 msg.message_len = 0; in reboot()
189 msg.message = nullptr; in reboot()
191 if(mContextHubModule->send_message(hubId, &msg) != 0) { in reboot()
240 static bool isValidOsStatus(const uint8_t *msg, in isValidOsStatus() argument
245 rsp->result = msg[0]; in isValidOsStatus()
249 if (msg == nullptr || msgLen != sizeof(*rsp)) { in isValidOsStatus()
251 msg == nullptr ? 1 : 0, in isValidOsStatus()
256 memcpy(rsp, msg, sizeof(*rsp)); in isValidOsStatus()
264 const uint8_t *msg, in handleOsMessage() argument
277 if (isValidOsStatus(msg, msgLen, &rsp) && rsp.result == 0) { in handleOsMessage()
296 const hub_app_info *unalignedInfoAddr = reinterpret_cast<const hub_app_info *>(msg); in handleOsMessage()
382 ContextHubMsg msg; in contextHubCb() local
384 msg.appName = rxMsg->app_name.id; in contextHubCb()
385 msg.msgType = rxMsg->message_type; in contextHubCb()
386 msg.hostEndPoint = static_cast<uint16_t>(HostEndPoint::BROADCAST); in contextHubCb()
387 msg.msg = std::vector<uint8_t>(static_cast<const uint8_t *>(rxMsg->message), in contextHubCb()
391 cb->handleClientMsg(msg); in contextHubCb()
408 hub_message_t msg; in unloadNanoApp() local
410 if (setOsAppAsDestination(&msg, hubId) == false) { in unloadNanoApp()
416 msg.message_type = CONTEXT_HUB_UNLOAD_APP; in unloadNanoApp()
417 msg.message_len = sizeof(req); in unloadNanoApp()
418 msg.message = &req; in unloadNanoApp()
421 if(mContextHubModule->send_message(hubId, &msg) != 0) { in unloadNanoApp()
491 hub_message_t msg; in enableNanoApp() local
493 if (setOsAppAsDestination(&msg, hubId) == false) { in enableNanoApp()
499 msg.message_type = CONTEXT_HUB_APPS_ENABLE; in enableNanoApp()
500 msg.message_len = sizeof(req); in enableNanoApp()
502 msg.message = &req; in enableNanoApp()
504 if(mContextHubModule->send_message(hubId, &msg) != 0) { in enableNanoApp()
524 hub_message_t msg; in disableNanoApp() local
526 if (setOsAppAsDestination(&msg, hubId) == false) { in disableNanoApp()
532 msg.message_type = CONTEXT_HUB_APPS_DISABLE; in disableNanoApp()
533 msg.message_len = sizeof(req); in disableNanoApp()
535 msg.message = &req; in disableNanoApp()
537 if(mContextHubModule->send_message(hubId, &msg) != 0) { in disableNanoApp()
551 hub_message_t msg; in queryApps() local
553 if (setOsAppAsDestination(&msg, hubId) == false) { in queryApps()
560 msg.message = &payload; in queryApps()
561 msg.message_len = sizeof(payload); in queryApps()
562 msg.message_type = CONTEXT_HUB_QUERY_APPS; in queryApps()
564 if(mContextHubModule->send_message(hubId, &msg) != 0) { in queryApps()