@egarl004 and @cyclin_al1,
Sorry for the late reply, just saw your messages now. This is what I needed to use to construct the request message:
CANMessage message;
message.id = 0x18DB33F1;
message.len = 8; // message will always be 8 bytes
message.extended = true;
message.data[0] = 0x02; // 2 bytes of data in message
message.data[1] = 0x01; // Get current data
message.data[2] = pid; // The PID to retrieve (replace with appropriate hex value for the PID)
message.data[3] = 0x09; // Not sure why, but the last 5 bytes need to be set this way
message.data[4] = 0x13;
message.data[5] = 0x00;
message.data[6] = 0x20;
message.data[7] = 0xE0;
When waiting for the response, a quick way to filter out most/all of the garbage is to just look for anything with an ID above 7DF:
const auto REPLY_ID_MIN = 0x7DF;
if (replyMessage.id >= REPLY_ID_MIN)
{
// Probably the response; log detailsā¦
}
My vehicle never seems to send messages above 7DF unless itās a diagnostic response. You can probably also use the canFilter() method to limit the received messages but I couldnāt tell you offhand how to populate it in this case.
Hope this helps.
Mike