AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/bacnet.c
void bacnet_task_timed(
    void)
{
    struct mstp_rx_packet *pkt = NULL;
    uint16_t pdu_len = 0;
    BACNET_ADDRESS src;

    pdu_len = dlmstp_receive(&src, &PDUBuffer[0], sizeof(PDUBuffer), 5);
    if (pdu_len) {
        pkt = (struct mstp_rx_packet *) Ringbuf_Data_Peek(&Receive_Queue);
        if (pkt) {
            memcpy(pkt->buffer, PDUBuffer, MAX_MPDU);
            bacnet_address_copy(&pkt->src, &src);
            pkt->length = pdu_len;
            Ringbuf_Data_Put(&Receive_Queue, pkt);
        }
    }
}
/**************************************************************************
* Description: handles recurring strictly timed task
* Returns: none
* Notes: called by ISR every 5 milliseconds
**************************************************************************/
handles recurring strictly timed task
Returns: none
Notes: called by ISR every 5 milliseconds
handles recurring strictly timed task Returns : none Notes : called by ISR every 5 milliseconds
void bacnet_task_timed(
    void)
{
    struct mstp_rx_packet *pkt = NULL;
    uint16_t pdu_len = 0;
    BACNET_ADDRESS src;
    pdu_len = dlmstp_receive(&src, &PDUBuffer[0], sizeof(PDUBuffer), 5);
    if (pdu_len) {
        pkt = (struct mstp_rx_packet *) Ringbuf_Data_Peek(&Receive_Queue);
        if (pkt) {
            memcpy(pkt->buffer, PDUBuffer, MAX_MPDU);
            bacnet_address_copy(&pkt->src, &src);
            pkt->length = pdu_len;
            Ringbuf_Data_Put(&Receive_Queue, pkt);
        }
    }
}
void bacnet_task_timed ( void ) { struct mstp_rx_packet * pkt = NULL ; uint16_t pdu_len = 0 ; BACNET_ADDRESS src ; pdu_len = dlmstp_receive ( & src , & PDUBuffer [ 0 ] , sizeof ( PDUBuffer ) , 5 ) ; if ( pdu_len ) { pkt = ( struct mstp_rx_packet * ) Ringbuf_Data_Peek ( & Receive_Queue ) ; if ( pkt ) { memcpy ( pkt -> buffer , PDUBuffer , MAX_MPDU ) ; bacnet_address_copy ( & pkt -> src , & src ) ; pkt -> length = pdu_len ; Ringbuf_Data_Put ( & Receive_Queue , pkt ) ; } } }
Description: handles recurring strictly timed task
Returns: none
Notes: called by ISR every 5 milliseconds
Description : handles recurring strictly timed task Returns : none Notes : called by ISR every 5 milliseconds