htclow: add Channel wrapper class

This commit is contained in:
Michael Scire authored and SciresM committed 2021-02-24 04:06:54 -08:00
1 parent dec06ff649
commit 9fbbb9fadb
13 files changed
+388 -4

No files matched your search

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