Closed Vladislav-Lavrushkin closed 1 year ago
For information, 2 requests. The one on the right is understandable. The one on the left is not clear.
I begin to understand. The request does not consist of 5 bytes, but of 6 bytes. 57 CRC.
Now you need to understand how to send a request of 6 bytes:)
bool OBD9141::getlongPID(uint8_t pid, uint8_t mode, uint8_t return_length){
uint8_t message[6] = {0x68, 0x6A, 0xF1,0x22, mode, pid};
//
bool res = this->request(&message, 6, return_length+6);
// checksum is already checked, verify the PID.
if (this->buffer[5] != pid){
return false;
}
return res;
}
I added a function for a long request of 6 bytes. Also added a function for a long answer. I achieved what I wanted.
I was away from my computer for a few weeks, glad you got it to work by yourself, looks great!
The request method is public, so you could also use a helper function outside of the object, if you want to use the library unmodified. You can retrieve the buffer with readBuffer, which is also public. This is the first time I've seen a longer request, so I don't think there's much value in adding it to the library.
@Vladislav-Lavrushkin , is this issue good to be closed?
Yes, the topic can be closed.
Hello, My control unit has special modes and PID, how can I work with this with your library?
This is a request from the CASCADE 0.9.4 program.