Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

# Initialize automake.
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])

# Fix for automake >= 1.12
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
Expand Down
3 changes: 3 additions & 0 deletions contrib/android/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ LOCAL_SRC_FILES := \
src/suunto_eon_parser.c \
src/suunto_eonsteel.c \
src/suunto_eonsteel_parser.c \
src/suunto_nautic.c \
src/suunto_nautic_parser.c \
src/heatshrink/heatshrink_decoder.c \
src/suunto_solution.c \
src/suunto_solution_parser.c \
src/suunto_vyper2.c \
Expand Down
7 changes: 7 additions & 0 deletions contrib/msvc/libdivecomputer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@
<ClCompile Include="..\..\src\suunto_eon.c" />
<ClCompile Include="..\..\src\suunto_eonsteel.c" />
<ClCompile Include="..\..\src\suunto_eonsteel_parser.c" />
<ClCompile Include="..\..\src\suunto_nautic.c" />
<ClCompile Include="..\..\src\suunto_nautic_parser.c" />
<ClCompile Include="..\..\src\heatshrink\heatshrink_decoder.c" />
<ClCompile Include="..\..\src\suunto_eon_parser.c" />
<ClCompile Include="..\..\src\suunto_solution.c" />
<ClCompile Include="..\..\src\suunto_solution_parser.c" />
Expand Down Expand Up @@ -380,6 +383,10 @@
<ClInclude Include="..\..\src\suunto_d9.h" />
<ClInclude Include="..\..\src\suunto_eon.h" />
<ClInclude Include="..\..\src\suunto_eonsteel.h" />
<ClInclude Include="..\..\src\suunto_nautic.h" />
<ClInclude Include="..\..\src\heatshrink\heatshrink_decoder.h" />
<ClInclude Include="..\..\src\heatshrink\heatshrink_common.h" />
<ClInclude Include="..\..\src\heatshrink\heatshrink_config.h" />
<ClInclude Include="..\..\src\suunto_solution.h" />
<ClInclude Include="..\..\src\suunto_vyper.h" />
<ClInclude Include="..\..\src\suunto_vyper2.h" />
Expand Down
2 changes: 2 additions & 0 deletions include/libdivecomputer/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ typedef enum dc_family_t {
DC_FAMILY_DIVESOFT_FREEDOM = (23 << 16),
/* Halcyon Symbios */
DC_FAMILY_HALCYON_SYMBIOS = (24 << 16),
/* Suunto Nautic */
DC_FAMILY_SUUNTO_NAUTIC = (25 << 16),
} dc_family_t;

#ifdef __cplusplus
Expand Down
3 changes: 2 additions & 1 deletion include/libdivecomputer/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ typedef enum parser_sample_vendor_t {
SAMPLE_VENDOR_UWATEC_SMART,
SAMPLE_VENDOR_OCEANIC_VTPRO,
SAMPLE_VENDOR_OCEANIC_VEO250,
SAMPLE_VENDOR_OCEANIC_ATOM2
SAMPLE_VENDOR_OCEANIC_ATOM2,
SAMPLE_VENDOR_SUUNTO_NAUTIC
} parser_sample_vendor_t;

typedef enum dc_water_t {
Expand Down
3 changes: 3 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ libdivecomputer_la_SOURCES = \
oceans_s1.h oceans_s1.c oceans_s1_parser.c \
divesoft_freedom.h divesoft_freedom.c divesoft_freedom_parser.c \
halcyon_symbios.h halcyon_symbios.c halcyon_symbios_parser.c \
suunto_nautic.h suunto_nautic.c suunto_nautic_parser.c \
heatshrink/heatshrink_decoder.h heatshrink/heatshrink_decoder.c \
heatshrink/heatshrink_common.h heatshrink/heatshrink_config.h \
hdlc.h hdlc.c \
packet.h packet.c \
socket.h socket.c \
Expand Down
19 changes: 19 additions & 0 deletions src/descriptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ static int dc_filter_oceans (const dc_descriptor_t *descriptor, dc_transport_t t
static int dc_filter_divesoft (const dc_descriptor_t *descriptor, dc_transport_t transport, const void *userdata);
static int dc_filter_cressi (const dc_descriptor_t *descriptor, dc_transport_t transport, const void *userdata);
static int dc_filter_halcyon (const dc_descriptor_t *descriptor, dc_transport_t transport, const void *userdata);
static int dc_filter_suunto_nautic (const dc_descriptor_t *descriptor, dc_transport_t transport, const void *userdata);
static int dc_filter_seac (const dc_descriptor_t *descriptor, dc_transport_t transport, const void *userdata);

static dc_status_t dc_descriptor_iterator_next (dc_iterator_t *iterator, void *item);
Expand Down Expand Up @@ -492,6 +493,9 @@ static const dc_descriptor_t g_descriptors[] = {
/* Halcyon Symbios */
{"Halcyon", "Symbios HUD", DC_FAMILY_HALCYON_SYMBIOS, 1, DC_TRANSPORT_BLE, dc_filter_halcyon},
{"Halcyon", "Symbios Handset", DC_FAMILY_HALCYON_SYMBIOS, 7, DC_TRANSPORT_BLE, dc_filter_halcyon},
/* Suunto Nautic / Ocean ("Vaasa" generation) */
{"Suunto", "Nautic", DC_FAMILY_SUUNTO_NAUTIC, 0, DC_TRANSPORT_BLE, dc_filter_suunto_nautic},
{"Suunto", "Ocean", DC_FAMILY_SUUNTO_NAUTIC, 1, DC_TRANSPORT_BLE, dc_filter_suunto_nautic},
};

static int
Expand Down Expand Up @@ -965,6 +969,21 @@ dc_filter_halcyon (const dc_descriptor_t *descriptor, dc_transport_t transport,
return 1;
}

static int
dc_filter_suunto_nautic (const dc_descriptor_t *descriptor, dc_transport_t transport, const void *userdata)
{
static const char * const bluetooth[] = {
"Suunto Nautic",
"Suunto Ocean",
};

if (transport == DC_TRANSPORT_BLE) {
return DC_FILTER_INTERNAL (userdata, bluetooth, 0, dc_match_prefix);
}

return 1;
}

static int
dc_filter_seac (const dc_descriptor_t *descriptor, dc_transport_t transport, const void *userdata)
{
Expand Down
4 changes: 4 additions & 0 deletions src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include "oceans_s1.h"
#include "divesoft_freedom.h"
#include "halcyon_symbios.h"
#include "suunto_nautic.h"

#include "device-private.h"
#include "context-private.h"
Expand Down Expand Up @@ -250,6 +251,9 @@ dc_device_open (dc_device_t **out, dc_context_t *context, dc_descriptor_t *descr
case DC_FAMILY_HALCYON_SYMBIOS:
rc = halcyon_symbios_device_open (&device, context, iostream);
break;
case DC_FAMILY_SUUNTO_NAUTIC:
rc = suunto_nautic_device_open (&device, context, iostream);
break;
default:
return DC_STATUS_INVALIDARGS;
}
Expand Down
14 changes: 14 additions & 0 deletions src/heatshrink/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright (c) 2013-2015, Scott Vokes <vokes.s@gmail.com>
All rights reserved.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 changes: 20 additions & 0 deletions src/heatshrink/heatshrink_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef HEATSHRINK_H
#define HEATSHRINK_H

#define HEATSHRINK_AUTHOR "Scott Vokes <vokes.s@gmail.com>"
#define HEATSHRINK_URL "https://github.com/atomicobject/heatshrink"

/* Version 0.4.1 */
#define HEATSHRINK_VERSION_MAJOR 0
#define HEATSHRINK_VERSION_MINOR 4
#define HEATSHRINK_VERSION_PATCH 1

#define HEATSHRINK_MIN_WINDOW_BITS 4
#define HEATSHRINK_MAX_WINDOW_BITS 15

#define HEATSHRINK_MIN_LOOKAHEAD_BITS 3

#define HEATSHRINK_LITERAL_MARKER 0x01
#define HEATSHRINK_BACKREF_MARKER 0x00

#endif
26 changes: 26 additions & 0 deletions src/heatshrink/heatshrink_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef HEATSHRINK_CONFIG_H
#define HEATSHRINK_CONFIG_H

/* Should functionality assuming dynamic allocation be used? */
#ifndef HEATSHRINK_DYNAMIC_ALLOC
#define HEATSHRINK_DYNAMIC_ALLOC 1
#endif

#if HEATSHRINK_DYNAMIC_ALLOC
/* Optional replacement of malloc/free */
#define HEATSHRINK_MALLOC(SZ) malloc(SZ)
#define HEATSHRINK_FREE(P, SZ) free(P)
#else
/* Required parameters for static configuration */
#define HEATSHRINK_STATIC_INPUT_BUFFER_SIZE 32
#define HEATSHRINK_STATIC_WINDOW_BITS 8
#define HEATSHRINK_STATIC_LOOKAHEAD_BITS 4
#endif

/* Turn on logging for debugging. */
#define HEATSHRINK_DEBUGGING_LOGS 0

/* Use indexing for faster compression. (This requires additional space.) */
#define HEATSHRINK_USE_INDEX 1

#endif
Loading
Loading