[PATCH 5/7] This adds read/write of Suunto Vyper configs

Jef Driesen jef at libdivecomputer.org
Mon Oct 13 03:19:16 PDT 2014


On 2014-10-13 11:44, Anton Lundin wrote:
> On 13 October, 2014 - Jef Driesen wrote:
> 
>> On 2014-10-12 16:51, Anton Lundin wrote:
>> >This implements the reading and writing of the configuration varables
>> >from the Suunto Vyper family devices.
>> >
>> >Everything here is implemented based on the excellent information on:
>> >http://www.sarnau.info/papers:suunto_vyper
>> 
>> Most of the info on that page is good, but there are also a few areas 
>> where
>> it's a bit outdated. For example some of the model numbers are wrong, 
>> and
>> other models like the D3 and Zoop are missing. You can get the correct 
>> names
>> from libdivecomputer by iterating the device descriptors.
> 
> Ah, sounds great. But wouldn't that return the Spyder to? Maybe its the
> best to just black-list the Spyder and grab everybody else from the
> descriptors.

Yes, of course that will include the Spyder too. But as you say, you can 
blacklist it, or adjust the offsets for this particular model:

http://sarnau.info/papers:suunto_spyder

>> There is also one model that's an exception to the rule: the Suunto 
>> Spyder
>> uses the vyper protocol, but with a different memory layout. Thus 
>> although
>> your code for changing the settings will work for the Spyder, you'll 
>> most
>> likely be reading/writing to the wrong memory locations. So that's 
>> something
>> to watch out for!
>> 
> 
> I'm thinking about starting out by reading 0x24,1
> SUUNTO_VYPER_COMPUTER_TYPE , and matching that against the
> device-model-list to verify that the computer reports a model that we
> know how to handle, and instead of calling it "UNKNOWN" in the default
> case just rasing a error and saying: "Hey, we don't support this
> computer!"
> 
> How does that plan sound to you?

Sounds good.

Keep in mind that the Spyder model code is not stored at address 0x24. 
For the Spyder, that address contains the sample interval. That's how 
libdivecomputer detects the Spyder. The possible values for the Spyder 
sample interval (20, 30 or 60) are not valid model numbers, and thus 
libdivecomputer will assume it's a Spyder and use the correct addresses 
for the Spyder. You can see how this is done in the 
suunto_vyper_device_foreach() function.

Jef


More information about the subsurface mailing list