Lines Matching refs:buffer
32 bool HardwareVersionInfo::Populate(const std::vector<uint8_t>& buffer) { in Populate() argument
33 if (buffer.size() != sizeof(VersionInfo)) { in Populate()
37 const uint8_t *data = buffer.data(); in Populate()
51 char buffer[1024]; in ToString() local
52 snprintf(buffer, sizeof(buffer), format_string, in ToString()
58 return std::string(buffer); in ToString()
66 char buffer[128]; in ToString() local
67 snprintf(buffer, sizeof(buffer), format_string, in ToString()
69 return std::string(buffer); in ToString()
72 bool WriteEventResponse::Populate(const std::vector<uint8_t>& buffer) { in Populate() argument
73 if (buffer.size() != sizeof(Response)) { in Populate()
77 const uint8_t *data = buffer.data(); in Populate()
87 std::vector<uint8_t> buffer(sizeof(Request)); in GetBytes() local
89 uint8_t *data = buffer.data(); in GetBytes()
92 return buffer; in GetBytes()
98 char buffer[128]; in ToString() local
99 snprintf(buffer, sizeof(buffer), format_string, in ToString()
101 return std::string(buffer); in ToString()
107 char buffer[32]; in ToString() local
108 snprintf(buffer, sizeof(buffer), "ReadEventResponse %u\n", GetEventType()); in ToString()
109 return std::string(buffer); in ToString()
113 const std::vector<uint8_t>& buffer) { in FromBytes() argument
116 uint32_t event_type = ReadEventResponse::EventTypeFromBuffer(buffer); in FromBytes()
118 return SensorEvent::FromBytes(buffer); in FromBytes()
120 return AppToHostEvent::FromBytes(buffer); in FromBytes()
122 return ResetReasonEvent::FromBytes(buffer); in FromBytes()
124 return LogEvent::FromBytes(buffer); in FromBytes()
131 bool ReadEventResponse::Populate(const std::vector<uint8_t>& buffer) { in Populate() argument
132 if (buffer.size() < sizeof(Event)) { in Populate()
136 event_data.resize(buffer.size()); in Populate()
137 std::copy(buffer.begin(), buffer.end(), event_data.begin()); in Populate()
178 uint32_t ReadEventResponse::EventTypeFromBuffer(const std::vector<uint8_t>& buffer) { in EventTypeFromBuffer() argument
179 if (buffer.size() < sizeof(uint32_t)) { in EventTypeFromBuffer()
180 LOGW("Invalid/short event of size %zu", buffer.size()); in EventTypeFromBuffer()
183 return *reinterpret_cast<const uint32_t *>(buffer.data()); in EventTypeFromBuffer()
202 std::vector<uint8_t> buffer(sizeof(Configuration)); in GetBytes() local
204 uint8_t *data = buffer.data(); in GetBytes()
207 buffer.insert(buffer.end(), extra_data_.begin(), extra_data_.end()); in GetBytes()
209 return buffer; in GetBytes()
224 char buffer[1024]; in ToString() local
225 snprintf(buffer, sizeof(buffer), format_string, in ToString()
231 return std::string(buffer); in ToString()
245 std::vector<uint8_t> buffer(sizeof(VersionInfoRequestEvent)); in GetBytes() local
247 std::fill(buffer.begin(), buffer.end(), 0); in GetBytes()
248 auto event = reinterpret_cast<VersionInfoRequestEvent *>(buffer.data()); in GetBytes()
254 return buffer; in GetBytes()