Device Driver Block BUS output from C++ map
1 次查看(过去 30 天)
显示 更早的评论
Hi.
We developed a device driver following the guidelines at https://nl.mathworks.com/help/supportpkg/raspberrypi/device-driver-blocks.html
We developed the C function to be called which, after querying the device, returns a map<string, double> (basically a bus with signal names and values).
The function has been tested (on a standalone program built on the RPI) and it works correctly.
What it's not clear is how to invoke correctly the function that we wrote so that matlab can correctly interpret the returned data.
In other words: if my function returns a map can it be called through coder.ceval? Do I need to use easier types?
Any help appreciated.
Thanks in advance.
0 个评论
回答(1 个)
Supraja
2023-7-26
When using “coder.ceval” in MATLAB, the function being called should have a C-compatible signature and return type. If your function returns a MATLAB “containers.Map” object, which is not a C-compatible type, you cannot directly call it using “coder.ceval”.
You can refer to the below documentation link of “container.Map” for further reference.
https://www.mathworks.com/help/matlab/ref/containers.map.html?s_tid=doc_ta
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Support Package for Raspberry Pi Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!