It's my first time in this forum and I wanted to start with this question. For what I know, in C, a char data type is 8 bits long, but when you are using this data type in order to transmit ASCII information, is still 8 bits long but 1 bit is a parity bit, is that right?
And if that's correct, my question is, can you transmit an ASCII char to a receiver including the parity bit? Because if my code is: ..... char x=0b01111000; ..... it is received 'x', but if my code is: .... char x=0b11111000; .... it isn't received 'x', but the parity bit is in 1, and there are 4 '1' in my 'x' data, so I don't get when to use the parity bit or what I'm doing wrong. Thanks in advance for your answers!
.........................
Parity bits aren't normally visible to application code, they're used on the transport layer and are handled invisibly in the background. For example, RS-232, a common serial standard, can use parity bits but these never show up in the data stream itself, they're only visible if you inspect the actual electrical signals.
ASCII is a 7-bit encoding standard that doesn't include any sort of parity bits. If the upper-most bit is set on a character you've received, it's probably garbled or inadvertently UTF-8.
If you're having transmission errors, you should use something at least as reliable as a CRC to detect them, if not something more robust like SHA2-256 if you're sending larger amounts of data.