avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] “Not a typewriter” avrdude err or on Android


From: Anton Smirnov
Subject: Re: [avrdude-dev] “Not a typewriter” avrdude err or on Android
Date: Mon, 10 Jun 2013 17:23:44 +0600

> If you get an ENOTTY on setting the baudrate, it would mean your
driver (the part of the operating system that provides the virtual
serial port device) is broken/incomplete.

that's bad as i tested on few devices of few manufacturers on different
android os versions..
is there any work around for it (without rooting)?

> What I don't understand: a "file descriptor" is a small integer
number, as returned by the open() syscall.

In my case file descriptor is also int value which originally received in
android app (java vm) using UsbDeviceConnection.getFIleDescriptor() which
is written to return file descriptor for native code specially.
then i pass it to avrdude and since it's child process and file descriptors
are process-related i have to use unix socket.

so i just pass it from android app to native code (via JNI), which creates
thread and pass it using socket.
then i execute modified avrdude executable using socket address and read
file descriptor from the socket and pass it to serial_device which in my
case just use this file descriptor instead of executing open() syscall

i can share the code if needed (some code snippets are in question on
stackoverflow)


2013/6/10 Joerg Wunsch <address@hidden>

> As Anton Smirnov wrote:
>
> > This relates to Arduino boards and they have bootloader which talks over
> > USB using stk500v1/v2 and uploads firmware itself.
>
> OK, they indeed use a serial device emulation.
>
> If you get an ENOTTY on setting the baudrate, it would mean your
> driver (the part of the operating system that provides the virtual
> serial port device) is broken/incomplete.
>
> > > > I'm getting file descriptor for usb device on android, grant
> > > > permissions and pass usb device file descriptor to avrdude process
> > > > and getting "Now a typewriter" error in ser_posix while trying to
> > > > set baud rate.
>
> What I don't understand: a "file descriptor" is a small integer
> number, as returned by the open() syscall.  You cannot really pass
> such a file descriptor to AVRDUDE since AVRDUDE must obtain one
> itself.
>
> So, what's your actual commandline you call AVRDUDE with?
>
> --
> cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL
>
> http://www.sax.de/~joerg/
> Never trust an operating system you don't have sources for. ;-)
>
> _______________________________________________
> avrdude-dev mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/avrdude-dev
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]