Lines Matching refs:len
68 …hub_app_name_t &appId, uint32_t evtId, uint16_t endpoint, const void *data, size_t len, int status) in dumpBuffer() argument
72 os << pfx << ": [ID=" << appId << "; SZ=" << std::dec << len; in dumpBuffer()
78 for (size_t i = 0; i < len; ++i) { in dumpBuffer()
87 static int rwrite(int fd, const void *buf, int len) in rwrite() argument
92 ret = write(fd, buf, len); in rwrite()
95 if (ret != len) { in rwrite()
102 static int rread(int fd, void *buf, int len) in rread() argument
107 ret = read(fd, buf, len); in rread()
165 int NanoHub::doSendToDevice(const hub_app_name_t name, const void *data, uint32_t len, uint32_t mes… in doSendToDevice() argument
167 if (len > MAX_RX_PACKET) { in doSendToDevice()
176 .len = static_cast<uint8_t>(len), in doSendToDevice()
182 memcpy(&msg.data[0], data, len); in doSendToDevice()
184 return rwrite(mFd, &msg, len + sizeof(msg.hdr)); in doSendToDevice()
266 uint32_t len = msg.raw.hdr.len; in runDeviceRx() local
268 if (len > MAX_RX_PACKET) { in runDeviceRx()
269 ALOGE("malformed packet with len %" PRIu32, len); in runDeviceRx()
274 if (ret == (int)(sizeof(msg.raw.hdr) + len)) { 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()
289 …RE) DEV -> APP", app_name, msg.chre.hdr.appEventId, msg.chre.hdr.endpoint, &msg.chre.data[0], len); in runDeviceRx()
291 …App(HubMessage(&app_name, msg.chre.hdr.appEventId, msg.chre.hdr.endpoint, &msg.chre.data[0], len)); in runDeviceRx()
294 …ected (%zu|%zu) bytes, read %d bytes", sizeof(msg.raw.hdr) + len, sizeof(msg.chre.hdr) + len, ret); in runDeviceRx()