Home | History | Annotate | Download | only in fastboot

Lines Matching defs:bytes

60 static uint16_t ExtractUint16(const uint8_t* bytes) {
61 return (static_cast<uint16_t>(bytes[0]) << 8) | bytes[1];
71 const uint8_t* bytes() const { return bytes_; }
119 // Sends |length| bytes from |data| and waits for the response packet up to |attempts| times.
121 // Excess bytes that cannot fit in |rx_data| are dropped.
122 // On success, returns the number of response data bytes received, which may be greater than
168 // The first two bytes contain the next expected sequence number.
183 // The first two data bytes contain the version, the second two bytes contain the target max
184 // supported packet size, which must be at least 512 bytes.
228 ssize_t bytes = SendSinglePacketHelper(&header, tx_data, packet_data_length, rx_data,
233 if (bytes == -1) {
235 } else if (static_cast<size_t>(bytes) < rx_length) {
236 rx_data += bytes;
237 rx_length -= bytes;
246 ret += bytes;
260 if (!socket_->Send({{header->bytes(), kHeaderSize}, {tx_data, tx_length}})) {
266 ssize_t bytes = 0;
268 bytes = socket_->Receive(rx_packet_.data(), rx_packet_.size(), kResponseTimeoutMs);
269 if (bytes == -1) {
275 } else if (bytes < static_cast<ssize_t>(kHeaderSize)) {
289 error->append(rx_packet_.data() + kHeaderSize, rx_packet_.data() + bytes);
291 total_data_bytes += bytes - kHeaderSize;
292 size_t rx_data_bytes = std::min<size_t>(bytes - kHeaderSize, rx_length);
330 ssize_t bytes = SendData(kIdFastboot, nullptr, 0, reinterpret_cast<uint8_t*>(data), length,
333 if (bytes == -1) {
336 } else if (static_cast<size_t>(bytes) > length) {
343 return bytes;
348 ssize_t bytes = SendData(kIdFastboot, reinterpret_cast<const uint8_t*>(data), length, nullptr,
351 if (bytes == -1) {
354 } else if (bytes > 0) {