-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Use ByteSpan for string arguments in command handlers and attribute #5542
Comments
We should use |
I would still suggest using |
Per CHIP spec the encoding of a string is specified to be UTF-8.
That is a good point, because code units are of course unsigned. Nevertheless, the typical API that accepts UTF-8 strings uses I would also be in favor of adding a Another option for now would be to just add a DataModelString type, typedefed to whatever we want at the moment (though we still have to decide that), but then we can change the typedef later as needed if we discover that our choice was wrong. That would at least avoid us making changes in all the places where it's just passed through. But I pretty strongly suspect that we should follow common convention and use |
Any update on this? Still blocking OTA |
Fixes project-chip#5542 Fixes project-chip#6112 Fixes project-chip#7112 Fixes project-chip#7322 Fixes project-chip#7654 Fixes project-chip#7655 Fixes project-chip#8704 Fixes project-chip#8705 Fixes project-chip#8706 Fixes project-chip#8707 Fixes project-chip#9797 Fixes project-chip#9798 Fixes project-chip#10508 Fixes project-chip#10509
Fixes project-chip#5542 Fixes project-chip#6112 Fixes project-chip#7112 Fixes project-chip#7322 Fixes project-chip#7654 Fixes project-chip#7655 Fixes project-chip#8704 Fixes project-chip#8705 Fixes project-chip#8706 Fixes project-chip#8707 Fixes project-chip#9797 Fixes project-chip#9798 Fixes project-chip#10508 Fixes project-chip#10509
Problem
The Zigbee protocol uses Pascal style string, which has 1/2 bytes of length in the front of data instead of NULL terminated. The code in cluster handlers, the attribute managements should accept a ByteSpan.
Proposed Solution
Use ByteSpan for string arguments in command handlers and attribute. Update codegen.
The text was updated successfully, but these errors were encountered: