Skip to content

Conversation

@gaillarddamien
Copy link
Contributor

Support for array types was requested in issue #317 and its implementation recently merged into develop (PR #340).
However, there were a few issues with it.
I will try and summarize what this PR addresses.

  • int and float array types:
    it fails to decode int and float arrays (other than Int8Array and Uint8Array): an array of the right size is returned, but it is filled with the first value from the original array.

    #input:
    {"value": [-1,-2,47897,-3.4,-4,-5,-6,47879,1,9,-7,7877444],"type":"Int16Array","name":"test"}
    #output:
    {"value":[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"type":"Int16Array","name":"test"}

    This is because the decoding function always returns the first byte (index 0) regardless of how it is invoked (i has no effect on these calls).

  • boolean array type:

    #input:
    {"value": [false,false,true,true,false,true,false,false,true,true,false,true,true,true,false],"type":"booleanArray","name":"Hello"}

    It fails here with the following error byte length of Uint32Array should be a multiple of 4.
    And I believe the bytes would then be built with bits reversed.

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.

1 participant