pass char array to plugin

Typically: "How do I... ", "How can I... " questions
Post Reply
dds
Posts: 85
Joined: 20 Mar 2014, 14:35

pass char array to plugin

Post by dds »

Hi ! I want to pass a character array to plugin function. I’m trying something like this:

Code: Select all

if ((p->inputArgTypeAndSize[0*2+0]==(sim_lua_arg_int))&&(p->inputArgTypeAndSize[1*2+0]==(sim_lua_arg_string))){
 ... do stuff.. 
}
But this only works for string, when I pass a character array like an image it doesn't work , it recognized as a string but I can not get the whole data (just until first terminator in array). "sim_lua_arg_char" dont exist so: how can I pass a char array to a plugin?
Last edited by dds on 30 May 2014, 13:32, edited 1 time in total.

dds
Posts: 85
Joined: 20 Mar 2014, 14:35

Re: pass char array to plugin

Post by dds »

Hi ,

Code: Select all

sim_lua_arg_string|sim_lua_arg_table 
does not work neither it returns "sim_lua_arg_invalid" when an image is passed.

coppelia
Site Admin
Posts: 10378
Joined: 14 Dec 2012, 00:25

Re: pass char array to plugin

Post by coppelia »

Hello,

this is currently not possible, but in next release you will be able to do it (with argument sim_lua_arg_charbuff) and 2 new members in the callback structure:
  • simChar* inputCharBuff;
  • simChar* outputCharBuff;
Cheers

dds
Posts: 85
Joined: 20 Mar 2014, 14:35

Re: pass char array to plugin

Post by dds »

Hello thank you very much! I answered your email. I hope you will be able to incorporate these changes for the next version.
Thank you again.
Greetings!

https://drive.google.com/file/d/0B2jklw ... sp=sharing

Post Reply