[sldev] Serial port errors
Carsten Juttner
carjay at gmx.net
Sun May 11 03:35:00 PDT 2008
Ajinkya Kale wrote:
> void LLAppViewer::idle()
> {
> LLSD info;
> LPWSTR portSerial = new WCHAR[MAX_PATH];
>
> //Get_Version_Str(info);
>
> info["COM1"] = ll_convert_wide_to_string(portSerial);
>
> HANDLE hSerial;
> hSerial =
> CreateFile(portSerial,GENERIC_READ|GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
The way it is quoted, portSerial is never initialized, so CreateFile
will receive some garbage characters as the device name to open.
Apart from that, like Robin said you cannot use a blocking call in
idle() since it will stall the viewer. Either use overlapped I/O or
create a different thread.
What do you want to use this for?
Regards,
Carsten
More information about the SLDev
mailing list