Lines Matching refs:msg
55 bool Contexthub::setOsAppAsDestination(hub_message_t *msg, int hubId) { in setOsAppAsDestination() argument
62 msg->app_name = mCachedHubInfo[hubId].osAppName; in setOsAppAsDestination()
132 const ContextHubMsg &msg) { in sendMessageToHub() argument
133 if (!isValidHubId(hubId) || msg.msg.size() > UINT32_MAX) { in sendMessageToHub()
138 .app_name.id = msg.appName, in sendMessageToHub()
139 .message_type = msg.msgType, in sendMessageToHub()
140 .message_len = static_cast<uint32_t>(msg.msg.size()), // Note the check above in sendMessageToHub()
141 .message = static_cast<const uint8_t *>(msg.msg.data()), in sendMessageToHub()
155 if(NanoHub::sendToNanohub(hubId, &txMsg, 0, msg.hostEndPoint) != 0) { in sendMessageToHub()
200 static bool isValidOsStatus(const uint8_t *msg, in isValidOsStatus() argument
205 rsp->result = msg[0]; in isValidOsStatus()
209 if (msg == nullptr || msgLen != sizeof(*rsp)) { in isValidOsStatus()
211 msg == nullptr ? 1 : 0, in isValidOsStatus()
216 memcpy(rsp, msg, sizeof(*rsp)); in isValidOsStatus()
224 const uint8_t *msg, in handleOsMessage() argument
238 if (isValidOsStatus(msg, msgLen, &rsp) && rsp.result == 0) { in handleOsMessage()
257 const hub_app_info *unalignedInfoAddr = reinterpret_cast<const hub_app_info *>(msg); in handleOsMessage()
339 ContextHubMsg msg; in contextHubCb() local
341 msg.appName = rxMsg.app_name.id; in contextHubCb()
342 msg.msgType = rxMsg.message_type; in contextHubCb()
343 msg.hostEndPoint = rxMsg.message_endpoint; in contextHubCb()
344 msg.msg = std::vector<uint8_t>(static_cast<const uint8_t *>(rxMsg.message), in contextHubCb()
348 cb->handleClientMsg(msg); in contextHubCb()
361 hub_message_t msg; in unloadNanoApp() local
363 if (setOsAppAsDestination(&msg, hubId) == false) { in unloadNanoApp()
369 msg.message_type = CONTEXT_HUB_UNLOAD_APP; in unloadNanoApp()
370 msg.message_len = sizeof(req); in unloadNanoApp()
371 msg.message = &req; in unloadNanoApp()
375 &msg, in unloadNanoApp()
440 hub_message_t msg; in enableNanoApp() local
442 if (setOsAppAsDestination(&msg, hubId) == false) { in enableNanoApp()
448 msg.message_type = CONTEXT_HUB_APPS_ENABLE; in enableNanoApp()
449 msg.message_len = sizeof(req); in enableNanoApp()
451 msg.message = &req; in enableNanoApp()
454 &msg, in enableNanoApp()
471 hub_message_t msg; in disableNanoApp() local
473 if (setOsAppAsDestination(&msg, hubId) == false) { in disableNanoApp()
479 msg.message_type = CONTEXT_HUB_APPS_DISABLE; in disableNanoApp()
480 msg.message_len = sizeof(req); in disableNanoApp()
482 msg.message = &req; in disableNanoApp()
485 &msg, in disableNanoApp()
496 hub_message_t msg; in queryApps() local
498 if (setOsAppAsDestination(&msg, hubId) == false) { in queryApps()
505 msg.message = &payload; in queryApps()
506 msg.message_len = sizeof(payload); in queryApps()
507 msg.message_type = CONTEXT_HUB_QUERY_APPS; in queryApps()
510 &msg, in queryApps()