use of jmri.jmrix.nce.NceMessage in project JMRI by JMRI.
the class NceMacroBackup method readMacroMemory.
// Reads 16 bytes of NCE macro memory, and adjusts for second read
private NceMessage readMacroMemory(int macroNum, boolean second) {
// set flag for receive
secondRead = second;
int nceMacroAddr = (macroNum * MACRO_LNTH) + CS_MACRO_MEM;
if (second) {
// adjust for second memory read
nceMacroAddr += REPLY_16;
}
// Expect 16 byte response
replyLen = REPLY_16;
waiting++;
byte[] bl = NceBinaryCommand.accMemoryRead(nceMacroAddr);
NceMessage m = NceMessage.createBinaryMessage(tc, bl, REPLY_16);
return m;
}
use of jmri.jmrix.nce.NceMessage in project JMRI by JMRI.
the class NceMacroEditPanel method writeSerialMemoryN.
// Write N bytes of NCE memory
private void writeSerialMemoryN(int nceMacroAddr, byte[] x, int len) {
// Expect 1 byte response
replyLen = NceMessage.REPLY_1;
waiting++;
byte[] bl = NceBinaryCommand.accMemoryWriteN(nceMacroAddr, len);
for (int i = 0; i < len; i++) {
bl[3 + i] = x[i];
}
NceMessage m = NceMessage.createBinaryMessage(tc, bl, NceMessage.REPLY_1);
tc.sendNceMessage(m, this);
}
use of jmri.jmrix.nce.NceMessage in project JMRI by JMRI.
the class ClockMonPanel method issueReadTimeRequest.
@SuppressWarnings("unused")
private void issueReadTimeRequest() {
if (!waitingForCmdRead) {
byte[] cmd = jmri.jmrix.nce.NceBinaryCommand.accMemoryRead(CS_CLOCK_MEM_ADDR);
NceMessage cmdNce = jmri.jmrix.nce.NceMessage.createBinaryMessage(tc, cmd, CS_CLOCK_MEM_SIZE);
waiting++;
waitingForCmdRead = true;
tc.sendNceMessage(cmdNce, this);
}
updateTimeFromRead = true;
}
use of jmri.jmrix.nce.NceMessage in project JMRI by JMRI.
the class ClockMonPanel method issueClockStart.
private void issueClockStart() {
byte[] cmd = jmri.jmrix.nce.NceBinaryCommand.accStartClock();
NceMessage cmdNce = jmri.jmrix.nce.NceMessage.createBinaryMessage(tc, cmd, CMD_CLOCK_SET_REPLY_SIZE);
waiting++;
waitingForCmdStart = true;
tc.sendNceMessage(cmdNce, this);
}
use of jmri.jmrix.nce.NceMessage in project JMRI by JMRI.
the class ClockMonPanel method issueReadStatusRequest.
@SuppressWarnings("unused")
private void issueReadStatusRequest() {
if (!waitingForCmdRead) {
byte[] cmd = jmri.jmrix.nce.NceBinaryCommand.accMemoryRead(CS_CLOCK_MEM_ADDR);
NceMessage cmdNce = jmri.jmrix.nce.NceMessage.createBinaryMessage(tc, cmd, CS_CLOCK_MEM_SIZE);
waiting++;
waitingForCmdRead = true;
tc.sendNceMessage(cmdNce, this);
}
updateStatusFromRead = true;
}
Aggregations