mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 21:20:19 +00:00
196adb591b
This is some very early and hacky code to be able to access BLE-enabled dive computers that use the GATT protocol to send packets back and forth (which seems to be pretty much all of them: a vendor-specific GATT service with a write characteristic and a notification characteristic for reading). For testing only. But it does successfully let me download dives from my EON Steel and my Scubapro G2. NOTE! There are several very hacky pieces in here, including just "knowing" that the write characteristic is the first one, and the notification characteristic is second. The code should actually check the properties rather than have those kinds of hardcoded assumptions. It also checks "vendor specific" by looking at the UUID string representation, and knowing that the standard ones start with zero. Crazily, there doesn't seem to be any normal way to test for this, although I guess that maybe the uuid.minimumSize() function could be used. There are other nasty corners. Don't complain, send me patches. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
108 lines
2.2 KiB
CMake
108 lines
2.2 KiB
CMake
set(PLATFORM_SRC unknown_platform.c)
|
|
message(STATUS "system name ${CMAKE_SYSTEM_NAME}")
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
if(ANDROID)
|
|
set(PLATFORM_SRC android.cpp)
|
|
else()
|
|
set(PLATFORM_SRC linux.c)
|
|
endif()
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
|
|
set(PLATFORM_SRC android.cpp)
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
set(PLATFORM_SRC macos.c)
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
set(PLATFORM_SRC windows.c)
|
|
endif()
|
|
|
|
if(FTDISUPPORT)
|
|
set(SERIAL_FTDI serial_ftdi.c)
|
|
endif()
|
|
|
|
if(BTSUPPORT)
|
|
add_definitions(-DBT_SUPPORT)
|
|
set(BT_SRC_FILES desktop-widgets/btdeviceselectiondialog.cpp)
|
|
set(BT_CORE_SRC_FILES qtserialbluetooth.cpp)
|
|
endif()
|
|
|
|
if(BLESUPPORT)
|
|
add_definitions(-DBLE_SUPPORT)
|
|
set(BT_CORE_SRC_FILES qt-ble.cpp)
|
|
endif()
|
|
|
|
# compile the core library, in C.
|
|
set(SUBSURFACE_CORE_LIB_SRCS
|
|
btdiscovery.cpp
|
|
cochran.c
|
|
datatrak.c
|
|
deco.c
|
|
device.c
|
|
dive.c
|
|
divesite.c
|
|
divesite.cpp
|
|
divelist.c
|
|
equipment.c
|
|
file.c
|
|
gas-model.c
|
|
git-access.c
|
|
libdivecomputer.c
|
|
liquivision.c
|
|
load-git.c
|
|
membuffer.c
|
|
ostctools.c
|
|
parse-xml.c
|
|
planner.c
|
|
plannernotes.c
|
|
profile.c
|
|
gaspressures.c
|
|
worldmap-save.c
|
|
save-git.c
|
|
save-xml.c
|
|
save-html.c
|
|
sha1.c
|
|
statistics.c
|
|
strtod.c
|
|
subsurfacestartup.c
|
|
time.c
|
|
uemis.c
|
|
uemis-downloader.c
|
|
version.c
|
|
# gettextfrommoc should be added because we are using it on the c-code.
|
|
gettextfromc.cpp
|
|
# dirk ported some core functionality to c++.
|
|
qthelper.cpp
|
|
divecomputer.cpp
|
|
exif.cpp
|
|
subsurfacesysinfo.cpp
|
|
devicedetails.cpp
|
|
configuredivecomputer.cpp
|
|
configuredivecomputerthreads.cpp
|
|
divesitehelpers.cpp
|
|
taxonomy.c
|
|
checkcloudconnection.cpp
|
|
windowtitleupdate.cpp
|
|
divelogexportlogic.cpp
|
|
qt-init.cpp
|
|
qtserialbluetooth.cpp
|
|
metrics.cpp
|
|
color.cpp
|
|
pluginmanager.cpp
|
|
imagedownloader.cpp
|
|
isocialnetworkintegration.cpp
|
|
gpslocation.cpp
|
|
cloudstorage.cpp
|
|
downloadfromdcthread.cpp
|
|
|
|
#Subsurface Qt have the Subsurface structs QObjectified for easy access via QML.
|
|
subsurface-qt/DiveObjectHelper.cpp
|
|
subsurface-qt/CylinderObjectHelper.cpp
|
|
subsurface-qt/SettingsObjectWrapper.cpp
|
|
|
|
${SERIAL_FTDI}
|
|
${PLATFORM_SRC}
|
|
${BT_CORE_SRC_FILES}
|
|
)
|
|
source_group("Subsurface Core" FILES ${SUBSURFACE_CORE_LIB_SRCS})
|
|
|
|
add_library(subsurface_corelib STATIC ${SUBSURFACE_CORE_LIB_SRCS} )
|
|
target_link_libraries(subsurface_corelib ${QT_LIBRARIES})
|
|
|