From 7f4450f930d9bc141c777e32fd1c6ec5cbfef6e8 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 16 Oct 2023 17:31:09 -0400 Subject: [PATCH] haze: pretend to be able to write MTP server code --- .../haze/source/ptp_responder_mtp_operations.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/troposphere/haze/source/ptp_responder_mtp_operations.cpp b/troposphere/haze/source/ptp_responder_mtp_operations.cpp index 46fc824c2..eea3e5f4f 100644 --- a/troposphere/haze/source/ptp_responder_mtp_operations.cpp +++ b/troposphere/haze/source/ptp_responder_mtp_operations.cpp @@ -257,10 +257,21 @@ namespace haze { return property_code == -1 || code == property_code; }; + /* Determine how many output elements we will report. */ + u32 num_output_elements = 0; + for (const auto obj_property : SupportedObjectProperties) { + if (ShouldIncludeProperty(obj_property)) { + num_output_elements++; + } + } + /* Begin writing the requested object properties. */ PtpDataBuilder db(m_buffers->usb_bulk_write_buffer, std::addressof(m_usb_server)); R_TRY(db.WriteVariableLengthData(m_request_header, [&] { + /* Report the number of elements. */ + R_TRY(db.Add(num_output_elements)); + for (const auto obj_property : SupportedObjectProperties) { if (!ShouldIncludeProperty(obj_property)) { continue;