Page 1 of 1

FrameID received wrong

Posted: Mon 20. May 2019, 15:25
by etixier

I am currently working with the PLIN api, in order to send and receive predefined messages through A PEAK. I have created an application that communicate with the peak. The peak is used as master and I have only one slave.
The communication works well, and I can send message and receive the response from my slave, and the datas contained the response are correct.
However, the frameID of the received message is wrong.
Here is my reception loop :

Code: Select all

void linObject::readMessages()
    TLINRcvMsg RcvMessage;
    TLINError error = 1;
        error = LIN_Read(handlerClient, &RcvMessage);
        if (RcvMessage.Type != mstStandard)
//            qDebug() << "message type wrong, Type = " <<RcvMessage.Type;
        if (error == 0)
            qDebug() << "frame_id " << RcvMessage.FrameId;
    }while (!(error & errRcvQueueEmpty));

Have I missed something ?

Thank you for your help,

Best regards,


Re: FrameID received wrong

Posted: Mon 20. May 2019, 16:11
by M.Maidhof

please note that LIN_Read() will return the protected frame identifier, and not the LIN frame ID. See LIN spec. for more details on how to convert protected ID to LIN frame ID (Example: LIN_frame_id = RcvMessage.FrameId & 0x3F)