diff --git a/CMakeLists.txt b/CMakeLists.txt index 9718dd8..a3715b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,22 +1,7 @@ # -# GattLib - GATT Library +# SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later # -# Copyright (C) 2016-2020 Olivier Martin -# -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# Copyright (c) 2016-2021, Olivier Martin # cmake_minimum_required(VERSION 3.4) diff --git a/CrossCompilation.cmake b/CrossCompilation.cmake index ac5be13..5ce4ee8 100644 --- a/CrossCompilation.cmake +++ b/CrossCompilation.cmake @@ -1,20 +1,8 @@ # -# Copyright (C) 2016 Olivier Martin +# SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later # +# Copyright (c) 2016-2021, Olivier Martin # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # Version: 1.0 # Repository: https://gist.github.com/oliviermartin/ diff --git a/README.md b/README.md index 70aaadb..fecdb7a 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,13 @@ TODO List - Complete `examples/gatttool` port to GattLib to demonstrate the completeness of GattLib. - Remove GLib dependencies to GattLib (mainly replacing GLib IO Channels by Unix Domain Socket). +License +======= + +Gattlib with Bluez Legacy support (for Bluez v4) has a GPL v2.0 or later license. +While Gattlib for recent version of Bluez (v5.40+) has a BSD-3-Clause license - except `dbus/bluez5/lib/uuid.c` +and `dbus/bluez5/lib/uuid.h` that have a GPL v2.0 or later license. + Support ======= diff --git a/bluez/CMakeLists.txt b/bluez/CMakeLists.txt index d83d2b3..d68f593 100644 --- a/bluez/CMakeLists.txt +++ b/bluez/CMakeLists.txt @@ -1,7 +1,7 @@ # # GattLib - GATT Library # -# Copyright (C) 2016-2019 Olivier Martin +# Copyright (C) 2016-2021 Olivier Martin # # # This program is free software; you can redistribute it and/or modify diff --git a/bluez/gattlib_adapter.c b/bluez/gattlib_adapter.c index c4e9b08..2f679a7 100644 --- a/bluez/gattlib_adapter.c +++ b/bluez/gattlib_adapter.c @@ -1,3 +1,26 @@ +/* + * + * GattLib - GATT Library + * + * Copyright (C) 2016-2021 Olivier Martin + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + #include "gattlib_internal.h" #include diff --git a/bluez/gattlib_connect.c b/bluez/gattlib_connect.c index 20d4d63..969f3fb 100644 --- a/bluez/gattlib_connect.c +++ b/bluez/gattlib_connect.c @@ -2,7 +2,7 @@ * * GattLib - GATT Library * - * Copyright (C) 2016-2019 Olivier Martin + * Copyright (C) 2016-2021 Olivier Martin * * * This program is free software; you can redistribute it and/or modify diff --git a/bluez/gattlib_discover.c b/bluez/gattlib_discover.c index 8d2cbd1..eb6fe67 100644 --- a/bluez/gattlib_discover.c +++ b/bluez/gattlib_discover.c @@ -2,7 +2,7 @@ * * GattLib - GATT Library * - * Copyright (C) 2016-2019 Olivier Martin + * Copyright (C) 2016-2021 Olivier Martin * * * This program is free software; you can redistribute it and/or modify diff --git a/bluez/gattlib_internal.h b/bluez/gattlib_internal.h index 60dfdc6..4f1bb89 100644 --- a/bluez/gattlib_internal.h +++ b/bluez/gattlib_internal.h @@ -2,7 +2,7 @@ * * GattLib - GATT Library * - * Copyright (C) 2016-2019 Olivier Martin + * Copyright (C) 2016-2021 Olivier Martin * * * This program is free software; you can redistribute it and/or modify diff --git a/bluez/gattlib_read_write.c b/bluez/gattlib_read_write.c index f670529..020a2c8 100644 --- a/bluez/gattlib_read_write.c +++ b/bluez/gattlib_read_write.c @@ -2,7 +2,7 @@ * * GattLib - GATT Library * - * Copyright (C) 2016-2017 Olivier Martin + * Copyright (C) 2016-2021 Olivier Martin * * * This program is free software; you can redistribute it and/or modify diff --git a/common/gattlib_common.c b/common/gattlib_common.c index 695fc22..15264b5 100644 --- a/common/gattlib_common.c +++ b/common/gattlib_common.c @@ -1,3 +1,9 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later + * + * Copyright (c) 2021, Olivier Martin + */ + #if defined(WITH_PYTHON) #include #endif diff --git a/common/gattlib_eddystone.c b/common/gattlib_eddystone.c index 9a0365b..83f383d 100644 --- a/common/gattlib_eddystone.c +++ b/common/gattlib_eddystone.c @@ -1,3 +1,9 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later + * + * Copyright (c) 2021, Olivier Martin + */ + #include #include "gattlib_internal.h" diff --git a/common/gattlib_internal_defs.h b/common/gattlib_internal_defs.h index 3b04cc8..ac5d363 100644 --- a/common/gattlib_internal_defs.h +++ b/common/gattlib_internal_defs.h @@ -1,3 +1,9 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later + * + * Copyright (c) 2021, Olivier Martin + */ + #ifndef __GATTLIB_INTERNAL_DEFS_H__ #define __GATTLIB_INTERNAL_DEFS_H__ diff --git a/dbus/CMakeLists.txt b/dbus/CMakeLists.txt index 2c07875..3e6ef91 100644 --- a/dbus/CMakeLists.txt +++ b/dbus/CMakeLists.txt @@ -1,22 +1,7 @@ # -# GattLib - GATT Library +# SPDX-License-Identifier: BSD-3-Clause # -# Copyright (C) 2017-2020 Olivier Martin -# -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# Copyright (c) 2016-2021, Olivier Martin # cmake_minimum_required(VERSION 3.0) diff --git a/dbus/gattlib_adapter.c b/dbus/gattlib_adapter.c index 57cdd03..677095f 100644 --- a/dbus/gattlib_adapter.c +++ b/dbus/gattlib_adapter.c @@ -1,24 +1,7 @@ /* + * SPDX-License-Identifier: BSD-3-Clause * - * GattLib - GATT Library - * - * Copyright (C) 2016-2020 Olivier Martin - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * + * Copyright (c) 2016-2021, Olivier Martin */ #include "gattlib_internal.h" diff --git a/dbus/gattlib_advertisement.c b/dbus/gattlib_advertisement.c index ab18a80..57d8d60 100644 --- a/dbus/gattlib_advertisement.c +++ b/dbus/gattlib_advertisement.c @@ -1,24 +1,7 @@ /* + * SPDX-License-Identifier: BSD-3-Clause * - * GattLib - GATT Library - * - * Copyright (C) 2016-2020 Olivier Martin - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * + * Copyright (c) 2016-2021, Olivier Martin */ #include "gattlib_internal.h" diff --git a/dbus/gattlib_char.c b/dbus/gattlib_char.c index 9ff5e5c..c6a6daf 100644 --- a/dbus/gattlib_char.c +++ b/dbus/gattlib_char.c @@ -1,24 +1,7 @@ /* + * SPDX-License-Identifier: BSD-3-Clause * - * GattLib - GATT Library - * - * Copyright (C) 2016-2019 Olivier Martin - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * + * Copyright (c) 2016-2021, Olivier Martin */ #include diff --git a/dbus/gattlib_internal.h b/dbus/gattlib_internal.h index 9d80402..61b87dd 100644 --- a/dbus/gattlib_internal.h +++ b/dbus/gattlib_internal.h @@ -1,24 +1,7 @@ /* + * SPDX-License-Identifier: BSD-3-Clause * - * GattLib - GATT Library - * - * Copyright (C) 2016-2020 Olivier Martin - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * + * Copyright (c) 2016-2021, Olivier Martin */ #ifndef __GATTLIB_INTERNAL_H__ diff --git a/dbus/gattlib_notification.c b/dbus/gattlib_notification.c index 57b8fba..a07ed2c 100644 --- a/dbus/gattlib_notification.c +++ b/dbus/gattlib_notification.c @@ -1,24 +1,7 @@ /* + * SPDX-License-Identifier: BSD-3-Clause * - * GattLib - GATT Library - * - * Copyright (C) 2016-2020 Olivier Martin - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * + * Copyright (c) 2016-2021, Olivier Martin */ #include diff --git a/dbus/gattlib_stream.c b/dbus/gattlib_stream.c index 5b0d516..750dab5 100644 --- a/dbus/gattlib_stream.c +++ b/dbus/gattlib_stream.c @@ -1,24 +1,7 @@ /* + * SPDX-License-Identifier: BSD-3-Clause * - * GattLib - GATT Library - * - * Copyright (C) 2016-2019 Olivier Martin - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * + * Copyright (c) 2016-2021, Olivier Martin */ #include diff --git a/gattlib-py/examples/advertisement_data/advertisement_data.py b/gattlib-py/examples/advertisement_data/advertisement_data.py index 166d431..6aee9e1 100755 --- a/gattlib-py/examples/advertisement_data/advertisement_data.py +++ b/gattlib-py/examples/advertisement_data/advertisement_data.py @@ -1,5 +1,11 @@ #!/usr/bin/env python3 +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + import argparse from gattlib import adapter diff --git a/gattlib-py/examples/ble_scan/ble_scan.py b/gattlib-py/examples/ble_scan/ble_scan.py index c3968a8..dbe4906 100755 --- a/gattlib-py/examples/ble_scan/ble_scan.py +++ b/gattlib-py/examples/ble_scan/ble_scan.py @@ -1,5 +1,11 @@ #!/usr/bin/env python3 +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + import argparse import threading diff --git a/gattlib-py/examples/find_eddystone/find_eddystone.py b/gattlib-py/examples/find_eddystone/find_eddystone.py index 5461b6e..f47aa99 100755 --- a/gattlib-py/examples/find_eddystone/find_eddystone.py +++ b/gattlib-py/examples/find_eddystone/find_eddystone.py @@ -1,5 +1,11 @@ #!/usr/bin/env python3 +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + import argparse import threading diff --git a/gattlib-py/examples/nordic_thingy/environment_service.py b/gattlib-py/examples/nordic_thingy/environment_service.py index 30287c6..6fb0dd9 100644 --- a/gattlib-py/examples/nordic_thingy/environment_service.py +++ b/gattlib-py/examples/nordic_thingy/environment_service.py @@ -1,3 +1,9 @@ +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + import struct import sys import threading @@ -59,7 +65,7 @@ def graph_init(): global ax_temp, ax_hum global simulation - font = {'size' : 9} + font = {'size': 9} matplotlib.rc('font', **font) # Setup figure and subplots diff --git a/gattlib-py/examples/nordic_thingy/nordic_thingy.py b/gattlib-py/examples/nordic_thingy/nordic_thingy.py index 360c9d4..14a6a07 100755 --- a/gattlib-py/examples/nordic_thingy/nordic_thingy.py +++ b/gattlib-py/examples/nordic_thingy/nordic_thingy.py @@ -1,5 +1,11 @@ #!/usr/bin/env python3 +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + import argparse from gattlib import adapter, device diff --git a/gattlib-py/examples/nordic_thingy/sound_service.py b/gattlib-py/examples/nordic_thingy/sound_service.py index 3f7e630..1bbc44b 100644 --- a/gattlib-py/examples/nordic_thingy/sound_service.py +++ b/gattlib-py/examples/nordic_thingy/sound_service.py @@ -1,3 +1,9 @@ +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + import time import threading import wave diff --git a/gattlib-py/examples/read_write/read_write.py b/gattlib-py/examples/read_write/read_write.py index d57ec39..8fd6c9a 100755 --- a/gattlib-py/examples/read_write/read_write.py +++ b/gattlib-py/examples/read_write/read_write.py @@ -1,5 +1,11 @@ #!/usr/bin/env python3 +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + import argparse from gattlib import device, uuid diff --git a/gattlib-py/gattlib/__init__.py b/gattlib-py/gattlib/__init__.py index ee3edf5..2b973db 100644 --- a/gattlib-py/gattlib/__init__.py +++ b/gattlib-py/gattlib/__init__.py @@ -1,3 +1,9 @@ +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + from ctypes import * gattlib = CDLL("libgattlib.so") diff --git a/gattlib-py/gattlib/adapter.py b/gattlib-py/gattlib/adapter.py index 1e4114c..6414513 100644 --- a/gattlib-py/gattlib/adapter.py +++ b/gattlib-py/gattlib/adapter.py @@ -1,3 +1,9 @@ +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + from gattlib import * from .device import Device from .exception import handle_return, AdapterNotOpened diff --git a/gattlib-py/gattlib/device.py b/gattlib-py/gattlib/device.py index 5a772e0..f1df317 100644 --- a/gattlib-py/gattlib/device.py +++ b/gattlib-py/gattlib/device.py @@ -1,3 +1,9 @@ +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + import logging import uuid diff --git a/gattlib-py/gattlib/exception.py b/gattlib-py/gattlib/exception.py index b96fc27..23e7d2c 100644 --- a/gattlib-py/gattlib/exception.py +++ b/gattlib-py/gattlib/exception.py @@ -1,3 +1,9 @@ +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + GATTLIB_SUCCESS = 0 GATTLIB_INVALID_PARAMETER = 1 GATTLIB_NOT_FOUND = 2 diff --git a/gattlib-py/gattlib/gatt.py b/gattlib-py/gattlib/gatt.py index 0f5216b..0ceed11 100644 --- a/gattlib-py/gattlib/gatt.py +++ b/gattlib-py/gattlib/gatt.py @@ -1,3 +1,9 @@ +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + from gattlib import * from .uuid import gattlib_uuid_to_uuid, gattlib_uuid_to_int from .exception import handle_return diff --git a/gattlib-py/gattlib/uuid.py b/gattlib-py/gattlib/uuid.py index 62194dc..1d905a5 100644 --- a/gattlib-py/gattlib/uuid.py +++ b/gattlib-py/gattlib/uuid.py @@ -1,3 +1,9 @@ +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + import re from uuid import UUID diff --git a/gattlib-py/setup.py b/gattlib-py/setup.py index 14410d6..08d1a43 100644 --- a/gattlib-py/setup.py +++ b/gattlib-py/setup.py @@ -1,3 +1,9 @@ +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2016-2021, Olivier Martin +# + import os from setuptools import setup, find_packages import subprocess diff --git a/include/gattlib.h b/include/gattlib.h index 17cec7e..3e94bb2 100644 --- a/include/gattlib.h +++ b/include/gattlib.h @@ -1,24 +1,7 @@ /* + * SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later * - * GattLib - GATT Library - * - * Copyright (C) 2016-2020 Olivier Martin - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * + * Copyright (c) 2016-2021, Olivier Martin */ #ifndef __GATTLIB_H__