fn send_pdata_header(&mut self, data_len: u32, is_last: bool) -> std::io::Result<()> {
        let mut message_header = 0x00;
        if is_last {
            message_header |= 0x02;
        }

        let pdu_len_bytes = (data_len + 2 + 4).to_be_bytes();
        let data_len_bytes = (data_len + 2).to_be_bytes();
        let header = [
            // PDU-type + reserved byte
            0x04,
            0x00,
            // full PDU length
            pdu_len_bytes[0],
            pdu_len_bytes[1],
            pdu_len_bytes[2],
            pdu_len_bytes[3],
            // presentation data length (data + 2 properties below)
            data_len_bytes[0],
            data_len_bytes[1],
            data_len_bytes[2],
            data_len_bytes[3],
            // presentation context id
            self.presentation_context_id,
            // message control header
            message_header,
        ];

        self.stream.write_all(&header)
    }
/// Send the header of a single P-Data PDU,
/// containing a single data fragment.
Send the header of a single P-Data PDU,
containing a single data fragment.
Send the header of a single P - Data PDU containing a single data fragment .
fn send_pdata_header(&mut self, data_len: u32, is_last: bool) -> std::io::Result<()> {
        let mut message_header = 0x00;
        if is_last {
            message_header |= 0x02;
        }
        let pdu_len_bytes = (data_len + 2 + 4).to_be_bytes();
        let data_len_bytes = (data_len + 2).to_be_bytes();
        let header = [
            // PDU-type + reserved byte
            0x04,
            0x00,
            // full PDU length
            pdu_len_bytes[0],
            pdu_len_bytes[1],
            pdu_len_bytes[2],
            pdu_len_bytes[3],
            // presentation data length (data + 2 properties below)
            data_len_bytes[0],
            data_len_bytes[1],
            data_len_bytes[2],
            data_len_bytes[3],
            // presentation context id
            self.presentation_context_id,
            // message control header
            message_header,
        ];
        self.stream.write_all(&header)
    }
fn send_pdata_header ( & mut self , data_len : u32 , is_last : bool ) -> std :: io :: Result < ( ) > { let mut message_header = 0x00 ; if is_last { message_header |= 0x02 ; } let pdu_len_bytes = ( data_len + 2 + 4 ) . to_be_bytes ( ) ; let data_len_bytes = ( data_len + 2 ) . to_be_bytes ( ) ; let header = [ // PDU-type + reserved byte 0x04 , 0x00 , // full PDU length pdu_len_bytes [ 0 ] , pdu_len_bytes [ 1 ] , pdu_len_bytes [ 2 ] , pdu_len_bytes [ 3 ] , // presentation data length (data + 2 properties below) data_len_bytes [ 0 ] , data_len_bytes [ 1 ] , data_len_bytes [ 2 ] , data_len_bytes [ 3 ] , // presentation context id self . presentation_context_id , // message control header message_header , ] ; self . stream . write_all ( & header ) }
Send the header of a single P-Data PDU,
containing a single data fragment.
Send the header of a single P - Data PDU containing a single data fragment .
&mut self
data_len
u32
is_last
bool
&mut self
data_len
u32
is_last
bool