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

Move GetVendorId and GetProductId to DeviceInstanceInfoProvider #19514

Merged
merged 5 commits into from
Jun 15, 2022

Conversation

kkasperczyk-no
Copy link
Contributor

@kkasperczyk-no kkasperczyk-no commented Jun 13, 2022

Problem

GetVendorId and GetProductId are part of ConfigurationManager, while it can be useful to put those data into the factory data.

Change overview

  • Moved GetVendorId and GetProductId to DeviceInstanceInfoProvider to be able to easily override it for the factory data providers.
  • Added DeviceInstanceInfoProviderImpl for the platforms (Darwin, Linux, Android, Tizen, Webos) that has different methods implementation than LegacyDeviceInstanceInfoProvider.

@kkasperczyk-no
Copy link
Contributor Author

kkasperczyk-no commented Jun 14, 2022

Does any test coverage exist for these getters? If not, could some be added to TestConfigurationMgr.cpp? I see that it is using GetDeviceInstanceInfoProvider in TestConfigurationMgr_SerialNumber. Could this approach be duplicated to add some coverage?

The difference is that for serial number or other values tested in unit tests we also have "store" methods, so we can test store and then get value. In the product/vendor parameters case we have only getters, so there is not much to test. Nevertheless I added some basic tests checking the returned error code and making validation whether values fit the allowed limits.

Copy link
Contributor

@bzbarsky-apple bzbarsky-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a followup, we should figure out what to do with StoreVendorId....

src/platform/Darwin/DeviceInstanceInfoProviderImpl.cpp Outdated Show resolved Hide resolved
@LuDuda LuDuda merged commit 09f3e4a into project-chip:master Jun 15, 2022
return err;
}

CHIP_ERROR DeviceInstanceInfoProviderImpl::GetProductId(uint16_t & productId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kkasperczyk-no HI Kamil ,in Android Platform, when you try to get the product ID, it cannot reached here, can you check that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicelyjust yes it looks like I did mistake when moving some methods to other modules. I pushed PR that I hope should fix this: #20208

kkasperczyk-no added a commit to kkasperczyk-no/connectedhomeip that referenced this pull request Jul 1, 2022
In the project-chip#19514 there was a mistake done, as Android methods
were meant to only be moved to other module not change
their implementation.

Restored the previous implementation/
kkasperczyk-no added a commit to kkasperczyk-no/connectedhomeip that referenced this pull request Jul 1, 2022
In the project-chip#19514 there was a mistake done, as Android methods
were meant to only be moved to other module not change
their implementation.

Restored the previous implementation/
andy31415 pushed a commit that referenced this pull request Jul 3, 2022
In the #19514 there was a mistake done, as Android methods
were meant to only be moved to other module not change
their implementation.

Restored the previous implementation/
ArekBalysNordic added a commit to ArekBalysNordic/connectedhomeip that referenced this pull request Jul 13, 2022
In the project-chip#19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
ArekBalysNordic added a commit to ArekBalysNordic/connectedhomeip that referenced this pull request Jul 14, 2022
In the project-chip#19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
ArekBalysNordic added a commit to ArekBalysNordic/connectedhomeip that referenced this pull request Jul 14, 2022
In the project-chip#19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
ArekBalysNordic added a commit to ArekBalysNordic/connectedhomeip that referenced this pull request Jul 14, 2022
In the project-chip#19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
ArekBalysNordic added a commit to ArekBalysNordic/connectedhomeip that referenced this pull request Jul 14, 2022
In the project-chip#19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
ArekBalysNordic added a commit to ArekBalysNordic/connectedhomeip that referenced this pull request Jul 15, 2022
In the project-chip#19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
ArekBalysNordic added a commit to ArekBalysNordic/connectedhomeip that referenced this pull request Jul 15, 2022
In the project-chip#19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
ArekBalysNordic added a commit to ArekBalysNordic/connectedhomeip that referenced this pull request Jul 15, 2022
In the project-chip#19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
ArekBalysNordic added a commit to ArekBalysNordic/connectedhomeip that referenced this pull request Jul 15, 2022
In the project-chip#19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
ArekBalysNordic added a commit to ArekBalysNordic/connectedhomeip that referenced this pull request Jul 15, 2022
In the project-chip#19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
woody-apple pushed a commit that referenced this pull request Jul 19, 2022
In the #19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
github-actions bot pushed a commit that referenced this pull request Jul 19, 2022
In the #19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
woody-apple added a commit that referenced this pull request Jul 19, 2022
… (#20925)

In the #19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.

Co-authored-by: Arkadiusz Bałys <arkadiusz.balys@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants