Skip to content

Enable HDLC frames > 255 bytes#46

Open
MarcelloZanghieri2 wants to merge 1 commit into
Gurux:masterfrom
MarcelloZanghieri2:long-hdlc-frames
Open

Enable HDLC frames > 255 bytes#46
MarcelloZanghieri2 wants to merge 1 commit into
Gurux:masterfrom
MarcelloZanghieri2:long-hdlc-frames

Conversation

@MarcelloZanghieri2

Copy link
Copy Markdown

Allow HDLC frames longer than 255 bytes.

@mrv96

mrv96 commented Jul 9, 2026

Copy link
Copy Markdown

Hi,

whitout this PR the library breaks if HDLC frames longer than 255 due to the rising of the following exception:

ValueError: byte must be in range(0, 256)

Could you merge this PR?

Thank you

@mrv96

mrv96 commented Jul 9, 2026

Copy link
Copy Markdown

Actually the fix can also be applied to the upstream method

def setUInt8(self, item, index=None):
if index is None:
self.setUInt8(item, self.size)
self.size += 1
else:
if index >= self.capacity:
self.capacity = index + self.__ARRAY_CAPACITY
self._data[index] = item

The other methods like setInt8() seems to be already ok.

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