Serial comm differences between PC & Mac?
Dar Scott
dsc at swcp.com
Thu Dec 2 19:33:32 EST 2004
On Dec 2, 2004, at 4:50 PM, Dar Scott wrote:
>> Regarding char, I'm not getting good results using it.
>
> Well, I can learn. I did some quick tests and I think you might be
> right. In a quick test, I dropped characters with char and did not
> with int1. Weird.
>
> With int1, all looked good. I sent out all 256 codes using
> numToChar(), that is, 0 to 255, and read them back in using uint1 and
> got what I expected: 0 to 127 and then -128 to -1
>
> This was on Windows XP using the built-in com1: on my PC.
I tried the tests on OS X. For char I still lost some characters. I
actually lost a little more. All chars after the first LF are thrown
away. This is with binary update!
For uint1, I ran into several problems. The read would read random
chars that aren't there. Also, the characters with codes 10, 11 and 12
are garbled. The characters with codes 254 and 255 are often garbled.
My test sent all codes in order so that might affect which ones got
garbled. I think the last two bytes got lost so that is why those got
garbled; the read got data that was not real.
I'm using a keyspan USA-19QW on the Mac. All tests opened for binary
update.
At this point, I would trust the PC results over the Mac results.
BUT... I went back and changed my PC test and... Yes. uint will input
garbage data.
Maybe those "control characters" are not real?
Dar
****************************************
Dar Scott Consulting
http://www.swcp.com/dsc/
Programming Services
****************************************
More information about the use-livecode
mailing list