4.3 JNMMCANRx

This function receives a message on the selected CAN port.

int JNMMCANRx(int Can_fd, CANMESSAGE* msg);

Name

Description

Can_fd

received from JNMMCANOpen().

Pointer to CANMESSAGE structure

Can_ch : CAN port numer 0-3

Msg_type : 0 : Standard

1 : Extended

Msg_ID : Hexadecimel value

Msg_len : length of the frames

Rtr : 0 : Disable

1 : Enable

Data : Holds the data frame of message length

Return Value

Error code or 0.

Usage Example

For receiving the message.

memset(&rx,0,sizeof(CANMESSAGE));
ret = JNMMCANRx(device_handle,&Rx);
 
if(ret == -1)
{
   printf("JNMMCANRx failure \n");
}

Last updated