Skip to content

feat: add enumeration management group#71

Merged
JPHutchins merged 1 commit intointercreate:mainfrom
sgfeniex:feature/enum-management
Aug 25, 2025
Merged

feat: add enumeration management group#71
JPHutchins merged 1 commit intointercreate:mainfrom
sgfeniex:feature/enum-management

Conversation

@sgfeniex
Copy link
Contributor

@sgfeniex sgfeniex commented Jul 28, 2025

Adds the enumeration management group to this layer

related: JPHutchins/smp#40

JPHutchins/smp#44 is a required fix that enables parsing GroupDetailsResponse

@sgfeniex sgfeniex marked this pull request as draft July 28, 2025 20:41
@sgfeniex
Copy link
Contributor Author

sgfeniex commented Jul 28, 2025

draft this until I can get it working in smpmgr

related:

│                                                                                                                                                                                                                               │
│ ╭─────────────────────────────────────────────────────────────────────── locals ───────────────────────────────────────────────────────────────────────╮                                                                      │
│ │ data = {                                                                                                                                             │                                                                      │
│ │        │   'header': Header(                                                                                                                         │                                                                      │
│ │        │   │   op=<OP.READ_RSP: 1>,                                                                                                                  │                                                                      │
│ │        │   │   version=<Version.V2: 1>,                                                                                                              │                                                                      │
│ │        │   │   flags=<Flag.UNUSED: 0>,                                                                                                               │                                                                      │
│ │        │   │   length=38,                                                                                                                            │                                                                      │
│ │        │   │   group_id=10,                                                                                                                          │                                                                      │
│ │        │   │   sequence=1,                                                                                                                           │                                                                      │
│ │        │   │   command_id=3                                                                                                                          │                                                                      │
│ │        │   ),                                                                                                                                        │                                                                      │
│ │        │   'groups': [{'group': 100, 'name': '', 'handlers': 40}],                                                                                   │                                                                      │
│ │        │   'smp_data': bytearray(b'\t\x00\x00&\x00\n\x01\x03\xbffgroups\x9f\xbfegroup\x18ddname`hhandlers\x18(\xff\xff\xff')                         │                                                                      │
│ │        }                                                                                                                                             │                                                                      │
│ │ self = EnumManagementErrorV2()                                                                                                                       │                                                                      │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                      │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ValidationError: 2 validation errors for EnumManagementErrorV2
err
  Field required [type=missing, input_value={'header': Header(op=<OP....lers\x18(\xff\xff\xff')}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing
groups
  Extra inputs are not permitted [type=extra_forbidden, input_value=[{'group': 100, 'name': '', 'handlers': 40}], input_type=list]
    For further information visit https://errors.pydantic.dev/2.11/v/extra_forbidden

@sgfeniex
Copy link
Contributor Author

sgfeniex commented Jul 28, 2025

Looks like we might need a change in smp as well. GroupDetails.id might need to become GroupDetails.group. Checking Zephyr source and docs on this.

...seems to check out.

https://docs.zephyrproject.org/latest/services/device_mgmt/smp_groups/smp_group_10.html#details-on-supported-groups-request

@JPHutchins
Copy link
Collaborator

Looks like we might need a change in smp as well. GroupDetails.id might need to become GroupDetails.group. Checking Zephyr source and docs on this.

...seems to check out.

https://docs.zephyrproject.org/latest/services/device_mgmt/smp_groups/smp_group_10.html#details-on-supported-groups-request

I agree, and that's a welcome change to the API:

https://github.com/JPHutchins/smp/blob/085c8b17e0af7f76f5b861c202f54c6306efab0c/smp/enumeration_management.py#L107-L117

@JPHutchins
Copy link
Collaborator

Looks like we might need a change in smp as well. GroupDetails.id might need to become GroupDetails.group. Checking Zephyr source and docs on this.
...seems to check out.
https://docs.zephyrproject.org/latest/services/device_mgmt/smp_groups/smp_group_10.html#details-on-supported-groups-request

I agree, and that's a welcome change to the API:

https://github.com/JPHutchins/smp/blob/085c8b17e0af7f76f5b861c202f54c6306efab0c/smp/enumeration_management.py#L107-L117

Fix is in SMP 3.3.2: https://pypi.org/project/smp/

Note: I think that the 3 repo layout is not worth it for dynamic versioning. Then again, 3 python packages in one repo... I'd need to see an example 🤣.

@JPHutchins
Copy link
Collaborator

@sgfeniex FYI that there will be a (good) breaking change upstream in SMP soon: JPHutchins/smp#45

@sgfeniex
Copy link
Contributor Author

sgfeniex commented Aug 4, 2025

That is a cool change and I am looking forward to it. I'll keep this PR draft/wip until the SMP work is merged.

@JPHutchins
Copy link
Collaborator

That is a cool change and I am looking forward to it. I'll keep this PR draft/wip until the SMP work is merged.

I have a slight preference for getting enumeration management available in smpmgr before proceeding with the breaking changes. Perhaps within 4 weeks or so?

@sgfeniex sgfeniex force-pushed the feature/enum-management branch from c58a83f to c6028a5 Compare August 8, 2025 13:52
@sgfeniex sgfeniex marked this pull request as ready for review August 8, 2025 13:53
Copy link
Collaborator

@JPHutchins JPHutchins left a comment

Choose a reason for hiding this comment

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

Thanks!

@JPHutchins JPHutchins merged commit 39bbd31 into intercreate:main Aug 25, 2025
21 checks passed
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