Skip to content

Conversation

@Koenkk Koenkk requested a review from Nerivec September 22, 2025 20:11
return Number.isNaN(length) ? Buffer.from([]) : this.readBuffer(length);

// See UINT8_TMP_FIX
return this.readBuffer(length);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have to keep the check here, but without NaN use:

        return length < 0xff ? this.readBuffer(length) : Buffer.from([]); // non-value

same for char_str, and long versions (with 0xffff).

https://github.com/Koenkk/zigbee-herdsman/pull/1424/files#diff-fc7e6b2e70437c37018dafdc034cd36e90e974b6745faf828ed43cd34ab4cc1fL142

Copy link
Owner Author

Choose a reason for hiding this comment

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

Updated readCharStr and readOctetStr. I don't think readLongOctetStr has to be updated because it's reading a uint16? (which will still return NaN)

@Koenkk Koenkk merged commit 8ee5b6d into master Sep 23, 2025
4 checks passed
@Koenkk Koenkk deleted the fix/unit8-nan-value branch September 23, 2025 19:40
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.

3 participants