From 9942dcdb552ab0ad987b10136d13cda9f571fcb1 Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Thu, 18 Dec 2014 17:24:37 -0800 Subject: [PATCH] profiles/gatt: Rename profile to gap Since this built in profile only handles the GAP service, this patch renames it to gap. --- Makefile.plugins | 4 ++-- profiles/{gatt => gap}/gas.c | 37 +++++++++++++++++------------------- 2 files changed, 19 insertions(+), 22 deletions(-) rename profiles/{gatt => gap}/gas.c (82%) diff --git a/Makefile.plugins b/Makefile.plugins index 0448b9143..52b51c5c7 100644 --- a/Makefile.plugins +++ b/Makefile.plugins @@ -72,8 +72,8 @@ builtin_sources += profiles/health/mcap.h profiles/health/mcap.c \ profiles/health/hdp_util.h profiles/health/hdp_util.c endif -builtin_modules += gatt -builtin_sources += profiles/gatt/gas.c +builtin_modules += gap +builtin_sources += profiles/gap/gas.c builtin_modules += scanparam builtin_sources += profiles/scanparam/scan.c diff --git a/profiles/gatt/gas.c b/profiles/gap/gas.c similarity index 82% rename from profiles/gatt/gas.c rename to profiles/gap/gas.c index 9d5d31ed5..a4028dd0b 100644 --- a/profiles/gatt/gas.c +++ b/profiles/gap/gas.c @@ -13,11 +13,6 @@ * 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 - * */ #ifdef HAVE_CONFIG_H @@ -56,7 +51,7 @@ struct gas { guint attioid; }; -static GSList *devices = NULL; +static GSList *devices; static void gas_free(struct gas *gas) { @@ -73,7 +68,7 @@ static int cmp_device(gconstpointer a, gconstpointer b) const struct gas *gas = a; const struct btd_device *device = b; - return (gas->device == device ? 0 : -1); + return gas->device == device ? 0 : -1; } static void gap_appearance_cb(guint8 status, const guint8 *pdu, guint16 plen, @@ -171,7 +166,7 @@ static void gas_unregister(struct btd_device *device) gas_free(gas); } -static int gatt_driver_probe(struct btd_service *service) +static int gap_driver_probe(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); struct gatt_primary *gap; @@ -186,31 +181,33 @@ static int gatt_driver_probe(struct btd_service *service) return gas_register(device, &gap->range); } -static void gatt_driver_remove(struct btd_service *service) +static void gap_driver_remove(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); gas_unregister(device); } -static struct btd_profile gatt_profile = { - .name = "gap-gatt-profile", - .remote_uuid = GATT_UUID, - .device_probe = gatt_driver_probe, - .device_remove = gatt_driver_remove +static struct btd_profile gap_profile = { + .name = "gap-profile", + .remote_uuid = GAP_UUID, + .device_probe = gap_driver_probe, + .device_remove = gap_driver_remove }; -static int gatt_init(void) +static int gap_init(void) { - btd_profile_register(&gatt_profile); + devices = NULL; + + btd_profile_register(&gap_profile); return 0; } -static void gatt_exit(void) +static void gap_exit(void) { - btd_profile_unregister(&gatt_profile); + btd_profile_unregister(&gap_profile); } -BLUETOOTH_PLUGIN_DEFINE(gatt, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, - gatt_init, gatt_exit) +BLUETOOTH_PLUGIN_DEFINE(gap, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, + gap_init, gap_exit) -- 2.47.3