-
Notifications
You must be signed in to change notification settings - Fork 9
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
Decoding returns wrong value. #45
Comments
|
@agent6262 Can you possibly provide me the DBC file you are using so I can look into this? Also, could you let me know which version of the library you are using? There was a bug in the decoding function at one point, but that (should of) been fixed at this point. When I call the extractValFromPayload function directly, with the signal parameter you have above, I get an answer of 1: // Input parameters, in order: payload, start bit, signal length, endian, signed
let val = can.extractValFromPayload([3, 65, 13, 55, 255, 255, 255, 255],8,4,'Motorola',false)
console.log(val) returns val = 1
Do you have a code snippet that I could potentially run that would reproduce the error? I have a feeling there might be something going on upstream of the |
I apologize for the poor wite-up on my part was (3am my time 😅). when I run the test on my dbc file I am on version My DBC file (line 44)
My test test('DBC_SigMulVal.dbc: Decode Multiplex signal', (done) => {
const dbc = new Dbc();
const fileContent = dbcReader('src/__tests__/testFiles/DBC_SigMulVal.dbc');
const data = dbc.load(fileContent);
const can = new Can();
can.database = data;
const frame = can.createFrame(2024, [3, 65, 13, 55, 255, 255, 255, 255]);
const bndMsg = can.decode(frame);
}); |
@tylerbucher did the fix work, so this issue could be closed? |
The changes to fix the issue I was seeing was rolled back and not included in the PR. At this time I will close this issue, but I am unsure if this issue was actually resolved or not. |
Describe the bug
When decoding a dbc signal like
SG_ Service M : 11|4@0+ (1,0) [0|15] "" Vector__XXX
and data like thispayload: [3, 65, 13, 55, 255, 255, 255, 255]
the expected output should be1
not8
.Additional context
@bit-dream BitUtils#extractBitRange when in big endian mode this function seems to move the start and end bit ranges. Not really sure whats up with that.
The text was updated successfully, but these errors were encountered: