Quote:
Originally Posted by derekwhite
I don't see a killer bug, but there is one thing to clean up.
1) Each call to Pointer.createStringBuffer() essentially "mallocs" a new C string buffer, so you typically need to free it after calling the C function (unless the C code stashes the value somewhere to use later). To fix this, create a local Pointer variable, say "ptr", and call ptr.free() after the call out to C.
Also, I'm not sure what died, and what the symptoms are. Something on the cRIO or the driver station?
And I couldn't find the C code for ZomBDashboardGetString(), etc. Is it in the svn somewhere?
Good luck!
|
I'm not sure about what died either (Netbeans won't connect and send me print statements), but I do know that this code (in teleop code):
Code:
zombinstance.Send("taco", joystick.GetY());
works, and any controls hooked up to taco work, but this code
Code:
zombinstance.Send("taco", joystick.GetY());
zombinstance.Send("value", zombinstance.GetString("invalue"));
does not, and all controls are dead, which leads me to assume that it kills Java somehow (but the DS still says Enabled and code) (and If I only execute the GetString function if a button is pressed, it dies when the button is pressed)
The h file should be in C:\Program files\ZomB\Bindings\ (or Start>Programs>ZomB>Bindings) and the cpp file is compiled into ZomB.out, but you can see it in svn (\releasefiles\bindings\source), but I've attached both