Hi Floh,

Thanks for the update.
let me add some more information about my process.

I'm trying to open USB serial port(/dev/ttyUSB0)  using system call :


    int fd = open ("/dev/ttyUSB0", O_RDONLY); 
     if (fd == -1) 
    { 
      printf ("error %d opening: %s", errno,  strerror (errno)); 
       return 0; 
    }

I have created a simple application "port_open.cpp" inside that invoked the 
system call and compiled source file using emscripten which creats output  
a.out.js .

On execution of a.out.js using node ,getting an error " "No such Directory 
or file". "
Is there any way in Emscripten to open serial ports- ttyUSB*?

Note: I'm not using any HTML API's.

Regards,
Raman 

On Wednesday, September 30, 2015 at 7:44:27 PM UTC+5:30, Floh wrote:
>
> You generally can't directly access low-level operating system services 
> like /dev from a browser for security reasons. Some services may be wrapped 
> through HTML5 APIs (e.g. WebGL, WebAudio, WebRTC etc) and emscripten uses 
> those to emulate common low level APIs so that a lot of code can compile, 
> but I guess you're out of lack for directly accessing USB, and especially 
> /dev, which non-portable Linux concept.
>
> Googling for 'HTML5 USB' might provide more clues but I wouldn't get my 
> hopes up :)
>
> Cheers,
> -Floh.
>
> Am Mittwoch, 30. September 2015 09:37:04 UTC+2 schrieb Raman Sharma:
>>
>> Hi ,
>>
>> I have a USB device in Linux that uses the FTDI USB serial device 
>> converter driver. When I plug it in, it creates: /dev/ttyUSB0
>> I'm trying to open the enumerated port /dev/ttyUSB0 ,but getting an issue 
>> that "No such Directory or file".
>>
>> Note:
>> For testing purpose:
>> I have used EMBED feature to map the folder raman 
>> (/dev/raman/hello_word.txt) on virtual file system created by Emscripten 
>> and able to open a file(hello_word.txt) using fopen function.
>>
>> But when try to map /dev/ directory, compilation stuck for infinite 
>> without any exception.
>> Please provide inputs to open the port "/dev/ttyUSB0".
>>
>> TIA.
>>
>> Regards,
>> Raman 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to