htclow: add Channel wrapper class

This commit is contained in:
Michael Scire
2021-02-10 22:52:12 -08:00
committed by SciresM
parent dec06ff649
commit 9fbbb9fadb
13 changed files with 388 additions and 4 deletions

View File

@@ -425,6 +425,17 @@ namespace ams::htclow::mux {
return ResultSuccess();
}
void ChannelImpl::SetConfig(const ChannelConfig &config) {
/* Check our state. */
R_ABORT_UNLESS(this->CheckState({ChannelState_Unconnectable, ChannelState_Connectable}));
/* Set our config. */
m_config = config;
/* Set flow control for our send buffer. */
m_send_buffer.SetFlowControlEnabled(m_config.flow_control_enabled);
}
void ChannelImpl::SetSendBuffer(void *buf, size_t buf_size, size_t max_packet_size) {
/* Set buffer. */
m_send_buffer.SetBuffer(buf, buf_size);