STM-can-api: Support reading of remote_msg

- Previously a received msg was fixed of data_type
pull/13565/head
m-ecry 2020-09-14 18:10:48 +02:00
parent 13b663397f
commit d0c8ad75e1
1 changed files with 1 additions and 1 deletions

View File

@ -405,7 +405,7 @@ int can_read(can_t *obj, CAN_Message *msg, int handle)
msg->format = CANExtended;
}
msg->id = RxHeader.Identifier;
msg->type = CANData;
msg->type = (RxHeader.RxFrameType == FDCAN_DATA_FRAME) ? CANData : CANRemote;
msg->len = RxHeader.DataLength >> 16; // see FDCAN_data_length_code value
return 1;