Because the last 1 byte of the path is missed,
bt-api did not find the server information.
Change-Id: Ifc9564736763b975d38fa5f7a750109c7a4f957b
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
for (l = rfcomm_nodes; l != NULL; l = l->next) {
rfcomm_info_t *info = l->data;
for (l = rfcomm_nodes; l != NULL; l = l->next) {
rfcomm_info_t *info = l->data;
- if (g_strcmp0(info->path, path) == 0)
+ if (g_ascii_strcasecmp(info->path, path) == 0)
for (l = rfcomm_nodes; l != NULL; l = l->next) {
rfcomm_info_t *info = l->data;
for (l = rfcomm_nodes; l != NULL; l = l->next) {
rfcomm_info_t *info = l->data;
- if (g_strcmp0(info->uuid, uuid) == 0)
+ if (g_ascii_strcasecmp(info->uuid, uuid) == 0)
- if (strcmp(info->uuid, uuid) == 0)
+ if (g_ascii_strcasecmp(info->uuid, uuid) == 0)
return TRUE;
return FALSE;
return TRUE;
return FALSE;
memset(&ev, 0, sizeof(ev));
_bt_hal_convert_addr_string_to_type(ev.bdaddr, address);
_bt_hal_convert_uuid_string_to_type(ev.uuid, uuid);
memset(&ev, 0, sizeof(ev));
_bt_hal_convert_addr_string_to_type(ev.bdaddr, address);
_bt_hal_convert_uuid_string_to_type(ev.uuid, uuid);
- memcpy(ev.name, name, strlen(name) - 1);
+ g_strlcpy((char *)ev.name, name, BT_HAL_DEVICE_NAME_LENGTH_MAX);
+
- memcpy(ev.path, path, strlen(path) - 1);
+ g_strlcpy((char *)ev.path, path, BT_HAL_PATH_NAME_LENGTH_MAX);
+
ev.fd = fd;
handle_stack_msg event_cb = _bt_hal_get_stack_message_handler();
ev.fd = fd;
handle_stack_msg event_cb = _bt_hal_get_stack_message_handler();
#define BT_HAL_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
#define BT_HAL_INTERFACE_NAME_LENGTH 16
#define BT_HAL_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
#define BT_HAL_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
#define BT_HAL_INTERFACE_NAME_LENGTH 16
#define BT_HAL_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
+#define BT_HAL_PATH_NAME_LENGTH_MAX 248 /**< This specifies maximum path name length */
#define BT_HAL_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
#define BT_HAL_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
#define BT_HAL_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
#define BT_HAL_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
#define BT_HAL_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
#define BT_HAL_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
#define BT_NODE_NAME_LEN 50
#define BT_UUID_LENGTH_MAX 16
#define BT_UUID_STRING_SIZE 37
#define BT_NODE_NAME_LEN 50
#define BT_UUID_LENGTH_MAX 16
#define BT_UUID_STRING_SIZE 37
+#define BT_NAME_LENGTH_MAX 248
static const char BT_SERVICE_BASE_UUID[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
static const char BT_SERVICE_BASE_UUID[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
char address[BT_ADDRESS_STRING_SIZE];
char uuid_str[BT_UUID_STRING_SIZE];
int result = BLUETOOTH_ERROR_NONE;
char address[BT_ADDRESS_STRING_SIZE];
char uuid_str[BT_UUID_STRING_SIZE];
int result = BLUETOOTH_ERROR_NONE;
- char name[249] = {0, };
- char path[249] = {0, };
+ char name[BT_NAME_LENGTH_MAX + 1] = {0, };
+ char path[BT_NAME_LENGTH_MAX + 1] = {0, };
int fd;
BT_DBG("+");
_bt_convert_addr_type_to_string(address, auth_event->address.addr);
_bt_service_convert_uuid_type_to_string(uuid_str, auth_event->uuid.uuid);
int fd;
BT_DBG("+");
_bt_convert_addr_type_to_string(address, auth_event->address.addr);
_bt_service_convert_uuid_type_to_string(uuid_str, auth_event->uuid.uuid);
- memcpy(name, auth_event->name, sizeof(auth_event->name) - 1);
- memcpy(path, auth_event->path, sizeof(auth_event->path) - 1);
+ memcpy(name, auth_event->name, BT_NAME_LENGTH_MAX);
+ memcpy(path, auth_event->path, BT_NAME_LENGTH_MAX);
fd = auth_event->fd;
BT_INFO("Address: %s, UUID: %s, Name: %s, Path: %s, Fd: %d", address, uuid_str, name, path, fd);
_bt_send_event(BT_RFCOMM_SERVER_EVENT,
fd = auth_event->fd;
BT_INFO("Address: %s, UUID: %s, Name: %s, Path: %s, Fd: %d", address, uuid_str, name, path, fd);
_bt_send_event(BT_RFCOMM_SERVER_EVENT,