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

Parameter type enhancements for strings #961

Open
razvanphp opened this issue Sep 23, 2024 · 1 comment
Open

Parameter type enhancements for strings #961

razvanphp opened this issue Sep 23, 2024 · 1 comment

Comments

@razvanphp
Copy link

I have a rather basic need to pass strings in between the cores via RPC, which actually represent a JSON.

I know those changes are probably meant in other repositories, but the use-case is in the context of RPC.

/Users/razvan/Library/Arduino15/packages/arduino/hardware/mbed_portenta/4.1.5/libraries/rpclib/src/rpc/msgpack/v1/object.hpp:213:7:
error: 'class arduino::String' has no member named 'msgpack_unpack'
     v.msgpack_unpack(o.convert());
     ~~^~~~~~~~~~~~~~

and

/Users/razvan/Library/Arduino15/packages/arduino/hardware/mbed_portenta/4.1.5/libraries/rpclib/src/rpc/msgpack/v1/object.hpp:213:7:
error: request for member 'msgpack_unpack' in 'v', which is of non-class type 'const char'
     v.msgpack_unpack(o.convert());
     ~~^~~~~~~~~~~~~~

It compiles with std::string tho.

@iabdalkader iabdalkader transferred this issue from arduino/arduino-lib-mpy Sep 25, 2024
@iabdalkader
Copy link
Contributor

iabdalkader commented Sep 25, 2024

This repo is for Arduino Python libraries, it has nothing to do with this issue, so I'm transferring here. If strings can't be packed/unpacked try using std::vector<byte>. You can also read/write to raw channel, see the pinpong example RPC.write(&buf[0], sizeof(buf)); where buf is uint8_t array.

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

No branches or pull requests

2 participants