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

[BUG] chip-tool cannot write empty octstr to any attribute #24054

Closed
bluebin14 opened this issue Dec 13, 2022 · 0 comments · Fixed by #24097
Closed

[BUG] chip-tool cannot write empty octstr to any attribute #24054

bluebin14 opened this issue Dec 13, 2022 · 0 comments · Fixed by #24097
Assignees

Comments

@bluebin14
Copy link
Contributor

Reproduction steps

###Problem

Currently it is not possible to use chip-tool to write empty octstr to any attribute. The closest thing is:

./chip-tool any write-by-id 0x130AFC01 0x130A0001 '""' 1 1

but that writes charstr instead.

###Suggestion

Add support for writing empty octstr.

Bug prevalence

always

GitHub hash of the SDK that was being used

latest

Platform

darwin, raspi

Platform Version(s)

No response

Anything else?

No response

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Dec 15, 2022
Without this fix, these commands all fail to parse:

  chip-tool unittesting write struct-attr '{"a": 1, "b": true, "c": 0, "d":"", "e": "abc", "f": 0, "g": 0, "h": 0}' 17 1
  chip-tool unittesting write struct-attr '{"a": 1, "b": true, "c": 0, "d":"hex:", "e": "abc", "f": 0, "g": 0, "h": 0}' 17 1
  chip-tool unittesting write octet-string "hex:" 17 1
  chip-tool unittesting write-by-id 0 "hex:" 17 1

and with this fix they parse and send correct payloads.

Fixes project-chip#24054
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Dec 15, 2022
Without this fix, these commands all fail to parse:

  chip-tool unittesting write struct-attr '{"a": 1, "b": true, "c": 0, "d":"", "e": "abc", "f": 0, "g": 0, "h": 0}' 17 1
  chip-tool unittesting write struct-attr '{"a": 1, "b": true, "c": 0, "d":"hex:", "e": "abc", "f": 0, "g": 0, "h": 0}' 17 1
  chip-tool unittesting write octet-string "hex:" 17 1
  chip-tool unittesting write-by-id 0 "hex:" 17 1

and with this fix they parse and send correct payloads.

Fixes project-chip#24054
bzbarsky-apple added a commit that referenced this issue Jan 3, 2023
)

* Fix support for 0-length hex-encoded octet strings in chip-tool.

Without this fix, these commands all fail to parse:

  chip-tool unittesting write struct-attr '{"a": 1, "b": true, "c": 0, "d":"", "e": "abc", "f": 0, "g": 0, "h": 0}' 17 1
  chip-tool unittesting write struct-attr '{"a": 1, "b": true, "c": 0, "d":"hex:", "e": "abc", "f": 0, "g": 0, "h": 0}' 17 1
  chip-tool unittesting write octet-string "hex:" 17 1
  chip-tool unittesting write-by-id 0 "hex:" 17 1

and with this fix they parse and send correct payloads.

Fixes #24054

* Apply suggestion from review comment.

Co-authored-by: Jonathan Mégevand <[email protected]>

* Address review comment.

Co-authored-by: Jonathan Mégevand <[email protected]>
kkasperczyk-no pushed a commit to kkasperczyk-no/sdk-connectedhomeip that referenced this issue Mar 15, 2023
…097)

* Fix support for 0-length hex-encoded octet strings in chip-tool.

Without this fix, these commands all fail to parse:

  chip-tool unittesting write struct-attr '{"a": 1, "b": true, "c": 0, "d":"", "e": "abc", "f": 0, "g": 0, "h": 0}' 17 1
  chip-tool unittesting write struct-attr '{"a": 1, "b": true, "c": 0, "d":"hex:", "e": "abc", "f": 0, "g": 0, "h": 0}' 17 1
  chip-tool unittesting write octet-string "hex:" 17 1
  chip-tool unittesting write-by-id 0 "hex:" 17 1

and with this fix they parse and send correct payloads.

Fixes project-chip/connectedhomeip#24054

* Apply suggestion from review comment.

Co-authored-by: Jonathan Mégevand <[email protected]>

* Address review comment.

Co-authored-by: Jonathan Mégevand <[email protected]>
kkasperczyk-no pushed a commit to kkasperczyk-no/sdk-connectedhomeip that referenced this issue Mar 15, 2023
…097)

* Fix support for 0-length hex-encoded octet strings in chip-tool.

Without this fix, these commands all fail to parse:

  chip-tool unittesting write struct-attr '{"a": 1, "b": true, "c": 0, "d":"", "e": "abc", "f": 0, "g": 0, "h": 0}' 17 1
  chip-tool unittesting write struct-attr '{"a": 1, "b": true, "c": 0, "d":"hex:", "e": "abc", "f": 0, "g": 0, "h": 0}' 17 1
  chip-tool unittesting write octet-string "hex:" 17 1
  chip-tool unittesting write-by-id 0 "hex:" 17 1

and with this fix they parse and send correct payloads.

Fixes project-chip/connectedhomeip#24054

* Apply suggestion from review comment.

Co-authored-by: Jonathan Mégevand <[email protected]>

* Address review comment.

Co-authored-by: Jonathan Mégevand <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants