Package 

Class RawCan


  • 
    public class RawCan
    
                        

    Manager class for raw can.

    Usage: Create instance RawCan, initialise init or init

    Note! The connection towards the underlying service is asynchronous. This means that data is not ready immediately after init. This can affect the readiness of see sendMessage. To know if underlying service is ready use isServiceReady

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static int CAN4
      public final static int SENSOR_NW_CAN
      public final static int CAN3
    • Constructor Summary

      Constructors 
      Constructor Description
      RawCan(Context appC)
    • Method Summary

      Modifier and Type Method Description
      boolean isServiceReady() Can be used to poll if service is ready.
      void init(int canChannel, Array<int> filterId) Initialise object with can channel and array of filters.
      void init(int canChannel, Array<int> canFilterId, Handler handler) Initialise object with can channel and array of filters.
      boolean sendMessage(CanFrame frame) Send a CAN-frame
      void registerCanMessageListener(CanMessageListener canMessageListener) Register listener to start listening on CAN-messages based on the filter providedin the init methods.
      void deInit() Deregister the raw can interface.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • isServiceReady

         boolean isServiceReady()

        Can be used to poll if service is ready.

      • init

         void init(int canChannel, Array<int> filterId)

        Initialise object with can channel and array of filters.

        Parameters:
        canChannel - see SENSOR_NW_CAN and CAN4
        filterId - array of can filters
      • init

         void init(int canChannel, Array<int> canFilterId, Handler handler)

        Initialise object with can channel and array of filters.

        Parameters:
        canChannel - see SENSOR_NW_CAN and CAN4
        canFilterId - array of can filters
        handler - handler to post callbacks on
      • registerCanMessageListener

         void registerCanMessageListener(CanMessageListener canMessageListener)

        Register listener to start listening on CAN-messages based on the filter providedin the init methods.

        Parameters:
        canMessageListener - the listener object.
      • deInit

         void deInit()

        Deregister the raw can interface.