Skip to content

Commit 9a4e2b7

Browse files
jvanostrandjefdriesen
authored andcommitted
Add support for the Cochran Commander and EMC.
1 parent 280f187 commit 9a4e2b7

14 files changed

+1650
-3
lines changed

examples/common.c

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ static const backend_table_t g_backends[] = {
7676
{"nitekq", DC_FAMILY_DIVERITE_NITEKQ},
7777
{"aqualand", DC_FAMILY_CITIZEN_AQUALAND},
7878
{"idive", DC_FAMILY_DIVESYSTEM_IDIVE},
79+
{"cochran", DC_FAMILY_COCHRAN_COMMANDER},
7980
};
8081

8182
const char *

include/libdivecomputer/Makefile.am

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,6 @@ libdivecomputer_HEADERS = \
5353
citizen.h \
5454
citizen_aqualand.h \
5555
divesystem.h \
56-
divesystem_idive.h
56+
divesystem_idive.h \
57+
cochran.h \
58+
cochran_commander.h

include/libdivecomputer/cochran.h

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* libdivecomputer
3+
*
4+
* Copyright (C) 2014 John Van Ostrand
5+
*
6+
* This library is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 2.1 of the License, or (at your option) any later version.
10+
*
11+
* This library is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public
17+
* License along with this library; if not, write to the Free Software
18+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19+
* MA 02110-1301 USA
20+
*/
21+
22+
#ifndef COCHRAN_H
23+
#define COCHRAN_H
24+
25+
#include "cochran_commander.h"
26+
27+
#endif /* COCHRAN_H */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* libdivecomputer
3+
*
4+
* Copyright (C) 2014 John Van Ostrand
5+
*
6+
* This library is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 2.1 of the License, or (at your option) any later version.
10+
*
11+
* This library is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public
17+
* License along with this library; if not, write to the Free Software
18+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19+
* MA 02110-1301 USA
20+
*/
21+
22+
#ifndef COCHRAN_COMMANDER_H
23+
#define COCHRAN_COMMANDER_H
24+
25+
#include "context.h"
26+
#include "device.h"
27+
#include "parser.h"
28+
29+
#ifdef __cplusplus
30+
extern "C" {
31+
#endif /* __cplusplus */
32+
33+
dc_status_t
34+
cochran_commander_device_open (dc_device_t **device, dc_context_t *context, const char *name);
35+
36+
dc_status_t
37+
cochran_commander_parser_create (dc_parser_t **parser, dc_context_t *context, unsigned int model);
38+
39+
#ifdef __cplusplus
40+
}
41+
#endif /* __cplusplus */
42+
43+
#endif /* COCHRAN_COMMANDER_H */

include/libdivecomputer/common.h

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ typedef enum dc_family_t {
8888
DC_FAMILY_CITIZEN_AQUALAND = (12 << 16),
8989
/* DiveSystem */
9090
DC_FAMILY_DIVESYSTEM_IDIVE = (13 << 16),
91+
/* Cochran */
92+
DC_FAMILY_COCHRAN_COMMANDER = (14 << 16),
9193
} dc_family_t;
9294

9395
#ifdef __cplusplus

libdivecomputer.pc.in

+1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ Description: A library for communication with various dive computers.
88
Version: @VERSION@
99
Requires.private: @DEPENDENCIES@
1010
Libs: -L${libdir} -ldivecomputer
11+
Libs.private: -lm
1112
Cflags: -I${includedir}

msvc/libdivecomputer.vcproj

+16
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,14 @@
210210
RelativePath="..\src\citizen_aqualand_parser.c"
211211
>
212212
</File>
213+
<File
214+
RelativePath="..\src\cochran_commander.c"
215+
>
216+
</File>
217+
<File
218+
RelativePath="..\src\cochran_commander_parser.c"
219+
>
220+
</File>
213221
<File
214222
RelativePath="..\src\common.c"
215223
>
@@ -524,6 +532,14 @@
524532
RelativePath="..\include\libdivecomputer\citizen_aqualand.h"
525533
>
526534
</File>
535+
<File
536+
RelativePath="..\include\libdivecomputer\cochran.h"
537+
>
538+
</File>
539+
<File
540+
RelativePath="..\include\libdivecomputer\cochran_commander.h"
541+
>
542+
</File>
527543
<File
528544
RelativePath="..\src\common-private.h"
529545
>

src/Makefile.am

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AM_CFLAGS = $(LIBUSB_CFLAGS) -DENABLE_DEPRECATED
33

44
lib_LTLIBRARIES = libdivecomputer.la
55

6-
libdivecomputer_la_LIBADD = $(LIBUSB_LIBS)
6+
libdivecomputer_la_LIBADD = $(LIBUSB_LIBS) -lm
77
libdivecomputer_la_LDFLAGS = \
88
-version-info $(DC_VERSION_LIBTOOL) \
99
-no-undefined \
@@ -64,7 +64,9 @@ libdivecomputer_la_SOURCES = \
6464
ringbuffer.h ringbuffer.c \
6565
checksum.h checksum.c \
6666
array.h array.c \
67-
buffer.c
67+
buffer.c \
68+
cochran_commander.h cochran_commander.c \
69+
cochran_commander_parser.c
6870

6971
if OS_WIN32
7072
libdivecomputer_la_SOURCES += serial.h serial_win32.c

0 commit comments

Comments
 (0)