htc: implement mux side of connecting (and more)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user