From 506bcec3cd868711ff3bd2f42132416adb0a7f15 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 4 Dec 2017 11:30:45 -0800 Subject: [PATCH] Add configure flag to explicitly enable BLE support This way BLE dive computers that are otherwise conditional on USBHID will be built on platforms that support them but don't have USBHID (like iOS). Signed-off-by: Dirk Hohndel --- configure.ac | 9 +++++++++ src/descriptor.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a48b734..5239642 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,15 @@ AC_ARG_ENABLE([doc], [], [enable_doc=yes]) AM_CONDITIONAL([ENABLE_DOC], [test "x$enable_doc" = "xyes"]) +# BLE support +AC_ARG_ENABLE([ble], + [AS_HELP_STRING([--enable-ble=@<:@yes/no@:>@], + [Enable BLE dive computers @<:@default=yes@:>@])], + [], [enable_ble=no]) +AS_IF([test "x$enable_ble" = "xyes"], [ + AC_DEFINE(ENABLE_BLE, [1], [Enable support for BLE dive computers.]) +]) + # Checks for programs. AC_PROG_CC AC_PROG_CC_C99 diff --git a/src/descriptor.c b/src/descriptor.c index a8c8a1a..a267bf3 100644 --- a/src/descriptor.c +++ b/src/descriptor.c @@ -98,7 +98,7 @@ static const dc_descriptor_t g_descriptors[] = { {"Suunto", "Zoop Novo", DC_FAMILY_SUUNTO_D9, 0x1E}, // FTDI {"Suunto", "D4f", DC_FAMILY_SUUNTO_D9, 0x20}, // FTDI /* Suunto EON Steel */ -#ifdef USBHID +#if defined(USBHID) || defined(ENABLE_BLE) {"Suunto", "EON Steel", DC_FAMILY_SUUNTO_EONSTEEL, 0}, // BLE {"Suunto", "EON Core", DC_FAMILY_SUUNTO_EONSTEEL, 1}, // BLE #endif @@ -139,7 +139,7 @@ static const dc_descriptor_t g_descriptors[] = { {"Scubapro", "Chromis", DC_FAMILY_UWATEC_MERIDIAN, 0x24}, {"Scubapro", "Mantis 2", DC_FAMILY_UWATEC_MERIDIAN, 0x26}, /* Scubapro G2 */ -#ifdef USBHID +#if defined(USBHID) || defined(ENABLE_BLE) {"Scubapro", "Aladin Sport Matrix", DC_FAMILY_UWATEC_G2, 0x17}, // BLE {"Scubapro", "Aladin Square", DC_FAMILY_UWATEC_G2, 0x22}, {"Scubapro", "G2", DC_FAMILY_UWATEC_G2, 0x32}, // BLE