Calculate Block Check Character (BCC) for serial communication
I am communicating with a device via serial via the SerialPort class of .NET and based on third-party device specification requirements I need to calculate a "block check character". The only information I am told is that it is an exclusive OR operation (XOR) and it must be performed over all characters. So if I have the string "Bob,001" how would one calculate the BCC? Most likely is character based XOR. You'll need to get samples of them to verify but most checksums usually end up at 0. So, for an XOR checksum, you would have the packet: Bob,001X where X is the checksum and, when you XOR all