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

Added generation of unique identifiers #59

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

kkasperczyk-no
Copy link
Owner

Problem

Currently there are several problems related to the unique ids:

  • There is no support for getting and storing unique id attribute from Basic cluster
  • There is no support for getting unique id for rotating device id calculation purpose. That unique id is different one from
    the Basic cluster unique id and is utilized as an input key for rotating device id generation algorithm
  • Rotating device id is generated using serial number what is not compliant with the spec (it should be unique id)

Change overview

  • Added methods to get and store unique id utilized in Basic cluster
  • For all platforms added generic method generating random unique id utilized in Basic cluster
  • Added GetRotatingDeviceIdUniqueId method for getting unique id utilized by rotating device id
  • Replaced using serial number with unique id for generating rotating device id.
  • Disabled CONFIG_FPU for nrfconnect platform, as it turned out to lead to MPU_FAULT and system crash on BLE C3 characteristic read

Testing

Currently there are several problems related to the unique ids:
* There is no support for getting and storing unique id attribute
from Basic cluster
* There is no support for getting unique id for rotating device
id calculation purpose. That unique id is different one from
the Basic cluster unique id and is utilized as an input key
for rotating device id generation algorithm
* Rotating device id is generated using serial number what is not
compliant with the spec (it should be unique id)

* Added methods to get and store unique id utilized in Basic
cluster
* For all platforms added generic method generating random
unique id utilized in Basic cluster
* Added GetRotatingDeviceIdUniqueId method for getting unique
id utilized by rotating device id
* Replaced using serial number with unique id for generating
rotating device id.
* Disabled CONFIG_FPU for nrfconnect platform, as it turned
out to lead to MPU_FAULT and system crash on BLE C3 characteristic
read
ReturnErrorOnFailure(chip::DeviceLayer::ConfigurationMgr().GetLifetimeCounter(lifetimeCounter));
return AdditionalDataPayloadGenerator().generateRotatingDeviceIdAsHexString(
lifetimeCounter, serialNumber, strlen(serialNumber), rotatingDeviceIdHexBuffer, rotatingDeviceIdHexBufferSize,
rotatingDeviceIdValueOutputSize);
lifetimeCounter, reinterpret_cast<char *>(rotatingDeviceIdUniqueId), rotatingDeviceIdUniqueIdSize,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a need for generateRotatingDeviceIdAsHexString to take const char* rather than const uint8_t*` now? Maybe those casts could be removed?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Do you mean changing generateRotatingDeviceIdAsHexString API?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes

size_t bufSize)
{
#ifdef CHIP_DEVICE_CONFIG_TEST_ROTATING_DEVICE_ID_UNIQUE_ID
uint8_t uniqueId[] = CHIP_DEVICE_CONFIG_TEST_ROTATING_DEVICE_ID_UNIQUE_ID;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
uint8_t uniqueId[] = CHIP_DEVICE_CONFIG_TEST_ROTATING_DEVICE_ID_UNIQUE_ID;
uint8_t uniqueId[kRotatingDeviceIDUniqueIDLength] = CHIP_DEVICE_CONFIG_TEST_ROTATING_DEVICE_ID_UNIQUE_ID;

And you can remove one of the checks below.

kkasperczyk-no pushed a commit that referenced this pull request Aug 10, 2022
[nrfconnect] matter-wifi: add Wi-Fi network scan functionality

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
kkasperczyk-no pushed a commit that referenced this pull request Jan 23, 2023
…vice (project-chip#24378)

* [Telink] Moved LightingManager into PWMDevice

* Restyled by clang-format

* [Telink] Adding lighting color feature (#59)

* [Telink] Added lighting color feature

* [Telink] Added tlsr9518adk80d.overlay to lighting-app

* [Telink] Updated RGB functionality

* [Telink] Updated RGB PWM pins

Co-authored-by: Alex Tsitsiura <s07641069@gmail.com>

* Restyled by whitespace

* Restyled by clang-format

* [Telink] Minor changes

* [Telink] Add 'telink reboot' shell CLI command (#63)

* [Telink] Restyled

Co-authored-by: Serhii Salamakha <serhii.salamakha@gmail.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Dmytro Huz <75682372+interfer@users.noreply.github.com>
kkasperczyk-no pushed a commit that referenced this pull request Jan 27, 2023
* [Telink] Moved LightingManager into PWMDevice

* Restyled by clang-format

* [Telink] Adding lighting color feature (#59)

* [Telink] Added lighting color feature

* [Telink] Added tlsr9518adk80d.overlay to lighting-app

* [Telink] Updated RGB functionality

* [Telink] Updated RGB PWM pins

Co-authored-by: Alex Tsitsiura <s07641069@gmail.com>

* Restyled by whitespace

* Restyled by clang-format

* [Telink] Minor changes

* [Telink] Add 'telink reboot' shell CLI command (#63)

* [Telink] Restyled

* [Telink] Update Telink Docker image (Zephyr update)

Co-authored-by: Serhii Salamakha <serhii.salamakha@gmail.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Dmytro Huz <75682372+interfer@users.noreply.github.com>
kkasperczyk-no pushed a commit that referenced this pull request Feb 22, 2023
* [Telink] Introduce power management (#72)

* [Telink] Moved LightingManager into PWMDevice

* [Telink] Enabled PM for Light Switch example

* [Telink] Added OpenThread power management support

* [Telink] Configured project for the lowest power consumption

* [Telink] Restyle

* [Telink] Adapt system status LED and buttons with Power Mode usage

* [Telink] Fixed factory reset in pool mode of button manager

* [Telink] Updated Factory Reset trigger

* Restyled by clang-format

* [Telink] Adding lighting color feature (#59)

* [Telink] Added lighting color feature

* [Telink] Added tlsr9518adk80d.overlay to lighting-app

* [Telink] Updated RGB functionality

* [Telink] Updated RGB PWM pins

Co-authored-by: Alex Tsitsiura <s07641069@gmail.com>

* Restyled by whitespace

* Restyled by clang-format

* [Telink] Minor changes

* [Telink] Add 'telink reboot' shell CLI command (#63)

* [Telink] Restyled

* [Telink] Enable CHIP SED support

* [Telink] Update new configs name/location

* [Telink] restyle

* [Telink] Add PM to all apps

* [Telink] set default configs

* [Telink] Revert EOL

* [Telink] Revert EOL

---------

Co-authored-by: Serhii Salamakha <serhii.salamakha@gmail.com>
Co-authored-by: Misha.Tkachenko <mishadesh@gmail.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Dmytro Huz <75682372+interfer@users.noreply.github.com>

* [Telink] Copyright update

* [Telink] Fix builds after merge of master

* [Telink] Review fixes

* [Telink] Custom RF power values example

* [Telink] Remove Level Control cluster from binding

* [Telink] Add CONFIG_MATTER_LOG_LEVEL

---------

Co-authored-by: Serhii Salamakha <serhii.salamakha@gmail.com>
Co-authored-by: Misha.Tkachenko <mishadesh@gmail.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Dmytro Huz <75682372+interfer@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants