[email protected] wrote:
> Hello everybody, 
>
> again me, and again a question about resp. a problem using the serial port 
> /dev/ttyS0 of the foxboard... ;-)
>
> At the moment, I face the problem that I have to attach a device to the 
> serial port of the fox which makes intense use of the byte "0x00" (= some 
> strange ASCII character I can not write in here... ;-)). Unfortunatly, it 
> seems as if the foxboard (or perhaps the FOX Console I use for connecting the 
> device - which in that case "speaks" RS-232 - to the foxboard) simply ignores 
> the byte "0x00" when it arrives at the port. I also tested it using the 
> "ser_test"-tool, and there is the same problem: if I send the byte 0x01 or 
> "higher" (in that case directly from my PC over the serial connection), it 
> appears as an output of ser_test, but when I send a 0x00 (which in my opinion 
> represents valid character?), nothing happens :-(
>
> Has perhaps anyone else experienced this problem so so, and has an idea (or 
> at leat a workaround) for that problem? I can not avoid using the 0x00-byte 
> as it is used in the serial protocol of a device not programmed by me, so 
> that I have no change to change this. Is there perhaps the change that ttyS2 
> or ttyS3 will not have that problem? (I could not test this so far because I 
> would have to solder the connections to the board before - and to be honest: 
> I don't really want to do that because I'm not that great soldering expert... 
> ;))

Please show the code you use to initialise the serial port and the code 
you use to send the bytes to the device.
Could be that you did not set up the serial port for handling non-ascii 
stuff...
Does you code do something like this ? Google for non canonical mode.

 1  #include <termio.h>
 2
 3  extern struct termio old_term;
 4
 5  setup2(fid)
 6  int fid;
 7  {
 8        struct termio new_term;
 9
10       if (ioctl(fid, TCGETA, &old_term) == -1)
11        {
12                printf("ioctl get failed.\n");
13                exit(1);
14        }
15
16        new_term = old_term;
17        new_term.c_lflag &= ~ICANON;
18        new_term.c_cc[VMIN] = 0;
19        new_term.c_cc[VTIME] = 0;
20
21        if (ioctl(fid, TCSETA, &new_term) == -1)
22        {
23                printf("ioctl set failed.\n");
24                exit(1);
25        }
26  }

Good luck,
Edwin

Reply via email to