Skip to content

Commit 4b86bae

Browse files
authored
feat(hid-rp): Allow xbox battery report to have data set (#382)
1 parent 96edbbb commit 4b86bae

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/hid-rp/include/hid-rp-xbox.hpp

+8
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,14 @@ class XboxBatteryInputReport : public hid::report::base<hid::report::type::INPUT
385385
return std::vector<uint8_t>(report_data, report_data + report_size);
386386
}
387387

388+
/// Set the input report data from a vector of bytes
389+
/// \param data The data to set the input report to.
390+
constexpr auto set_data(const std::vector<uint8_t> &data) {
391+
// copy the data into our data array - skip the first byte, which is the
392+
// report id
393+
std::copy(data.begin(), data.end(), this->data() + 1);
394+
}
395+
388396
/// Get the report descriptor as a hid::rdf::descriptor
389397
/// \return The report descriptor as a hid::rdf::descriptor.
390398
/// \note This is an incomplete descriptor, you will need to add it to a

0 commit comments

Comments
 (0)