Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ascii conversion w/ 7 bits
Message
 
To
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:
00742221
Views:
29
>>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.

Sorry but now I'm stuck w/ couple more things.
When constructing the data packet, do I just build a string containing all the binaries and chain them together, end to end? Such as: cData="100011010010001000011000" or do I put spaces or CR's between them? Or something entirely different?

And I assume when you say I need to add the last bit to send it as an even parity, so it's (8) digit of 0's & 1's that I need to send. Or do I need to send (7) 0's & 1's and then the receiving server add's the last bit?

And finally, how does one calculate a Longitudinal Redundancy Check of this packet?
Allen
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform