Examples of CanInterface


Examples of de.entropia.can.CanSocket.CanInterface

   
    @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}));
      System.out.println(s.recv());
  }
View Full Code Here

Examples of de.entropia.can.CanSocket.CanInterface

    }
   
    @Test
    public void testInterface() throws IOException {
        try (final CanSocket socket = new CanSocket(Mode.RAW)) {
            new CanInterface(socket, CAN_INTERFACE);
        }
    }
View Full Code Here

Examples of de.entropia.can.CanSocket.CanInterface

    }
   
    @Test
    public void testBindInterface() throws IOException {
        try (final CanSocket socket = new CanSocket(Mode.RAW)) {
            final CanInterface canIf = new CanInterface(socket, CAN_INTERFACE);
            socket.bind(canIf);
        }
    }
View Full Code Here

Examples of de.entropia.can.CanSocket.CanInterface

    }
   
    @Test
    public void testBind2Interface() throws IOException {
        try (final CanSocket socket = new CanSocket(Mode.RAW)) {
            final CanInterface canIf = new CanInterface(socket, CAN_INTERFACE);
            socket.bind(CanSocket.CAN_ALL_INTERFACES);
            socket.bind(canIf);
        }
    }
View Full Code Here

Examples of de.entropia.can.CanSocket.CanInterface

    }
   
    @Test
    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

Examples of de.entropia.can.CanSocket.CanInterface

    }
   
    @Test
    public void testMtu() throws IOException {
  try (final CanSocket socket = new CanSocket(Mode.RAW)) {
      final CanInterface canInterface =
        new CanInterface(socket, CAN_INTERFACE);
      socket.bind(canInterface);
      final int mtu = socket.getMtu(CAN_INTERFACE);
      if (!(mtu == CanSocket.CAN_MTU) && !(mtu == CanSocket.CAN_FD_MTU)) {
    throw new IOException("illegal interface mtu: " + mtu);
      }
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.