Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.wpi.first.wpilibj.can
Class JaguarCANDriver

    java.lang.Object
      edu.wpi.first.wpilibj.can.JaguarCANDriver

    public class JaguarCANDriver

extends Object

Field Summary
`static int` | `kMaxMessageDataSize`
`int` | `receivedMessageId`

Constructor Summary
`JaguarCANDriver()`

Method Summary
`byte` | `receiveMessage(int messageID, byte[] data)` Call receiveMessage with a default timeout parameter of 100ms
`byte` | `receiveMessage(int messageID, byte[] data, double timeout)` Wait for a message to be received from the CAN bus.
`byte` | `receiveMessageComplete(int messageID, byte[] data)` Get the result of waiting for a message to be received from the CAN bus.
`boolean` | `receiveMessageStart(int messageID, Semaphore sem, double timeout)` Start waiting for a message to be received from the CAN bus.
`static void` | `sendMessage(int messageID, byte[] data, int dataSize)` Send a message on the CAN bus

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### kMaxMessageDataSize

    public static final int kMaxMessageDataSize

See Also:
  Constant Field Values

### receivedMessageId

    public int receivedMessageId

Constructor Detail

### JaguarCANDriver

    public JaguarCANDriver()

Method Detail

### sendMessage

    public static void sendMessage(int messageID,
                                   byte[] data,
                                   int dataSize)
                            throws CANTimeoutException

  Send a message on the CAN bus

  Parameters:
    `messageID` - CAN MessageID to send on the CAN
    `data` - Data payload to send with the message
  Throws:
    `CANTimeoutException`

### receiveMessage

    public byte receiveMessage(int messageID,
                               byte[] data,
                               double timeout)
                        throws CANTimeoutException

  Wait for a message to be received from the CAN bus.

  Parameters:
    `messageID` - MessageID filter to specify what message ID to be expected.
    `data` - Buffer for received data
    `timeout` - Number of seconds to wait for the expected message
  Returns:
    Actual size of the valid bytes in data
  Throws:
    `CANTimeoutException`

### receiveMessage

    public byte receiveMessage(int messageID,
                               byte[] data)
                        throws CANTimeoutException

  Call receiveMessage with a default timeout parameter of 100ms

  Parameters:
    `messageID` - MessageID filter to specify what message ID to be expected.
    `data` - Buffer for received data
  Returns:
    Actual size of the valid bytes in data
  Throws:
    `CANTimeoutException`

### receiveMessageStart

    public boolean receiveMessageStart(int messageID,
                                       Semaphore sem,
                                       double timeout)
                                throws CANTimeoutException

  Start waiting for a message to be received from the CAN bus.

  Parameters:
    `messageID` - MessageID filter to specify what message ID to be expected.
    `sem` - Semaphore that indicates that the receive call has completed.
    `timeout` - Number of seconds to wait for the expected message.
  Returns:
    Data available now... call complete
  Throws:
    `CANTimeoutException`

### receiveMessageComplete

    public byte receiveMessageComplete(int messageID,
                                       byte[] data)
                                throws CANTimeoutException

  Get the result of waiting for a message to be received from the CAN bus.

  Parameters:
    `messageID` - MessageID filter to specify what message ID to be expected.
    `data` - Buffer for received data
  Returns:
    Actual size of the valid bytes in data
  Throws:
    `CANTimeoutException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

"
For updated information see the Java FRC site
"