htc: implement mux side of connecting (and more)

This commit is contained in:
Michael Scire authored and SciresM committed 2021-02-24 04:06:54 -08:00
1 parent 70aae4e27a
commit 42cf3f50d7
24 files changed
+474 -12

No files matched your search

@@ -19,6 +19,11 @@
namespace ams::htclow::mux {
SendBuffer::~SendBuffer() {
m_ring_buffer.Clear();
this->Clear();
}
bool SendBuffer::IsPriorPacket(PacketType packet_type) const {
return packet_type == PacketType_MaxData;
}
@@ -94,6 +99,17 @@ namespace ams::htclow::mux {
return true;
}
void SendBuffer::AddPacket(std::unique_ptr<Packet, PacketDeleter> ptr) {
/* Get the packet. */
auto *packet = ptr.release();
/* Check the packet type. */
AMS_ABORT_UNLESS(this->IsPriorPacket(packet->GetHeader()->packet_type));
/* Add the packet. */
m_packet_list.push_back(*packet);
}
void SendBuffer::RemovePacket(const PacketHeader &header) {
/* Get the packet type. */
const auto packet_type = header.packet_type;