Hi quex,
You can refer to the LPCopen sample code, check the ID, because the transfer ID and receive ID is defined by the code, you can know it.
Just like the LPCopen CAN0_IRQHandler code.

About the CCAN_STAT_TXOK and CCAN_STAT_RXOK question, you also can check it, but when you find it is set, you can clear it, then the next time, you will know the direction.
Before send and receive the CAN data, please do :
Chip_CCAN_ClearStatus(pCCAN, (CCAN_STAT_RXOK | CCAN_STAT_TXOK));
Then you can read the status in the interrupt routine, when the according bit is set, you can get the direction, then clear it immediately.
Wish it helps you!
If you still have question, please let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------