mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-25 19:27:14 +00:00
gattlib: add recipe
gattlib is a C library for talking to Bluetooth, including BLE, devices. It's the only free, embedded-appropriate library for easily scanning BLE devices and subscribing to their notifications Signed-off-by: Daniels Umanovskis <du@axentia.se> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
committed by
Khem Raj
parent
2c83141421
commit
e725436832
+70
@@ -0,0 +1,70 @@
|
|||||||
|
From 87df05c3f83c563af76ab00567e7a1ab7a6ebc88 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Peter Rosin <peda@axentia.se>
|
||||||
|
Date: Sat, 9 Nov 2019 15:42:03 +0100
|
||||||
|
Subject: [PATCH] dbus: avoid 'strange' chars from the build dir in #defines
|
||||||
|
|
||||||
|
gdbus-codegen uses include guards with the full path dir, and if there
|
||||||
|
are "bad" characters, such as '+', this fails miserably. E.g. Yocto has a
|
||||||
|
tendency to build in directories named from the Yocto package version and
|
||||||
|
that package version containing a '+' are not uncommon, and even the
|
||||||
|
standard in certain scenarios such as when using ${SRCPV}.
|
||||||
|
|
||||||
|
Avoid the problem of the full path "leaking" into the source by avoiding
|
||||||
|
the normal include guards and request "#pragma once" instead.
|
||||||
|
|
||||||
|
Signed-off-by: Peter Rosin <peda@axentia.se>
|
||||||
|
---
|
||||||
|
dbus/CMakeLists.txt | 12 ++++++------
|
||||||
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/dbus/CMakeLists.txt b/dbus/CMakeLists.txt
|
||||||
|
index f5096ce10ecd..013c32239e12 100644
|
||||||
|
--- a/dbus/CMakeLists.txt
|
||||||
|
+++ b/dbus/CMakeLists.txt
|
||||||
|
@@ -43,37 +43,37 @@ else()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-adaptater1.c
|
||||||
|
- COMMAND gdbus-codegen --interface-prefix org.bluez.Adapter1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-adaptater1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Adapter1.xml
|
||||||
|
+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.Adapter1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-adaptater1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Adapter1.xml
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Adapter1.xml
|
||||||
|
COMMENT "Generate D-Bus 'org.bluez.Adapter1.xml'"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-device1.c
|
||||||
|
- COMMAND gdbus-codegen --interface-prefix org.bluez.Device1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-device1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Device1.xml
|
||||||
|
+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.Device1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-device1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Device1.xml
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Device1.xml
|
||||||
|
COMMENT "Generate D-Bus 'org.bluez.Device1.xml'"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattservice1.c
|
||||||
|
- COMMAND gdbus-codegen --interface-prefix org.bluez.GattService1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattservice1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattService1.xml
|
||||||
|
+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.GattService1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattservice1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattService1.xml
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattService1.xml
|
||||||
|
COMMENT "Generate D-Bus 'org.bluez.GattService1.xml'"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattcharacteristic1.c
|
||||||
|
- COMMAND gdbus-codegen --interface-prefix org.bluez.Characteristic1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattcharacteristic1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattCharacteristic1.xml
|
||||||
|
+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.Characteristic1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattcharacteristic1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattCharacteristic1.xml
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattCharacteristic1.xml
|
||||||
|
COMMENT "Generate D-Bus 'org.bluez.GattCharacteristic1.xml'"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattdescriptor1.c
|
||||||
|
- COMMAND gdbus-codegen --interface-prefix org.bluez.Descriptor1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattdescriptor1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattDescriptor1.xml
|
||||||
|
+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.Descriptor1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattdescriptor1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattDescriptor1.xml
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattDescriptor1.xml
|
||||||
|
COMMENT "Generate D-Bus 'org.bluez.GattDescriptor1.xml'"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-battery1.c
|
||||||
|
- COMMAND gdbus-codegen --interface-prefix org.bluez.Battery1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-battery1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Battery1.xml
|
||||||
|
+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.Battery1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-battery1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Battery1.xml
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Battery1.xml
|
||||||
|
COMMENT "Generate D-Bus 'org.bluez.Battery1.xml'"
|
||||||
|
)
|
||||||
|
--
|
||||||
|
2.11.0
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
DESCRIPTION = "Bluetooth library with attribute support"
|
||||||
|
SECTION = "libs/network"
|
||||||
|
|
||||||
|
LICENSE = "GPLv2+"
|
||||||
|
LIC_FILES_CHKSUM = "file://CMakeLists.txt;beginline=1;endline=20;md5=8d5efeb9189b60866baff80ff791bf00"
|
||||||
|
|
||||||
|
DEPENDS = "bluez5 glib-2.0"
|
||||||
|
DEPENDS += "glib-2.0-native"
|
||||||
|
|
||||||
|
PV = "0.2+git${SRCPV}"
|
||||||
|
|
||||||
|
SRC_URI = "git://github.com/labapart/gattlib.git"
|
||||||
|
SRC_URI += "file://dbus-avoid-strange-chars-from-the-build-dir.patch"
|
||||||
|
|
||||||
|
SRCBRANCH = "master"
|
||||||
|
SRCREV = "c6a33252221dff904cf277e085e2ce70aced8788"
|
||||||
|
|
||||||
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
|
PACKAGECONFIG[examples] = "-DGATTLIB_BUILD_EXAMPLES=ON,-DGATTLIB_BUILD_EXAMPLES=OFF"
|
||||||
|
|
||||||
|
# Set this to force use of DBus API if Bluez version is older than 5.42
|
||||||
|
PACKAGECONFIG[force-dbus] = "-DGATTLIB_FORCE_DBUS=TRUE,-DGATTLIB_FORCE_DBUS=FALSE"
|
||||||
|
|
||||||
|
EXTRA_OECMAKE += "-DGATTLIB_BUILD_DOCS=OFF"
|
||||||
|
|
||||||
|
inherit pkgconfig cmake
|
||||||
|
|
||||||
|
FILES_${PN} = "${libdir}/* ${includedir}/*"
|
||||||
|
FILES_${PN}-dev = "${includedir}/*"
|
||||||
Reference in New Issue
Block a user