- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a little question.
My PSOC6 Device is in GATT peripheral mode and allows remote devices to connect and bond to it.
I use mtb2.4 and bless lib.
How I can have easily the remote bluetooth device name (pc name/smartphone name) when a connection is made
Thank you for your support,
Regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Yugandhar
Thank you for your feedback,
I made some search on how to do it and I found.
I share below in case if someone need it
DEBUG_LOG("AUTHENTICATION_READ_CENTRAL_DEVICE_NAME");
cy_stc_ble_gattc_read_by_type_req_t readByTypeReqParam;
readByTypeReqParam.range.startHandle = CY_BLE_GATT_ATTR_HANDLE_START_RANGE;
readByTypeReqParam.range.endHandle = CY_BLE_GATT_ATTR_HANDLE_END_RANGE;
readByTypeReqParam.uuid.uuid16 = CY_BLE_UUID_CHAR_DEVICE_NAME;
readByTypeReqParam.uuidFormat = CY_BLE_GATT_16_BIT_UUID_FORMAT;
readByTypeReqParam.connHandle = conn_handle;
ble_api_result = Cy_BLE_GATTC_ReadUsingCharacteristicUuid(&readByTypeReqParam);
if(ble_api_result == CY_BLE_SUCCESS)
{
authState = AUTHENTICATION_READING_CENTRAL_DEV_NAME;
/* Wait for CY_BLE_EVT_GATTC_READ_BY_TYPE_RSP event */
}
else
{
DEBUG_LOG("Cy_BLE_GATTC_ReadUsingCharacteristicUuid API Error: 0x%x \r\n", ble_api_result);
authState = AUTHENTICATION_UPDATE_CONN_PARAM;
}
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
In MTB, we would recommend to use the new AIROC BTStack. BLESS Stack will be discontinued, and this stack will be supported only with PSoC Creator.
There is no application level API to read the peer connected device's name. You can use the Cy_BLE_GAP_GetPeerBdAddr() API to read the peer connected device's address and can be used to identify the central device.
Thanks,
P Yugandhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Yugandhar
Thank you for your feedback,
I made some search on how to do it and I found.
I share below in case if someone need it
DEBUG_LOG("AUTHENTICATION_READ_CENTRAL_DEVICE_NAME");
cy_stc_ble_gattc_read_by_type_req_t readByTypeReqParam;
readByTypeReqParam.range.startHandle = CY_BLE_GATT_ATTR_HANDLE_START_RANGE;
readByTypeReqParam.range.endHandle = CY_BLE_GATT_ATTR_HANDLE_END_RANGE;
readByTypeReqParam.uuid.uuid16 = CY_BLE_UUID_CHAR_DEVICE_NAME;
readByTypeReqParam.uuidFormat = CY_BLE_GATT_16_BIT_UUID_FORMAT;
readByTypeReqParam.connHandle = conn_handle;
ble_api_result = Cy_BLE_GATTC_ReadUsingCharacteristicUuid(&readByTypeReqParam);
if(ble_api_result == CY_BLE_SUCCESS)
{
authState = AUTHENTICATION_READING_CENTRAL_DEV_NAME;
/* Wait for CY_BLE_EVT_GATTC_READ_BY_TYPE_RSP event */
}
else
{
DEBUG_LOG("Cy_BLE_GATTC_ReadUsingCharacteristicUuid API Error: 0x%x \r\n", ble_api_result);
authState = AUTHENTICATION_UPDATE_CONN_PARAM;
}
Regards