libpandac  0.0.0
A library designed for a comm.ai Panda.
candata.h
1 /*
2  Author: Matt Bunting
3  Copyright (c) 2020 Arizona Board of Regents
4  All rights reserved.
5 
6  Permission is hereby granted, without written agreement and without
7  license or royalty fees, to use, copy, modify, and distribute this
8  software and its documentation for any purpose, provided that the
9  above copyright notice and the following two paragraphs appear in
10  all copies of this software.
11 
12  IN NO EVENT SHALL THE ARIZONA BOARD OF REGENTS BE LIABLE TO ANY PARTY
13  FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14  ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15  IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
16  SUCH DAMAGE.
17 
18  THE ARIZONA BOARD OF REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
19  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20  AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER
21  IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION
22  TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23 
24  */
25 
26 #ifndef PANDA_CAN_DATA_H
27 #define PANDA_CAN_DATA_H
28 
29 #define CAN_DATA_MAX_LENGTH (8)
30 
31 namespace Panda {
32 
38  typedef struct _CanFrame {
41  unsigned int messageID = 0;
44  unsigned char dataLength = 0;
47  unsigned int busTime = 0;
50  unsigned char bus = 0;
53  unsigned char data[CAN_DATA_MAX_LENGTH];
56  struct timeval sysTime;
57  } CanFrame;
58 
59 }
60 
61 #endif
Handles USB communication and parsing with a comma.ai Panda.
Definition: can.h:38
struct timeval sysTime
The system time upon rec.
Definition: candata.h:56
unsigned int messageID
CAN message ID.
Definition: candata.h:41
Definition: candata.h:38
unsigned char data[CAN_DATA_MAX_LENGTH]
The data for the CAN message.
Definition: candata.h:53
unsigned int busTime
CAN message bus time.
Definition: candata.h:47
unsigned char bus
CAN message bus ID.
Definition: candata.h:50
unsigned char dataLength
Length of the data, should not exceed CAN_MAX_LENGTH (8)
Definition: candata.h:44