Skip to content

add support of ThreadsResponse id name type fields#303

Open
RokuSerhii wants to merge 4 commits intorokucommunity:masterfrom
RokuSerhii:treadresponce.additional.fields
Open

add support of ThreadsResponse id name type fields#303
RokuSerhii wants to merge 4 commits intorokucommunity:masterfrom
RokuSerhii:treadresponce.additional.fields

Conversation

@RokuSerhii
Copy link
Copy Markdown
Contributor

No description provided.

// build the list of threads
for (let i = 0; i < threadsCount; i++) {
const thread = {} as ThreadInfo;
const flags = smartBuffer.readUInt8();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Many other places in the debug protocol, the specific response includes a flag saying a new property was available. I would expect the firmware to set the flag on this response, and then our code in roku-debug would read it from that flag, instead of inspecting the debug protocol version.

Copy link
Copy Markdown
Contributor Author

@RokuSerhii RokuSerhii Mar 23, 2026

Choose a reason for hiding this comment

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

We could change the logic to read all packetLength smartBuffer.readOffset < response.data.packetLength instead of tracking the protocol version, as adding an additional property that indicates about new properties anyway will corrupt the thread response structure and also the debugger client needs to know how to read this new data

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But that's what the flags field is specifically for. Look at VariablesResponse as an example. The bitwise flags field is there to intentionally NOT corrupt the repsonses, and indicates that new data is available.

And ThreadsResponse already supports that concept. We're currently reading IS_PRIMARY, but all the other bit slots are fair game. (so 0x02 for example could be includes_additional_thread_indo).

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