Hello.
To what extent are you capable?
I could just send you a few lines of code right now, but you want to learn something, right?
On what hardware platform do you want to run the emulation?
You need something that executes the code for you, or for the car.
I currently don't have full access to my data because I am working on a Monday.
But logically, the information about the parking brake is included in the braking message, and that message has a checksum.
This will become a bit more technically complex, as you'll need to disconnect the CAN lines from the brake control unit and insert a small gateway device in between.
You intercept the signals from the brake system, manipulate them for the parking brake, and then retransmit them on the other side.
And with each transmission, a checksum and a 'keep-alive' counter must also be calculated.
If you don't have a Christmas tree in the cockpit, I would heed Rainer's suggestion: Screw it!
As far as I recall, the parking brake is located at address 0x5C0 within the powertrain CAN bus.
The message is 8 bytes long and fully occupied.
You need to handle 64 bits, maintain a keep-alive counter, and calculate a checksum.
And that happens every 20 milliseconds in the drive system.
My tip: Just let it go!
Felix.