tools/btpclient: Move btpclient to client/btpclient directory
Subsystems (2)
PATCH 1/3 tools/btpclient: Move btpclient to client/btpclient directory
This prepares the split of btp services in per profile files for easier maintenance.
---
.gitignore | 4 ++--
Makefile.tools | 13 +++++++------
{tools => client/btpclient}/btpclient.c | 0
{tools => client/btpclient}/btpclientctl.c | 0
4 files changed, 9 insertions(+), 8 deletions(-)
rename {tools => client/btpclient}/btpclient.c (100%)
rename {tools => client/btpclient}/btpclientctl.c (100%).gitignore +2 -2
@@ -133,8 +133,8 @@ tools/btattach tools/btconfig tools/btmgmt tools/btsnoop -tools/btpclient -tools/btpclientctl +client/btpclient/btpclient +client/btpclient/btpclientctl tools/btmon-logger tools/bluetooth-logger.service tools/mpris-proxy.service
Makefile.tools +7 -6
@@ -583,14 +583,15 @@ test_scripts += test/bluezutils.py \ test/test-gatt-profile test/test-mesh test/agent.py if BTPCLIENT -noinst_PROGRAMS += tools/btpclient tools/btpclientctl +noinst_PROGRAMS += client/btpclient/btpclient client/btpclient/btpclientctl -tools_btpclient_SOURCES = tools/btpclient.c src/shared/btp.c src/shared/btp.h -tools_btpclient_LDADD = lib/libbluetooth-internal.la \ +client_btpclient_btpclient_SOURCES = client/btpclient/btpclient.c \ + src/shared/btp.c src/shared/btp.h +client_btpclient_btpclient_LDADD = lib/libbluetooth-internal.la \ src/libshared-ell.la $(ell_ldadd) -tools/btpclient.$(OBJEXT): src/libshared-ell.la ell/internal +client/btpclient/btpclient.$(OBJEXT): src/libshared-ell.la ell/internal -tools_btpclientctl_SOURCES = tools/btpclientctl.c client/display.c -tools_btpclientctl_LDADD = src/libshared-mainloop.la src/libshared-glib.la \ +client_btpclient_btpclientctl_SOURCES = client/btpclient/btpclientctl.c client/display.c +client_btpclient_btpclientctl_LDADD = src/libshared-mainloop.la src/libshared-glib.la \ lib/libbluetooth-internal.la -lreadline endif
client/btpclient/btpclient.c renamed from tools/btpclient.c +0 -0
client/btpclient/btpclientctl.c renamed from tools/btpclientctl.c +0 -0
Signature · 1 line
2.43.0
PATCH 2/3 client/btpclient: Move btp core service in its own file
Moving the btp services in their own files will simplify maintenance.
--- Makefile.tools | 3 +- client/btpclient/btpclient.c | 139 ++++---------------------------- client/btpclient/btpclient.h | 12 +++ client/btpclient/core.c | 150 +++++++++++++++++++++++++++++++++++ client/btpclient/core.h | 10 +++ 5 files changed, 188 insertions(+), 126 deletions(-) create mode 100644 client/btpclient/btpclient.h create mode 100644 client/btpclient/core.c create mode 100644 client/btpclient/core.h
Makefile.tools +2 -1
@@ -586,7 +586,8 @@ if BTPCLIENT noinst_PROGRAMS += client/btpclient/btpclient client/btpclient/btpclientctl client_btpclient_btpclient_SOURCES = client/btpclient/btpclient.c \ - src/shared/btp.c src/shared/btp.h + src/shared/btp.c src/shared/btp.h \ + client/btpclient/core.c client_btpclient_btpclient_LDADD = lib/libbluetooth-internal.la \ src/libshared-ell.la $(ell_ldadd) client/btpclient/btpclient.$(OBJEXT): src/libshared-ell.la ell/internal
client/btpclient/btpclient.c +14 -125
165 lines not on this page · raw message
client/btpclient/btpclient.h new file +12 -0
@@ -0,0 +1,12 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +/* +* +* BlueZ - Bluetooth protocol stack for Linux +* +* Copyright (C) 2011-2017 Intel Corporation. All rights reserved. +* +*/ + +bool gap_register_service (void ); +void gap_unregister_service (void ); +bool gap_is_service_registered (void );
client/btpclient/core.c new file +150 -0
150 lines not on this page · raw message
client/btpclient/core.h new file +10 -0
@@ -0,0 +1,10 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +/* +* +* BlueZ - Bluetooth protocol stack for Linux +* +* Copyright (C) 2011-2017 Intel Corporation. All rights reserved. +* +*/ + +void core_register_service (struct btp *btp);
Signature · 1 line
2.43.0
PATCH 3/3 client/btpclient: Move btp GAP service in its own file
In reply to Frédéric DanisMoving the btp services in their own files will simplify maintenance.
---
Makefile.tools | 3 +-
client/btpclient/btpclient.c | 2710 +----------------------
client/btpclient/btpclient.h | 41 +-
client/btpclient/core.c | 11 +-
client/btpclient/core.h | 3 +-
client/btpclient/{btpclient.c => gap.c} | 603 +----
client/btpclient/gap.h | 17 +
7 files changed, 167 insertions(+), 3221 deletions(-)
copy client/btpclient/{btpclient.c => gap.c} (84%)
create mode 100644 client/btpclient/gap.hMakefile.tools +2 -1
@@ -587,7 +587,8 @@ noinst_PROGRAMS += client/btpclient/btpclient client/btpclient/btpclientctl client_btpclient_btpclient_SOURCES = client/btpclient/btpclient.c \ src/shared/btp.c src/shared/btp.h \ - client/btpclient/core.c + client/btpclient/core.c \ + client/btpclient/gap.c client_btpclient_btpclient_LDADD = lib/libbluetooth-internal.la \ src/libshared-ell.la $(ell_ldadd) client/btpclient/btpclient.$(OBJEXT): src/libshared-ell.la ell/internal
client/btpclient/btpclient.c +24 -2686
2,808 lines not on this page · raw message
client/btpclient/btpclient.h +38 -3
44 lines not on this page · raw message
client/btpclient/core.c +8 -3
@@ -13,8 +13,10 @@#include "src/shared/btp.h" #include "btpclient.h" #include "core.h" +#include "gap.h" static struct btp *btp; +static struct l_dbus *dbus;static void btp_core_read_commands (uint8_t index,const void *param,uint16_t length,void *user_data)
@@ -57,6 +59,7 @@ static void btp_core_read_services(uint8_t index, const void *param,static void btp_core_register (uint8_t index,const void *param,uint16_t length,void *user_data) { +struct l_dbus_client *client = user_data;const struct btp_core_register_cp *cp = param;if (length <sizeof (*cp))
@@ -73,7 +76,7 @@ static void btp_core_register(uint8_t index, const void *param,if (gap_is_service_registered ()) goto failed; -if (!gap_register_service ()) +if (!gap_register_service (btp, dbus, client)) goto failed;return ;
@@ -130,9 +133,11 @@ failed:btp_send_error (btp,BTP_CORE_SERVICE , index,BTP_ERROR_FAIL ); } -void core_register_service (struct btp *btp_) +void core_register_service (struct btp *btp_,struct l_dbus *dbus_, +struct l_dbus_client *client) { btp = btp_; + dbus = dbus_; btp_register(btp, BTP_CORE_SERVICE, BTP_OP_CORE_READ_SUPPORTED_COMMANDS,
@@ -143,7 +148,7 @@ void core_register_service(struct btp *btp_) btp_core_read_services, NULL, NULL);btp_register (btp,BTP_CORE_SERVICE ,BTP_OP_CORE_REGISTER , - btp_core_register,NULL ,NULL ); + btp_core_register, client,NULL );btp_register (btp,BTP_CORE_SERVICE ,BTP_OP_CORE_UNREGISTER , btp_core_unregister,NULL ,NULL );
client/btpclient/core.h +2 -1
@@ -7,4 +7,5 @@* */ -void core_register_service (struct btp *btp); +void core_register_service (struct btp *btp,struct l_dbus *dbus, +struct l_dbus_client *client);
client/btpclient/gap.c renamed from client/btpclient/btpclient.c +76 -527
88 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.43.0
Part of the diff is not shown here. View the raw message.
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1054634
---Test result---
Test Summary:
CheckPatch PENDING 0.44 seconds GitLint PENDING 0.39 seconds BuildEll PASS 20.97 seconds BluezMake PASS 670.34 seconds MakeCheck PASS 19.24 seconds MakeDistcheck FAIL 43.54 seconds CheckValgrind PASS 297.77 seconds CheckSmatch PASS 363.94 seconds bluezmakeextell PASS 188.31 seconds IncrementalBuild PENDING 0.36 seconds ScanBuild PASS 1059.02 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: MakeDistcheck - FAIL
Desc: Run Bluez Make Distcheck
Output:
../../client/btpclient/core.c:14:10: fatal error: btpclient.h: No such file or directory
14 | #include "btpclient.h"
| ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:7170: client/btpclient/core.o] Error 1
make[2]: *** Waiting for unfinished jobs.... ../../client/btpclient/gap.c:20:10: fatal error: btpclient.h: No such file or directory
20 | #include "btpclient.h"
| ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:7170: client/btpclient/gap.o] Error 1 make[1]: *** [Makefile:4218: all] Error 2
make: *** [Makefile:10818: distcheck] Error 1
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:
---
Regards,
Linux Bluetooth