I am hoping that someone can help me out with this code as I hit a bit of a wall.
The plan for the code is capture the CAN packet that says the car is in reverse and then watch for the car to no longer go in reverse and the speed of the car goes over say 5 mph. The end goal is to turn on a front facing parking camera that will be located in my rear view mirror every time the car is put into reverse and leave it on until the car goes forward at some speed. This basically mimics how the front facing camera worked in a loaner Cadillac CT6.
I have found that on the SW CAN bus there is a packet that is sent out that changes the 2nd octet from 0x20 while in reverse to 0XF0 when not in reverse. The Id (in case anyone is wondering) is 0x1004A040. My best guess is that is what the gauge cluster is using to light up the R in the dash when the car is in reverse.
I started by taking the example code for sending a SMS when the emergency flashers are turned on. However, I ran into an issue in that it appears to be looking at a CAN packet that only contains the button press data. What is checks is “incoming.data.low == 192 //192 = C0 in dec”. I read through the due_can readme but unfortunately I didn’t really find anything to help me with this.
So, my question, as in the subject of this topic, how exactly do I find the value of a single octet inside of a CAN packet with a length (from SavvyCAN) of 7.
Thanks,
Douglas