Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ascii conversion w/ 7 bits
Message
From
15/01/2003 14:48:12
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00741726
Message ID:
00742074
Views:
25
>Hi Hilmar,
>I'm not sure what that means. I am in need of transmitting a sequence of ascii characters to a web server that requires the message be as such (from their doc):
>The raw binary packet must be formatted in 7 data bits/1 parity/even parity.
>
>This seems to be similar to the older methods of data communications that one would have needed to use of com port transmissions to a modem. Isn't that something that would be possible and resources of information on it's creation be available?

Of course, but I just recited what I knew from memory, and didn't take the trouble to research what I was missing.

OK, I will do up for that now. Researching www.pcwebopedia.com (http://www.pcwebopedia.com/TERM/p/parity_checking.html), it seems that the parity bit must be added to the end.

Now, let me give an example. You want to transmit 7 data bits at a time:
0100110
1101100
1010101
0101010
You have to add an eighth bit (the parity bit). Apparently, you have to add the extra bit at the end. The bit should be either a 1 or a 0: the idea is to make the number of 1's even (since we are talking about "even parity").
01001101
11011000
10101010
01010101
Note that now, each byte has an even number of 1's.

I suspect that the system is designed to transmit only low-order ASCII codes, that is, only a plain text, and not even diacriticals and other special symbols that appear above the value 127.

To manipulate data this way requires bit-manipulation functions, like bitand(), bitor(), bitnot(), bitxor(), bittest().

HTH, and available for further clarifications.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform