Move duplicated code into a common file.
This commit is contained in:
parent
0517a640bf
commit
a10fc9d85e
@ -27,46 +27,48 @@ if IRDA
|
||||
bin_PROGRAMS += smart
|
||||
endif
|
||||
|
||||
universal_SOURCES = universal.c
|
||||
COMMON = common.c common.h
|
||||
|
||||
solution_SOURCES = suunto_solution_test.c
|
||||
universal_SOURCES = universal.c $(COMMON)
|
||||
|
||||
eon_SOURCES = suunto_eon_test.c
|
||||
solution_SOURCES = suunto_solution_test.c $(COMMON)
|
||||
|
||||
vyper_SOURCES = suunto_vyper_test.c
|
||||
eon_SOURCES = suunto_eon_test.c $(COMMON)
|
||||
|
||||
vyper2_SOURCES = suunto_vyper2_test.c
|
||||
vyper_SOURCES = suunto_vyper_test.c $(COMMON)
|
||||
|
||||
d9_SOURCES = suunto_d9_test.c
|
||||
vyper2_SOURCES = suunto_vyper2_test.c $(COMMON)
|
||||
|
||||
sensus_SOURCES = reefnet_sensus_test.c
|
||||
d9_SOURCES = suunto_d9_test.c $(COMMON)
|
||||
|
||||
sensuspro_SOURCES = reefnet_sensuspro_test.c
|
||||
sensus_SOURCES = reefnet_sensus_test.c $(COMMON)
|
||||
|
||||
sensusultra_SOURCES = reefnet_sensusultra_test.c
|
||||
sensuspro_SOURCES = reefnet_sensuspro_test.c $(COMMON)
|
||||
|
||||
aladin_SOURCES = uwatec_aladin_test.c
|
||||
sensusultra_SOURCES = reefnet_sensusultra_test.c $(COMMON)
|
||||
|
||||
memomouse_SOURCES = uwatec_memomouse_test.c
|
||||
aladin_SOURCES = uwatec_aladin_test.c $(COMMON)
|
||||
|
||||
atom2_SOURCES = oceanic_atom2_test.c
|
||||
memomouse_SOURCES = uwatec_memomouse_test.c $(COMMON)
|
||||
|
||||
veo250_SOURCES = oceanic_veo250_test.c
|
||||
atom2_SOURCES = oceanic_atom2_test.c $(COMMON)
|
||||
|
||||
vtpro_SOURCES = oceanic_vtpro_test.c
|
||||
veo250_SOURCES = oceanic_veo250_test.c $(COMMON)
|
||||
|
||||
nemo_SOURCES = mares_nemo_test.c
|
||||
vtpro_SOURCES = oceanic_vtpro_test.c $(COMMON)
|
||||
|
||||
puck_SOURCES = mares_puck_test.c
|
||||
nemo_SOURCES = mares_nemo_test.c $(COMMON)
|
||||
|
||||
iconhd_SOURCES = mares_iconhd_test.c
|
||||
puck_SOURCES = mares_puck_test.c $(COMMON)
|
||||
|
||||
ostc_SOURCES = hw_ostc_test.c
|
||||
iconhd_SOURCES = mares_iconhd_test.c $(COMMON)
|
||||
|
||||
edy_SOURCES = cressi_edy_test.c
|
||||
ostc_SOURCES = hw_ostc_test.c $(COMMON)
|
||||
|
||||
n2ition3_SOURCES = zeagle_n2ition3_test.c
|
||||
edy_SOURCES = cressi_edy_test.c $(COMMON)
|
||||
|
||||
n2ition3_SOURCES = zeagle_n2ition3_test.c $(COMMON)
|
||||
|
||||
if IRDA
|
||||
smart_SOURCES = uwatec_smart_test.c
|
||||
smart_SOURCES = uwatec_smart_test.c $(COMMON)
|
||||
endif
|
||||
|
||||
49
examples/common.c
Normal file
49
examples/common.c
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* libdivecomputer
|
||||
*
|
||||
* Copyright (C) 2011 Jef Driesen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
const char *
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
case DEVICE_STATUS_CANCELLED:
|
||||
return "Cancelled";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
37
examples/common.h
Normal file
37
examples/common.h
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* libdivecomputer
|
||||
*
|
||||
* Copyright (C) 2011 Jef Driesen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef EXAMPLES_COMMON_H
|
||||
#define EXAMPLES_COMMON_H
|
||||
|
||||
#include <device.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
const char *
|
||||
errmsg (device_status_t rc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* EXAMPLES_COMMON_H */
|
||||
@ -24,6 +24,7 @@
|
||||
#include "cressi_edy.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
@ -68,32 +69,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("EDY.LOG");
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include "hw_ostc.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -67,32 +69,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("OSTC.LOG");
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include "mares_iconhd.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -67,32 +69,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("ICONHD.LOG");
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include "mares_nemo.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -67,32 +69,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("NEMO.LOG");
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include "mares_puck.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -67,32 +69,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("PUCK.LOG");
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include "oceanic_atom2.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -75,31 +77,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("ATOM2.LOG");
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include "oceanic_veo250.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -75,31 +77,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("VEO250.LOG");
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include "oceanic_vtpro.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -67,31 +69,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("VTPRO.LOG");
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
#include "reefnet_sensus.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -73,32 +75,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("SENSUS.LOG");
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
#include "reefnet_sensuspro.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -73,32 +75,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("SENSUSPRO.LOG");
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
#include "reefnet_sensusultra.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory_dives (const char* name, const char* filename)
|
||||
{
|
||||
@ -153,32 +155,6 @@ test_dump_memory_user (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("SENSUSULTRA.LOG");
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include "suunto_d9.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_sdm (const char* name)
|
||||
{
|
||||
@ -116,31 +118,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("D9.LOG");
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include "suunto_eon.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -67,32 +69,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("EON.LOG");
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
#include "suunto.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -46,32 +48,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include "suunto_vyper2.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_sdm (const char* name)
|
||||
{
|
||||
@ -116,31 +118,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("VYPER2.LOG");
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
#include "suunto_vyper.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_sdm (const char* name, unsigned int delay)
|
||||
{
|
||||
@ -103,31 +105,6 @@ test_dump_memory (const char* name, unsigned int delay, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("VYPER.LOG");
|
||||
|
||||
@ -45,6 +45,8 @@
|
||||
#include <atomics.h>
|
||||
#include <utils.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
static const char *g_cachedir = NULL;
|
||||
static int g_cachedir_read = 1;
|
||||
|
||||
@ -535,33 +537,6 @@ dive_cb (const unsigned char *data, unsigned int size, const unsigned char *fing
|
||||
}
|
||||
|
||||
|
||||
static const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
case DEVICE_STATUS_CANCELLED:
|
||||
return "Cancelled";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
usage (const char *filename)
|
||||
{
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
#include "uwatec_aladin.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -46,32 +48,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("ALADIN.LOG");
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include "uwatec_memomouse.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
{
|
||||
@ -67,32 +69,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("MEMOMOUSE.LOG");
|
||||
|
||||
@ -26,6 +26,8 @@
|
||||
#include "uwatec_smart.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* filename)
|
||||
{
|
||||
@ -78,32 +80,6 @@ test_dump_memory (const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("SMART.LOG");
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include "zeagle_n2ition3.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
device_status_t
|
||||
test_dump_memory (const char* name, const char* filename)
|
||||
@ -68,32 +69,6 @@ test_dump_memory (const char* name, const char* filename)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
errmsg (device_status_t rc)
|
||||
{
|
||||
switch (rc) {
|
||||
case DEVICE_STATUS_SUCCESS:
|
||||
return "Success";
|
||||
case DEVICE_STATUS_UNSUPPORTED:
|
||||
return "Unsupported operation";
|
||||
case DEVICE_STATUS_TYPE_MISMATCH:
|
||||
return "Device type mismatch";
|
||||
case DEVICE_STATUS_ERROR:
|
||||
return "Generic error";
|
||||
case DEVICE_STATUS_IO:
|
||||
return "Input/output error";
|
||||
case DEVICE_STATUS_MEMORY:
|
||||
return "Memory error";
|
||||
case DEVICE_STATUS_PROTOCOL:
|
||||
return "Protocol error";
|
||||
case DEVICE_STATUS_TIMEOUT:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message_set_logfile ("N2ITION3.LOG");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user