-
Notifications
You must be signed in to change notification settings - Fork 3
RDKEMW-15846 : Elite classic controller is not disconnect on standby #52
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
base: develop
Are you sure you want to change the base?
Changes from all commits
6e81d7e
2d94910
2e03b61
b267872
0e9e89a
36a497d
abc5d80
7c25b41
9d47b90
b7f6b66
8857e25
d55b49d
90131d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5135,6 +5135,49 @@ BTRCore_ConnectDevice ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return enBTRCoreSuccess; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enBTRCoreRet btrCore_UpdateDeviceBlockState ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tBTRCoreHandle hBTRCore, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tBTRCoreDevId aBTRCoreDevId, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enBTRCoreDeviceType aenBTRCoreDevType, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| int isBlocked | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+5138
to
+5142
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stBTRCoreHdl* pstlhBTRCore = NULL; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!hBTRCore) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BTRCORELOG_ERROR("Invalid BT Core Handle\n"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return enBTRCoreInvalidArg; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pstlhBTRCore = (stBTRCoreHdl*)hBTRCore; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+5138
to
+5152
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const char *pDevicePath = NULL; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| int i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enBTDeviceType enBTDevice = enBTDevUnknown; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (i = 0; i < pstlhBTRCore->numOfPairedDevices; ++i) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (pstlhBTRCore->stKnownDevicesArr[i].tDeviceId == aBTRCoreDevId) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pDevicePath = pstlhBTRCore->stKnownDevicesArr[i].pcDevicePath; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enBTDevice = pstlhBTRCore->stKnownDevicesArr[i].enDeviceType; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+5155
to
+5160
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!pDevicePath) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BTRCORELOG_ERROR("Device ID %lld not found\n", aBTRCoreDevId); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return enBTRCoreDeviceNotFound; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+5154
to
+5169
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| int i; | |
| enBTDeviceType enBTDevice = enBTDevUnknown; | |
| for (i = 0; i < pstlhBTRCore->numOfPairedDevices; ++i) { | |
| if (pstlhBTRCore->stKnownDevicesArr[i].tDeviceId == aBTRCoreDevId) { | |
| pDeviceAddress = pstlhBTRCore->stKnownDevicesArr[i].pcDeviceAddress; | |
| enBTDevice = pstlhBTRCore->stKnownDevicesArr[i].enDeviceType; | |
| break; | |
| } | |
| } | |
| if (!pDeviceAddress) { | |
| BTRCORELOG_ERROR("Device ID %lld not found\n", aBTRCoreDevId); | |
| return enBTRCoreDeviceNotFound; | |
| } | |
| enBTDeviceType enBTDevice = enBTDevUnknown; | |
| stBTRCoreBTDevice lstBTDeviceInfo; | |
| memset(&lstBTDeviceInfo, 0, sizeof(lstBTDeviceInfo)); | |
| /* Use common helper to resolve device ID to address/type, so that | |
| * aBTRCoreDevId and aenBTRCoreDevType are handled consistently with | |
| * other operations (connect/disconnect/unpair, etc.). | |
| */ | |
| if (btrCore_GetDeviceInfo(pstlhBTRCore, | |
| aBTRCoreDevId, | |
| aenBTRCoreDevType, | |
| &lstBTDeviceInfo) != enBTRCoreSuccess) { | |
| BTRCORELOG_ERROR("Device ID %lld not found\n", aBTRCoreDevId); | |
| return enBTRCoreDeviceNotFound; | |
| } | |
| pDeviceAddress = lstBTDeviceInfo.pcDeviceAddress; | |
| enBTDevice = lstBTDeviceInfo.enDeviceType; |
Copilot
AI
Mar 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The third argument to BtrCore_BTSetProp is enBTOpIfceType (e.g., enBTDevice), but this function defines enBTDevice as an enBTDeviceType variable and passes it through. That’s a type/semantic mismatch and will either not compile cleanly or call the API with the wrong enum value. Pass the enBTDevice interface type constant here, and keep the device-type enum separate if needed.
Copilot
AI
Mar 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are existing unit tests for btrCore.c logic in unitTest/test_btrCore.c, but no tests cover this newly introduced device-block/unblock API. Please add unit tests for at least: invalid handle, device-not-found, and successful blocked/unblocked property setting (with BtrCore_BTSetProp mocked).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds a new externally visible API, but there are no corresponding unit tests (the repo has extensive coverage in
unitTest/test_btrCore.cfor otherBTRCore_*APIs). Please add tests that cover success/failure paths (e.g., device not found, BTSetProp failure, and block/unblock values).