bemoss_lib/protocols/BACnet/bacnet-stack-0.8.2/test_proj/main.c
/* for the MS/TP state machine to use for getting data to send */
/* Return: amount of PDU data */
for the MS/TP state machine to use for getting data to send
Return: amount of PDU data
for the MS / TP state machine to use for getting data to send Return : amount of PDU data
uint16_t MSTP_Get_Send(
    volatile struct mstp_port_struct_t * mstp_port,
    unsigned timeout)
{       
    uint16_t pdu_len = 0;
    uint8_t destination = 0;    
    (void) timeout;
    if (!Transmit_Packet.ready) {
        return 0;
    }
    if (Transmit_Packet.address.mac_len == 1) {
        destination = Transmit_Packet.address.mac[0];
    } else {
        return 0;
    }
    if ((MAX_HEADER + Transmit_Packet.pdu_len) > MAX_MPDU) {
        return 0;
    }
    pdu_len = MSTP_Create_Frame(&mstp_port->OutputBuffer[0],    
        mstp_port->OutputBufferSize, Transmit_Packet.frame_type, destination,
        mstp_port->This_Station, &Transmit_Packet.pdu[0],
        Transmit_Packet.pdu_len);
    Transmit_Packet.ready = false;
    return pdu_len;
}
uint16_t MSTP_Get_Send ( volatile struct mstp_port_struct_t * mstp_port , unsigned timeout ) { uint16_t pdu_len = 0 ; uint8_t destination = 0 ; ( void ) timeout ; if ( ! Transmit_Packet . ready ) { return 0 ; } if ( Transmit_Packet . address . mac_len == 1 ) { destination = Transmit_Packet . address . mac [ 0 ] ; } else { return 0 ; } if ( ( MAX_HEADER + Transmit_Packet . pdu_len ) > MAX_MPDU ) { return 0 ; } pdu_len = MSTP_Create_Frame ( & mstp_port -> OutputBuffer [ 0 ] , mstp_port -> OutputBufferSize , Transmit_Packet . frame_type , destination , mstp_port -> This_Station , & Transmit_Packet . pdu [ 0 ] , Transmit_Packet . pdu_len ) ; Transmit_Packet . ready = false ; return pdu_len ; }
for the MS/TP state machine to use for getting data to send
Return: amount of PDU data
for the MS / TP state machine to use for getting data to send Return : amount of PDU data
/* milliseconds to wait for a packet */ /* destination address */ /* load destination MAC address */ /* convert the PDU into the MSTP Frame */ /* <-- loading this */