htc: implement mux side of connecting (and more)

This commit is contained in:
Michael Scire
2021-02-09 19:07:51 -08:00
committed by SciresM
parent 70aae4e27a
commit 42cf3f50d7
24 changed files with 474 additions and 12 deletions

View File

@@ -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;