Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async: Implementation of *_async versions for long-blocking calls #54

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
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
57 changes: 37 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,34 +71,23 @@ else()
link_directories(${PROJECT_BINARY_DIR}/bluez)
endif()

# Generate pkg-config file before building the examples
configure_file(dbus/gattlib.pc.in ${PROJECT_BINARY_DIR}/gattlib.pc @ONLY)

# Add the build directory to PKG_CONFIG_PATH
set(ENV{PKG_CONFIG_PATH} "${PROJECT_BINARY_DIR}:$ENV{PKG_CONFIG_PATH}")

# Examples
add_subdirectory(examples/ble_scan)
add_subdirectory(examples/discover)
add_subdirectory(examples/read_write)
add_subdirectory(examples/notification)
add_subdirectory(examples/nordic_uart)

# Some examples require Bluez code and other DBus support
if (NOT GATTLIB_DBUS)
add_subdirectory(examples/gatttool)
endif()

#
# Packaging
# Packaging (this needs to be before the pc file setup to take effect)
#

set(CPACK_SET_DESTDIR true)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "/usr" CACHE STRING "Install directory (default: /usr).")
set(CPACK_INSTALL_PREFIX ${CPACK_PACKAGE_INSTALL_DIRECTORY} CACHE STRING "Install directory (default: /usr).")
set(CPACK_PACKAGING_PREFIX ${CPACK_PACKAGE_INSTALL_DIRECTORY} CACHE STRING "Install directory (default: /usr).")

set(CPACK_PACKAGE_INSTALL_DIRECTORY /usr CACHE STRING "Install directory (default: /usr).")
if (ENV{TRAVIS_TAG})
set(CPACK_PACKAGE_VERSION $ENV{TRAVIS_TAG})
else()
set(CPACK_PACKAGE_VERSION 0.2-dev)
set(CPACK_PACKAGE_VERSION 0.3.4)
endif()
set(CPACK_PACKAGE_CONTACT "Olivier Martin <olivier@labapart.com>")
set(CPACK_PACKAGE_CONTACT "Pat Deegan <contact-form@psychogenic.com>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Library to access GATT information from Bluetooth Low Energy (BLE) devices")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_PACKAGE_ARCHITECTURE}")

Expand All @@ -124,6 +113,34 @@ if (GATTLIB_DBUS AND (BLUEZ_VERSION_MAJOR EQUAL 5) AND (BLUEZ_VERSION_MINOR GREA
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, bluez (>= 5.40)")
endif()






# Generate pkg-config file before building the examples
configure_file(dbus/gattlib.pc.in ${PROJECT_BINARY_DIR}/gattlib.pc @ONLY)

# Add the build directory to PKG_CONFIG_PATH
set(ENV{PKG_CONFIG_PATH} "${PROJECT_BINARY_DIR}:$ENV{PKG_CONFIG_PATH}")

# Examples
add_subdirectory(examples/ble_scan)
if (GATTLIB_DBUS)
add_subdirectory(examples/ble_scan_async)
endif()
add_subdirectory(examples/discover)
add_subdirectory(examples/read_write)
add_subdirectory(examples/notification)
add_subdirectory(examples/nordic_uart)

# Some examples require Bluez code and other DBus support
if (NOT GATTLIB_DBUS)
add_subdirectory(examples/gatttool)
endif()



#
# List of file to install
#
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ cmake -DGATTLIB_FORCE_DBUS=TRUE ..
make
```

Latest GattLib Release packages
===============================
Latest GattLib (Async support) Release packages
===============================================

* For x86_64, with Bluez DBUS Support (Recommended):
* For x86_64, with Bluez DBUS Support (Recommended, and required for Gattlib++ and Coraline):

- ZIP: <https://github.com/labapart/gattlib/releases/download/dev/gattlib_dbus_dev_x86_64.zip>
- DEB: <https://github.com/labapart/gattlib/releases/download/dev/gattlib_dbus_dev_x86_64.deb>
- RPM: <https://github.com/labapart/gattlib/releases/download/dev/gattlib_dbus_dev_x86_64.rpm>

- ZIP: <https://github.com/psychogenic/gattlib/releases/download/v0.3.4/gattlib_0.3.4_x86_64.zip>
- DEB: <https://github.com/psychogenic/gattlib/releases/download/v0.3.4/gattlib_0.3.4_x86_64.deb>
- RPM: <https://github.com/psychogenic/gattlib/releases/download/v0.3.4/gattlib_0.3.4_x86_64.rpm>

Latest GattLib (original) packages (no async, as of yet)
========================================================

* For x86_64, with Bluez Legacy Support:

Expand Down
1 change: 1 addition & 0 deletions dbus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattdescriptor1.
include_directories(. ${CMAKE_CURRENT_BINARY_DIR} ${GIO_UNIX_INCLUDE_DIRS} ${BLUEZ_INCLUDE_DIRS})

set(gattlib_SRCS gattlib.c
gattlib_async.c
bluez5/lib/uuid.c
../gattlib_common.c
${CMAKE_CURRENT_BINARY_DIR}/org-bluez-adaptater1.c
Expand Down
Loading