use of com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.ProgramSectionCommand in project java-bowler by NeuronRobotics.
the class NRBootLoader method write.
public boolean write(int core, ByteData flashData) {
BowlerDatagram b = null;
for (int i = 0; i < 10; i++) {
try {
b = send(new ProgramSectionCommand(core, (int) flashData.getStartAddress(), new ByteList(flashData.getData())));
} catch (Exception e) {
e.printStackTrace();
b = null;
}
if (b != null) {
if (!b.getRPC().contains("_err"))
return true;
}
}
System.err.println("\nFailed to send 10 times!\n");
return false;
}
Aggregations