Examples of CanId


Examples of de.entropia.can.CanSocket.CanId

//  miscTests();
    }
   
    @SuppressWarnings("unused")
    private static void miscTests() throws IOException {
  final CanId id = new CanId(0x30001).setEFFSFF();
  try (final CanSocket s = new CanSocket(Mode.RAW)) {
      final CanInterface canif = new CanInterface(s, "slcan0");
      s.bind(canif);
      s.send(new CanFrame(canif, id, new byte[] {0,
    (byte) 0x91}));
View Full Code Here

Examples of de.entropia.can.CanSocket.CanId

        new CanSocket(Mode.BCM).close();
    }
   
    @Test
    public void testFlags() {
        final CanId id_0 = new CanId(0);
        final CanId id_f = new CanId(0xffffffff);
        assert !id_0.isSetEFFSFF();
        assert !id_0.isSetRTR();
        assert !id_0.isSetERR();
       
        assert id_f.isSetEFFSFF();
        assert id_f.isSetRTR();
        assert id_f.isSetERR();
       
        id_0.setEFFSFF();
        assert id_0.isSetEFFSFF();
        id_0.clearEFFSFF();
        assert !id_0.isSetEFFSFF();
View Full Code Here

Examples of de.entropia.can.CanSocket.CanId

    public void testSend() throws IOException {
        try (final CanSocket socket = new CanSocket(Mode.RAW)) {
            final CanInterface canif = new CanInterface(socket, CAN_INTERFACE);
            socket.bind(canif);
            socket.send(new CanFrame(canif,
                    new CanId(0x5), new byte[] {0,0,0,0,0,0,0,0}));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.