Lines Matching refs:msg

172     nano_message_chre msg = {  in doSendToDevice()  local
182 memcpy(&msg.data[0], data, len); in doSendToDevice()
184 return rwrite(mFd, &msg, len + sizeof(msg.hdr)); in doSendToDevice()
187 void NanoHub::doSendToApp(HubMessage &&msg) in doSendToApp() argument
190 mAppTxQueue.push_back((HubMessage &&)msg); in doSendToApp()
254 nano_message msg; in runDeviceRx() local
256 ret = rread(mFd, &msg, sizeof(msg)); in runDeviceRx()
261 if (ret < (int)sizeof(msg.raw.hdr)) { in runDeviceRx()
266 uint32_t len = msg.raw.hdr.len; in runDeviceRx()
274 if (ret == (int)(sizeof(msg.raw.hdr) + len)) { in runDeviceRx()
275 ret = SystemComm::handleRx(&msg.raw); in runDeviceRx()
277 hub_app_name_t app_name = { .id = msg.raw.hdr.appId }; in runDeviceRx()
279 … dumpBuffer("(RAW) DEV -> APP", app_name, msg.raw.hdr.eventId, 0, &msg.raw.data[0], len); in runDeviceRx()
281 …doSendToApp(HubMessage(&app_name, msg.raw.hdr.eventId, ENDPOINT_BROADCAST, &msg.raw.data[0], len)); in runDeviceRx()
284 } else if (ret == (int)(sizeof(msg.chre.hdr) + len)) { in runDeviceRx()
285 ret = SystemComm::handleRx(&msg.chre); in runDeviceRx()
287 hub_app_name_t app_name = { .id = msg.chre.hdr.appId }; in runDeviceRx()
289 …dumpBuffer("(CHRE) DEV -> APP", app_name, msg.chre.hdr.appEventId, msg.chre.hdr.endpoint, &msg.chr… in runDeviceRx()
291 …doSendToApp(HubMessage(&app_name, msg.chre.hdr.appEventId, msg.chre.hdr.endpoint, &msg.chre.data[0… in runDeviceRx()
294 …ALOGE("Expected (%zu|%zu) bytes, read %d bytes", sizeof(msg.raw.hdr) + len, sizeof(msg.chre.hdr) +… in runDeviceRx()
408 int NanoHub::doSendToNanohub(uint32_t hub_id, const hub_message_t *msg, uint32_t transaction_id, ui… in doSendToNanohub() argument
421 if (!msg || !msg->message) { in doSendToNanohub()
424 } else if (get_hub_info()->os_app_name == msg->app_name) { in doSendToNanohub()
427 … dumpBuffer("APP -> HAL", msg->app_name, msg->message_type, 0, msg->message, msg->message_len); in doSendToNanohub()
429 ret = SystemComm::handleTx(msg, transaction_id); in doSendToNanohub()
430 } else if (msg->message_len > MAX_RX_PACKET) { in doSendToNanohub()
435 …dumpBuffer("APP -> DEV", msg->app_name, msg->message_type, endpoint, msg->message, msg->message_le… in doSendToNanohub()
437 … ret = doSendToDevice(msg->app_name, msg->message, msg->message_len, msg->message_type, endpoint); in doSendToNanohub()