Search in sources :

Example 61 with CanMessage

use of jmri.jmrix.can.CanMessage in project JMRI by JMRI.

the class CbusMessage method getBootReset.

/**
     * Microchip AN247 format message to reset and enter normal mode
     */
public static CanMessage getBootReset(int header) {
    CanMessage m = new CanMessage(8, header);
    m.setExtended(true);
    m.setHeader(0x4);
    m.setElement(0, 0);
    m.setElement(1, 0);
    m.setElement(2, 0);
    m.setElement(3, 0);
    m.setElement(4, 0x0D);
    m.setElement(5, 1);
    m.setElement(6, 0);
    m.setElement(7, 0);
    setPri(m, 0xb);
    return m;
}
Also used : CanMessage(jmri.jmrix.can.CanMessage)

Example 62 with CanMessage

use of jmri.jmrix.can.CanMessage in project JMRI by JMRI.

the class OlcbConfigurationManager method configureManagers.

@Override
public void configureManagers() {
    // create our NodeID
    getOurNodeID();
    // do the connections
    tc = adapterMemo.getTrafficController();
    olcbCanInterface = createOlcbCanInterface(nodeID, tc);
    // create JMRI objects
    InstanceManager.setSensorManager(getSensorManager());
    InstanceManager.setTurnoutManager(getTurnoutManager());
    InstanceManager.setThrottleManager(getThrottleManager());
    InstanceManager.setProgrammerManager(getProgrammerManager());
    // start alias acquisition
    new StartUpHandler().start();
    OlcbInterface iface = getInterface();
    loaderClient = new LoaderClient(iface.getOutputConnection(), iface.getMemoryConfigurationService(), iface.getDatagramService());
    iface.registerMessageListener(loaderClient);
    iface.registerMessageListener(new SimpleNodeIdentInfoHandler());
    aliasMap = new AliasMap();
    tc.addCanListener(new CanListener() {

        @Override
        public void message(CanMessage m) {
            if (!m.isExtended() || m.isRtr()) {
                return;
            }
            aliasMap.processFrame(convertFromCan(m));
        }

        @Override
        public void reply(CanReply m) {
            if (!m.isExtended() || m.isRtr()) {
                return;
            }
            aliasMap.processFrame(convertFromCan(m));
        }
    });
    messageBuilder = new MessageBuilder(aliasMap);
}
Also used : LoaderClient(org.openlcb.LoaderClient) MessageBuilder(org.openlcb.can.MessageBuilder) CanListener(jmri.jmrix.can.CanListener) CanReply(jmri.jmrix.can.CanReply) AliasMap(org.openlcb.can.AliasMap) OlcbInterface(org.openlcb.OlcbInterface) CanMessage(jmri.jmrix.can.CanMessage)

Example 63 with CanMessage

use of jmri.jmrix.can.CanMessage in project JMRI by JMRI.

the class OlcbAddress method makeMessage.

public CanMessage makeMessage() {
    CanMessage c = new CanMessage(aFrame, 0x195B4000);
    c.setExtended(true);
    return c;
}
Also used : CanMessage(jmri.jmrix.can.CanMessage)

Aggregations

CanMessage (jmri.jmrix.can.CanMessage)63 Test (org.junit.Test)4 CanReply (jmri.jmrix.can.CanReply)3 CanListener (jmri.jmrix.can.CanListener)2 CbusAddress (jmri.jmrix.can.cbus.CbusAddress)2 DccLocoAddress (jmri.DccLocoAddress)1 AbstractMRMessage (jmri.jmrix.AbstractMRMessage)1 CanSystemConnectionMemo (jmri.jmrix.can.CanSystemConnectionMemo)1 TestTrafficController (jmri.jmrix.can.TestTrafficController)1 TrafficControllerScaffold (jmri.jmrix.can.TrafficControllerScaffold)1 GridConnectMessage (jmri.jmrix.can.adapters.gridconnect.GridConnectMessage)1 GridConnectReply (jmri.jmrix.can.adapters.gridconnect.GridConnectReply)1 LoaderClient (org.openlcb.LoaderClient)1 OlcbInterface (org.openlcb.OlcbInterface)1 AliasMap (org.openlcb.can.AliasMap)1 CanInterface (org.openlcb.can.CanInterface)1 MessageBuilder (org.openlcb.can.MessageBuilder)1 Hub (org.openlcb.hub.Hub)1