[sldev] Serial port errors

Ajinkya Kale kaleajinkya at gmail.com
Sun May 11 03:40:06 PDT 2008


In which function can I poll for serial port data in the SL source code. I
want to poll for data only when the user is logged in so that I can write
the serial port data to the chat bar.

On Sun, May 11, 2008 at 3:35 AM, Carsten Juttner <carjay at gmx.net> wrote:

> 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
>
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html
>



-- 
Ciao,
Ajinkya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/sldev/attachments/20080511/2d54b307/attachment.htm


More information about the SLDev mailing list