Subsurface-mobile dc downloads

Anton Lundin glance at acc.umu.se
Wed Jan 6 12:20:57 PST 2016


On 06 January, 2016 - Dirk Hohndel wrote:

> On Wed, Jan 06, 2016 at 12:27:23PM +0200, Willem Ferguson wrote:
> > Dirk,
> > 
> > Two issues.
> > 1) In the old days many phones only acted as mass storage devices and did
> > not have the ability to act as USB bus master or host. I did a bit of
> > hunting round the Internet and it looks like Android devices after 3.1 can
> > act as bus masters or OTG hosts. Do you have more specific information about
> > this at all? and iOS? I ask this because I assume that bus mastering is
> > critical to communicate with a dive computer.
> 
> It's not so much about bus mastering, it's about how the connector is
> wired. You need to provide power TO the connector if you want to be a USB
> host instead of just a USB gadget. It seems about half of the phones
> support this, with a higher share in the higher end phones, but it's
> actually fairly random. Search for USB OTG (on the go). You also need a
> small adapter cable.
> I have a couple of these cables and four out of my five Android devies
> support USB OTG.
> 

A USB OTG cable contains some resistors to tell the phone to switch its
usb chip into host mode.

Subsurface currently support DC's that act as USB mass storage devices
and devices which use ftdi chips in the device or in its cable. In
theory the libdivecomputer backends which use libusb directly should
work to, if we add the vid and pid to the manifest. I should clobber up
a patch for that.

There are numerous really ugly hacks in the code path, eg the baud rate
is hard coded to 115200, and download from a OSTC3 works =)

The custom serial code would need to add a configure function pointer
and it would be good if the whole thing would benefit from some
refactoring to support custom serial against other backends than
Shearwater and OSTC3.

> On iOS I believe the correct term is we are SOL :-)
> (but I'll admit that I have never researched this any further).
> 

We support bluetooth downloads on Android to, and we should be able to
support bluetooth downloads on iOS. 

I've seen folks use something like DCBuddy[1] to download logs onto iOS
devices. We should be able to support using such a device to download
logs on to iOS.


//Anton


1. http://www.divenav.com/products/dcbuddy 

-- 
Anton Lundin	+46702-161604


More information about the subsurface mailing list