peak.can

## Class CANReadThread

- java.lang.Object
- - java.lang.Thread
  - - peak.can.CANReadThread

- All Implemented Interfaces:
    java.lang.Runnable, IRcvEventProcessor

      public class CANReadThread
      extends java.lang.Thread
      implements IRcvEventProcessor

  The CANReadThread class extends Thread class and is used to process readed CAN Messages. In addition, the class provides different read mode that are "By Timer" or "By Event". It is possible to read CAN Messages with its Time Stamp.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.lang.Thread

      `java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

  - ### Field Summary

    - ### Fields inherited from class java.lang.Thread

      `MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CANReadThread(PCANBasic pcanbasic, java.util.Vector<ChannelItem> connectedChannelCollection, java.util.HashMap dataRowCollection)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `callAPIFunctionRead(TPCANHandle handle)` Calls the PCANBasic Read Function according the readTimeStamp parameter
    `void` | `callAPIFunctionReadFd(TPCANHandle handle)` Calls the PCANBasic Read Function according the readTimeStamp parameter
    `java.lang.Boolean` | `getReadTimeStamp()`
    `void` | `processRcvEvent(TPCANHandle channel)` This method is called by the RcvEventDispatcher to process the CAN Receive-Event by the current implementor
    `void` | `run()` Starts thread process
    `void` | `setReadTimeStamp(java.lang.Boolean useReadEx)`

    - ### Methods inherited from class java.lang.Thread

      `activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### CANReadThread

          public CANReadThread(PCANBasic pcanbasic,
                               java.util.Vector<ChannelItem> connectedChannelCollection,
                               java.util.HashMap dataRowCollection)

      Parameters:
        `pcanbasic` - PCANBasic instance used to call read functions
        `connectedChannelCollection` - Reference to the collection which stores all connected channels
        `dataRowCollection` - Reference to the Collection which store readed CAN Messages

  - ### Method Detail

    - #### getReadTimeStamp

          public java.lang.Boolean getReadTimeStamp()

      Returns:
        states if timestamp is used when reading CAN messages

    - #### setReadTimeStamp

          public void setReadTimeStamp(java.lang.Boolean useReadEx)

      Parameters:
        `useReadEx` - states if timestamp must be used when reading CAN messages

    - #### run

          public void run()

      Starts thread process
      Specified by:
        `run` in interface `java.lang.Runnable`
      Overrides:
        `run` in class `java.lang.Thread`

    - #### callAPIFunctionRead

          public void callAPIFunctionRead(TPCANHandle handle)

      Calls the PCANBasic Read Function according the readTimeStamp parameter
      Parameters:
        `handle` - The handle of a PCAN Channel

    - #### callAPIFunctionReadFd

          public void callAPIFunctionReadFd(TPCANHandle handle)

      Calls the PCANBasic Read Function according the readTimeStamp parameter
      Parameters:
        `handle` - The handle of a PCAN Channel

    - #### processRcvEvent

          public void processRcvEvent(TPCANHandle channel)

      Description copied from interface: `IRcvEventProcessor`
      This method is called by the RcvEventDispatcher to process the CAN Receive-Event by the current implementor
      Specified by:
        `processRcvEvent` in interface `IRcvEventProcessor`