Encode a Connect Initial PDU :param stream: The destination stream to write into. :param pdu: the PDU to encode.
(self, stream: BytesIO, pdu: MCSConnectInitialPDU)
| 283 | stream.write(substream) |
| 284 | |
| 285 | def writeConnectInitial(self, stream: BytesIO, pdu: MCSConnectInitialPDU): |
| 286 | """ |
| 287 | Encode a Connect Initial PDU |
| 288 | :param stream: The destination stream to write into. |
| 289 | :param pdu: the PDU to encode. |
| 290 | """ |
| 291 | substream = BytesIO() |
| 292 | substream.write(ber.writeOctetString(pdu.callingDomain)) |
| 293 | substream.write(ber.writeOctetString(pdu.calledDomain)) |
| 294 | substream.write(ber.writeBoolean(pdu.upward)) |
| 295 | self.writeDomainParams(substream, pdu.targetParams) |
| 296 | self.writeDomainParams(substream, pdu.minParams) |
| 297 | self.writeDomainParams(substream, pdu.maxParams) |
| 298 | substream.write(ber.writeOctetString(pdu.payload)) |
| 299 | |
| 300 | data = substream.getvalue() |
| 301 | stream.write(ber.writeLength(len(data))) |
| 302 | stream.write(data) |
| 303 | |
| 304 | def writeConnectResponse(self, stream: BytesIO, pdu: MCSConnectResponsePDU): |
| 305 | """ |
nothing calls this directly
no test coverage detected