From c03a040f503d024b2f9e4d378baf470bbd2143d3 Mon Sep 17 00:00:00 2001 From: Wootak Jung Date: Tue, 1 Jun 2021 09:15:30 +0900 Subject: [PATCH] Add robot socket channel Change-Id: Iab39beae121598e659f5e646d306ac7577600269 Signed-off-by: Wootak Jung --- bt-api/bt-common.c | 17 +++++++++++++---- include/bluetooth-api.h | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/bt-api/bt-common.c b/bt-api/bt-common.c index 2dd2700..d82e921 100644 --- a/bt-api/bt-common.c +++ b/bt-api/bt-common.c @@ -1233,10 +1233,19 @@ int _bt_register_profile(bt_register_profile_info_t *info, gboolean use_default_ * RFCOMM channels based on the availability when two services want * to use the RFCOMM along with SPP. Hence bluez makes sure that no * two services use the same SPP RFCOMM channel. */ - if (use_default_rfcomm) - g_variant_builder_add(option_builder, "{sv}", - "Channel", - g_variant_new_uint16(RFCOMM_DEFAULT_PROFILE_CHANNEL)); + if (use_default_rfcomm) { + if (TIZEN_FEATURE_ROBOT_REFERENCE) { + BT_INFO("Use channel 22 for robot"); + g_variant_builder_add(option_builder, "{sv}", + "Channel", + g_variant_new_uint16(RFCOMM_ROBOT_PROFILE_CHANNEL)); + } else { + g_variant_builder_add(option_builder, "{sv}", + "Channel", + g_variant_new_uint16(RFCOMM_DEFAULT_PROFILE_CHANNEL)); + } + } + if (info->service) g_variant_builder_add(option_builder, "{sv}", "Service", diff --git a/include/bluetooth-api.h b/include/bluetooth-api.h index 7ee62b6..6e916ac 100644 --- a/include/bluetooth-api.h +++ b/include/bluetooth-api.h @@ -74,6 +74,7 @@ extern "C" { * This is RFCOMM default Channel Value */ #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0 +#define RFCOMM_ROBOT_PROFILE_CHANNEL 22 /** * This is maximum length for search value string for PBAP Phonebook Search -- 2.7.4