Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tizen] Do not fail if BLE is already connected #25725

Merged
merged 2 commits into from
Mar 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/platform/Tizen/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,19 @@ static void __AdapterStateChangedCb(int result, bt_adapter_state_e adapterState,

void BLEManagerImpl::GattConnectionStateChangedCb(int result, bool connected, const char * remoteAddress, void * userData)
{
ChipLogProgress(DeviceLayer, "Gatt Connection State Changed: %s result [%d]", connected ? "Connected" : "Disconnected", result);

if (result != BT_ERROR_NONE)
ChipLogProgress(DeviceLayer, "Gatt Connection State Changed [%u]: %s", result, connected ? "Connected" : "Disconnected");
switch (result)
{
ChipLogError(DeviceLayer, "%s", connected ? "Connection req failed" : "Disconnection req failed");
case BT_ERROR_NONE:
case BT_ERROR_ALREADY_DONE:
sInstance.HandleConnectionEvent(connected, remoteAddress);
break;
default:
ChipLogError(DeviceLayer, "%s: %s", connected ? "Connection req failed" : "Disconnection req failed",
get_error_message(result));
if (connected)
sInstance.NotifyHandleConnectFailed(CHIP_ERROR_INTERNAL);
}
else
{
sInstance.HandleConnectionEvent(connected, remoteAddress);
}
}

gboolean BLEManagerImpl::_BleInitialize(void * userData)
Expand Down