The LIN-TElegram has a protected Identifier Fild with a Frame-ID consisting of 6 bit, followed up by 2 Bits that build the two Parity bits.
The first Parity Bit P0
gets calculated like this:
Bit0 XOR Bit1 XOR Bit2 XOR Bit4
The second Parity Bit P1
gets calculated like this:
Bit1 XOR Bit3 XOR Bit4 XOR Bit5
Is there an easy way to test this in Python / Matlab? Or a simple mathematical solution on how to know how many bit errors can be caught by this mechanism?
I do not know if this question really belongs on SO, but I could not find a more fitting stackexchange
No.
For example for
Bit0 XOR Bit1 XOR Bit2 XOR Bit4
Bit1 XOR Bit3 XOR Bit4 XOR Bit5
it is clear that swapping the values of bits 1 and 4 will yield the same results.
Generally, parity bits only guarantee that exactly one bit error in the inputs will get caught, but if there are more, all bets are off.