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

Object Model Reporting issues with CAN connected Expansion boards - "unsupported type code 24" #1059

Open
T3P3 opened this issue Nov 16, 2024 · 2 comments
Assignees
Labels
bug Bug that has been reproduced Object Model Related to the Object Model

Comments

@T3P3
Copy link
Contributor

T3P3 commented Nov 16, 2024

Only checked in SBC mode thus far.
Impacts 3.6.beta1 and 3.6.beta2 (other versions not checked)
Various OM keys within boards[] do not report correctly for expansion boards. e.g:

boards[1].firmwareDate
boards[1].firmwareFileName
boards[1].firmwareVersion
boards[1].name
boards[1].shortName

In all cases these report:
unsupported type code 24

Other keys do report correctly, e.g.:

boards[1].drivers[0].status
boards[1].uniqueId
boards[1].state

Work around:
Appending an empty string to the query/use of the result works:

e.g.

echo (boards[1].firmwareVersion^"")
global firmwareVersionTB = (boards[1].firmwareVersion^"")
@T3P3 T3P3 added bug Bug that has been reproduced Object Model Related to the Object Model labels Nov 16, 2024
@dc42
Copy link
Collaborator

dc42 commented Nov 17, 2024

Works OK for me in standalone mode:

echo boards[1].firmwareVersion
3.6.0-beta.2
echo boards[1].firmwareFileName
Duet3Firmware_EXP3HC.bin
echo boards[3].firmwareVersion
3.6.0-beta.1+1
echo boards[4].firmwareFileName
Duet3Firmware_SZP.bin

The "unsupported type code" message comes from file DataTransfer.cpp so it SBC-specific. The full list of expression type codes is defined in file ObjectMode/TypeCode.h. TypeCode::CanExpansionBoardDetails is code 24. I think the code in DataTransfer just needs to call ExpressionValue::ExtractRequestedPart to handle this case.

@chrishamm
Copy link
Collaborator

That's right, TypeCode::CanExpansionBoardDetails wasn't supported in DataTransfer.cpp. My fix looks a bit different but it works as well - the underlying code calls ExtractRequestedPart, too. Please merge it into 3.5-dev and 3.6-dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that has been reproduced Object Model Related to the Object Model
Projects
None yet
Development

No branches or pull requests

3 participants