On 03.04.2008, at 17:05, Mike bug wrote:
> Thanks alot. This seems to work fine.  I have a small problem which  
> might seems stupid but i didnt manage to make this work:
>
>       int res;
>       const unsigned char artst[4]={1,2,3,4};
>
>       { Flio_Serial_Port* o = new Flio_Serial_Port(30,440,70,120);
>               res = o-> open("COM1", 19200);
>               printf ("\n\n\n COM1 = %d",res); //returns 0 so ok
>               printf ("\nDisp: %s",dispchar);
>               res = o-> write(artst,sizeof(artst));
>               printf ("\n\n\n COM1 = %d",res);  //returns -1
>       }
>
> I am doing something wrong when i am using the 'write' command.  
> Please help.


Well, depending on the platform that you are on, "errno" or  
GetLastErr() (or whatever it is called on Windows) will tell you what  
went wrong.

Likely, you just opened a regular file calle "COM1". The filename for  
MS-Windows serial ports is should be "\\.\COM1", and if you use this  
in a "C" -String, you must of course double all the backslashes, so  
the open command should call "\\\\.\\COM1".

Matthias

----
http://robowerk.com/


_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to