I have two NXT bricks connected and they work together using Bluetooth, sending messages between the two works. The master NXT will start a program on the slave NXT with the RemoteStartProgram function. However, when I try to use RemoteStopProgram the compilation fails with 'Unknown function' in BricxCC and with this error when compiled with nbc:
File "/home/paul/bricks/carjulie_bt.nxc" ; line 124
# __connectionWrite (1, __DCStopProgramPacket, __D0main)
#----------------------------------------------------------
1 errors during compilation
This is the relevant portion of the code, what am I missing ?
task main() {
if (BTConnectToNXT("Sarah", SLAVE_CONN)) {
RemoteStartProgram(SLAVE_CONN, "carsarah_bt.rxe");
bool result = RemoteConnectionIdle(SLAVE_CONN);
if (result) {
Precedes(ListenToSarah,LookAtColours);
}
RemoteStopProgram(SLAVE_CONN); // This line does not compile ?!
}
}
Edit 2020-05-16: There is a simple workaround for this error, just send a message to all slaves to execute stopalltasks() function.
This bug is now also on Debian bugs: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=960772
EDIT 2020-05-18: SOLVED! This link https://sourceforge.net/p/bricxcc/code/HEAD/tree/x64/ contains a working nbc version for Linux! Thanks!!
RemoteStopProgram(SLAVE_CONN); // This line does not compile ?!
line is the one referenced in the error message ("/home/paul/bricks/carjulie_bt.nxc" ; line 124
)?result = RemoteStopProgram(SLAVE_CONN)