Send error when data length was zero on CAN BUS

When I sent the CanMsg has data length is zero.

The write function return False, but the packet was sent successfully.

the Zero Length of data is usually used for sending RTR.

Please refer this URL : 녹화 2017 09 05 23 07 01 570 - YouTube

source Code :

canBuf.id    = rand() & 0x7FF;         // CAN frame ID
memcpy(canBuf.data, data, sizeof(data));
canBuf.dataLen = 0;

if (Can_Write(hCan, &canBuf))
{
    printf("\nCAN Transmit: Frame ID = 0x%x Remote/Data Frame = %s\nData:", canBuf.id, (canBuf.canMsgFlags & CanMsgFlags_RTR  ? "REMOTE" :  "DATA"));
    // display Transmit data
    for (i = 0; i < 8; i++)
    {
        printf(" %d", canBuf.data[i]);
    }
}
else
{
    printf("CAN Transmit error\r\n");
}

We found an issue about this specific scenario and we are going to fix it in the next release of our libraries and document it on our roadmap.