Skip to content

Commit

Permalink
Pairing request is posted to btmgr instead of connection request. (rd…
Browse files Browse the repository at this point in the history
…kcentral#5695)

Reason for change: Using the == operator in the if check directly checks for string equality
Test Procedure: Test the auto-connect feature for BT gamepads from UI.
Risks: Medium
Signed-off-by: Natraj Muthusamy <[email protected]>
  • Loading branch information
NatrajMuthusamygithubpractice committed Sep 11, 2024
1 parent ffa5d3a commit 9e66835
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Bluetooth/Bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,15 +788,15 @@ namespace WPEFramework

lstBtrMgrEvtRsp.m_deviceHandle = deviceID;

if (eventType.compare(EVT_PAIRING_REQUEST)) {
if (eventType == EVT_PAIRING_REQUEST) {
lstBtrMgrEvtRsp.m_eventType = BTRMGR_EVENT_RECEIVED_EXTERNAL_PAIR_REQUEST;
lstBtrMgrEvtRsp.m_eventResp = Utils::String::equal(respValue, "ACCEPTED") ? 1 : 0;
}
else if (eventType.compare(EVT_CONNECTION_REQUEST)) {
else if (eventType == EVT_CONNECTION_REQUEST) {
lstBtrMgrEvtRsp.m_eventType = BTRMGR_EVENT_RECEIVED_EXTERNAL_CONNECT_REQUEST;
lstBtrMgrEvtRsp.m_eventResp = Utils::String::equal(respValue, "ACCEPTED") ? 1 : 0;
}
else if (eventType.compare(EVT_PLAYBACK_REQUEST)) {
else if (eventType == EVT_PLAYBACK_REQUEST) {
lstBtrMgrEvtRsp.m_eventType = BTRMGR_EVENT_RECEIVED_EXTERNAL_PLAYBACK_REQUEST;
lstBtrMgrEvtRsp.m_eventResp = Utils::String::equal(respValue, "ACCEPTED") ? 1 : 0;
}
Expand Down

0 comments on commit 9e66835

Please sign in to comment.