<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p>Hi Dirk,<br>
</p>
<div class="moz-cite-prefix">Am 06.03.20 um 23:32 schrieb Dirk
Hohndel:<br>
</div>
<blockquote type="cite"
cite="mid:0697B819-8F60-4734-91C5-5DF237643C72@hohndel.org">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
(oops. I dropped the mailing list by mistake)<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Mar 6, 2020, at 2:12 PM, Christof Arnosti
<<a href="mailto:charno@charno.ch" class=""
moz-do-not-send="true">charno@charno.ch</a>> wrote:</div>
<div class="">
<div class="">
<div class="moz-cite-prefix">Am 06.03.20 um 22:59 schrieb
Dirk Hohndel:<br class="">
</div>
<blockquote type="cite"
cite="mid:52540639-3E53-474E-AA31-5349AF52E4ED@hohndel.org"
class="">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252" class="">
<br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Mar 6, 2020, at 1:54 PM, Christof
Arnosti <<a href="mailto:charno@charno.ch"
class="" moz-do-not-send="true">charno@charno.ch</a>>
wrote:</div>
<div class="">
<blockquote type="cite" style="font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; orphans: auto;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; text-decoration:
none;" class="">No popup at all as no one has
that PID/VID registered. I can simply<br
class="">
add the PID/VID and see if it works. I'll play
with that later today.<br class="">
</blockquote>
<br style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none;" class="">
<span style="caret-color: rgb(0, 0, 0);
font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width:
0px; text-decoration: none; float: none;
display: inline !important;" class="">Also try
to register the different driver classes in</span><br
style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none;" class="">
<a
href="https://github.com/charno/subsurface/blob/android-serial-clean/android-mobile/src/org/subsurfacedivelog/mobile/AndroidSerial.java#L92"
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal;
orphans: auto; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px;" class=""
moz-do-not-send="true">https://github.com/charno/subsurface/blob/android-serial-clean/android-mobile/src/org/subsurfacedivelog/mobile/AndroidSerial.java#L92</a><span
style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none; float: none; display: inline !important;"
class="">.</span><br style="caret-color: rgb(0,
0, 0); font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width:
0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0);
font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width:
0px; text-decoration: none; float: none;
display: inline !important;" class="">The
classes can be found at</span><br
style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none;" class="">
<a
href="https://github.com/mik3y/usb-serial-for-android/tree/master/usbSerialForAndroid/src/main/java/com/hoho/android/usbserial/driver"
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal;
orphans: auto; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px;" class=""
moz-do-not-send="true">https://github.com/mik3y/usb-serial-for-android/tree/master/usbSerialForAndroid/src/main/java/com/hoho/android/usbserial/driver</a><span
style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none; float: none; display: inline !important;"
class="">.</span><br style="caret-color: rgb(0,
0, 0); font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal;
text-align: start; text-indent: 0px;
text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width:
0px; text-decoration: none;" class="">
</div>
</blockquote>
<div class=""><br class="">
</div>
ok</div>
<div class=""><br class="">
<blockquote type="cite" class="">
<blockquote type="cite" style="font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing:
0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; text-decoration:
none;" class="">
<blockquote type="cite" class="">Can you maybe
plug your Mares Icon HD into a computer and give
me some<br class="">
lsusb and dmesg-output so I can try to guess
which vid/pid and driver is<br class="">
used?<br class="">
</blockquote>
VID/PID is 0xFFFF/0x0005:<br class="">
<br class="">
03-06 13:39:52.669 1342 1869 D UsbHostManager:
USB device attached: vidpid ffff:0005
mfg/product/ver/serial
SERUSB/USBSerial/1.00/01234567
hasAudio/HID/Storage: false/false/false<br
class="">
03-06 13:39:52.673 1342 1869 D
UsbDeviceDescriptor: 1 configs<br class="">
03-06 13:39:52.674 1342 1869 D UsbHostManager:
Added device
UsbDevice[mName=/dev/bus/usb/001/002,mVendorId=65535,mProductId=5,mClass=2,mSubclass=0,mProtocol=0,mManufacturerName=SERUSB,mProductName=USBSerial,mVersion=1.00,mSerialNumberReader=com.android.server.usb.UsbSerialReader@9967699,mConfigurations=[<br
class="">
03-06 13:39:52.674 1342 1869 D UsbHostManager:
UsbConfiguration[mId=2,mName=null,mAttributes=192,mMaxPower=250,mInterfaces=[<br
class="">
03-06 13:39:52.674 1342 1869 D UsbHostManager:
UsbInterface[mId=0,mAlternateSetting=0,mName=null,mClass=2,mSubclass=2,mProtocol=0,mEndpoints=[<br
class="">
03-06 13:39:52.674 1342 1869 D UsbHostManager:
UsbEndpoint[mAddress=130,mAttributes=3,mMaxPacketSize=8,mInterval=10]]<br
class="">
03-06 13:39:52.674 1342 1869 D UsbHostManager:
UsbInterface[mId=1,mAlternateSetting=0,mName=null,mClass=10,mSubclass=0,mProtocol=0,mEndpoints=[<br
class="">
03-06 13:39:52.674 1342 1869 D UsbHostManager:
UsbEndpoint[mAddress=1,mAttributes=2,mMaxPacketSize=64,mInterval=0]<br
class="">
03-06 13:39:52.674 1342 1869 D UsbHostManager:
UsbEndpoint[mAddress=129,mAttributes=2,mMaxPacketSize=64,mInterval=0]]]]<br
class="">
<br class="">
<br class="">
(this is adb logcat over tcp of plugging the Icon
HD into my Android phone)<br class="">
</blockquote>
<span style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none; float: none; display: inline !important;"
class="">If you have a linux computer at hand I
would be interested which driver</span><br
style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none; float: none; display: inline !important;"
class="">is used by the kernel. This might give
some insight if it's implemented</span><br
style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none; float: none; display: inline !important;"
class="">in usb-serial-for-android and just not
registred, or if the driver is</span><br
style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration:
none; float: none; display: inline !important;"
class="">missing.</span></blockquote>
<br class="">
</div>
<div class="">
<div class="">[2382095.960170] usb 2-1.2: new
full-speed USB device number 4 using ehci-pci</div>
<div class="">[2382096.041381] usb 2-1.2: New USB
device found, idVendor=ffff, idProduct=0005,
bcdDevice= 1.00</div>
<div class="">[2382096.041388] usb 2-1.2: New USB
device strings: Mfr=1, Product=2, SerialNumber=3</div>
<div class="">[2382096.041392] usb 2-1.2: Product:
USBSerial</div>
<div class="">[2382096.041395] usb 2-1.2:
Manufacturer: SERUSB</div>
<div class="">[2382096.041398] usb 2-1.2:
SerialNumber: 01234567</div>
<div class="">[2382096.089122] cdc_acm 2-1.2:2.0:
ttyACM0: USB ACM device</div>
<div class="">[2382096.089748] usbcore: registered new
interface driver cdc_acm</div>
<div class="">[2382096.089750] cdc_acm: USB Abstract
Control Model driver for USB modems and ISDN
adapters</div>
<div class=""><br class="">
</div>
<div class="">This is from a Linux laptop</div>
</div>
</blockquote>
<p class="">There is a driver with CdcAcmSerialDriver in
usb-serial-for-android!</p>
<p class="">That's exactly the use case I had in mind when
I proposed driverclass-selection in the UI ;-)</p>
</div>
</div>
</blockquote>
<br class="">
</div>
<div>I understand - but Subsurface-mobile would never ever get
access to this if we don't claim the PID/VID correct?</div>
<div>That's been my point here... even if you add that
driverclass... how would Subsurface-mobile get access to that
device in the first place?</div>
<div>Maybe I'm just misunderstanding how this is supposed to work.</div>
</blockquote>
<p>If I understand correctly, the device_filter.xml is only
necessary to get the popup which then leads to the download-page.
<br>
</p>
<p>In the Java code, all devices known to UsbManager are compared by
PID/VID by UsbSerialProber (from usb-serial-for-android). When
there's a match there is a check if we have permission to use this
device, and if not the permission is requested. Then the device is
used.</p>
<p>If we do the UsbManager-stuff beforehand to populate the
device-list (and then pass the selecte usb device to Java
android_serial_open) we don't need the UsbSerialProber to check
the attached device, but only to find the correct driver class. If
the driver class is also passed to android_serial_open we can
leave out the whole UsbSerialProber-Stuff and directly instantiate
the driver class with the passed usb device. With all this it's
still possible to check and request for permission to access the
device at runtime.</p>
<p>I didn't consciously check for devices not entered in the
device_filter.xml, but I entered "my" PID/VID pair quite late in
the development cycle. I also have seen and used the "ask
permission" popup which happens when a device not in
device_filter.xml is used. I will test this tomorrow by removing
"my" entry from the device_filter.xml.<br>
</p>
<blockquote type="cite"
cite="mid:0697B819-8F60-4734-91C5-5DF237643C72@hohndel.org">
<div><br class="">
</div>
<div>/D</div>
</blockquote>
Best regards<br>
Christof<br>
<blockquote type="cite"
cite="mid:0697B819-8F60-4734-91C5-5DF237643C72@hohndel.org">
<div><br class="">
</div>
<br class="">
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
subsurface mailing list
<a class="moz-txt-link-abbreviated" href="mailto:subsurface@subsurface-divelog.org">subsurface@subsurface-divelog.org</a>
<a class="moz-txt-link-freetext" href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface">http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface</a>
</pre>
</blockquote>
</body>
</html>