htc: implement remaining htclow::HtclowManagerImpl funcs (mux impls pending)

This commit is contained in:
Michael Scire
2021-02-09 17:42:39 -08:00
committed by SciresM
parent e20c2450ce
commit 87165e0f08
11 changed files with 190 additions and 34 deletions

View File

@@ -228,4 +228,35 @@ namespace ams::htclow::mux {
}
}
void ChannelImpl::SetSendBuffer(void *buf, size_t buf_size, size_t max_packet_size) {
/* Set buffer. */
m_send_buffer.SetBuffer(buf, buf_size);
/* Determine true max packet size. */
if (m_config.flow_control_enabled) {
max_packet_size = std::min(max_packet_size, m_config.max_packet_size);
}
/* Set max packet size. */
m_send_buffer.SetMaxPacketSize(max_packet_size);
}
void ChannelImpl::SetReceiveBuffer(void *buf, size_t buf_size) {
/* Set the buffer. */
m_receive_buffer.Initialize(buf, buf_size);
}
void ChannelImpl::SetSendBufferWithData(const void *buf, size_t buf_size, size_t max_packet_size) {
/* Set buffer. */
m_send_buffer.SetReadOnlyBuffer(buf, buf_size);
/* Determine true max packet size. */
if (m_config.flow_control_enabled) {
max_packet_size = std::min(max_packet_size, m_config.max_packet_size);
}
/* Set max packet size. */
m_send_buffer.SetMaxPacketSize(max_packet_size);
}
}