Apollo
10.0
自动驾驶开放平台
bcan_defs.h
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2017 The Apollo Authors. All Rights Reserved.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*****************************************************************************/
16
17
#pragma once
18
19
#ifndef __KERNEL__
20
#include <sys/time.h>
21
#else
22
#include <linux/time.h>
23
#endif
24
25
/*
26
* Baidu CAN message definition
27
*/
28
typedef
struct
bcan_msg
{
29
unsigned
int
bcan_msg_id
;
/* source CAN node id */
30
unsigned
char
bcan_msg_datalen
;
/* message data len */
31
unsigned
char
bcan_msg_rsv
[3];
32
unsigned
char
bcan_msg_data
[8];
/* message data */
33
struct
timeval
bcan_msg_timestamp
;
34
}
bcan_msg_t
;
35
36
/*
37
* CAN error code
38
*/
39
enum
bcan_err_code
{
40
BCAN_PARAM_INVALID
= -12,
41
BCAN_HDL_INVALID
,
42
BCAN_DEV_INVALID
,
43
BCAN_DEV_ERR
,
44
BCAN_DEV_BUSY
,
45
BCAN_TIMEOUT
,
46
BCAN_FAIL
,
47
BCAN_NOT_SUPPORTED
,
48
BCAN_NOT_IMPLEMENTED
,
49
BCAN_INVALID
,
50
BCAN_NO_BUFFERS
,
51
BCAN_ERR
,
52
BCAN_OK
,
/* 0 */
53
BCAN_PARTIAL_OK
54
};
bcan_msg_t
struct bcan_msg bcan_msg_t
bcan_err_code
bcan_err_code
Definition
bcan_defs.h:39
BCAN_HDL_INVALID
@ BCAN_HDL_INVALID
Definition
bcan_defs.h:41
BCAN_NOT_SUPPORTED
@ BCAN_NOT_SUPPORTED
Definition
bcan_defs.h:47
BCAN_PARAM_INVALID
@ BCAN_PARAM_INVALID
Definition
bcan_defs.h:40
BCAN_NO_BUFFERS
@ BCAN_NO_BUFFERS
Definition
bcan_defs.h:50
BCAN_DEV_ERR
@ BCAN_DEV_ERR
Definition
bcan_defs.h:43
BCAN_DEV_INVALID
@ BCAN_DEV_INVALID
Definition
bcan_defs.h:42
BCAN_INVALID
@ BCAN_INVALID
Definition
bcan_defs.h:49
BCAN_PARTIAL_OK
@ BCAN_PARTIAL_OK
Definition
bcan_defs.h:53
BCAN_OK
@ BCAN_OK
Definition
bcan_defs.h:52
BCAN_TIMEOUT
@ BCAN_TIMEOUT
Definition
bcan_defs.h:45
BCAN_FAIL
@ BCAN_FAIL
Definition
bcan_defs.h:46
BCAN_DEV_BUSY
@ BCAN_DEV_BUSY
Definition
bcan_defs.h:44
BCAN_ERR
@ BCAN_ERR
Definition
bcan_defs.h:51
BCAN_NOT_IMPLEMENTED
@ BCAN_NOT_IMPLEMENTED
Definition
bcan_defs.h:48
bcan_msg
Definition
bcan_defs.h:28
bcan_msg::bcan_msg_rsv
unsigned char bcan_msg_rsv[3]
Definition
bcan_defs.h:31
bcan_msg::bcan_msg_id
unsigned int bcan_msg_id
Definition
bcan_defs.h:29
bcan_msg::bcan_msg_timestamp
struct timeval bcan_msg_timestamp
Definition
bcan_defs.h:33
bcan_msg::bcan_msg_data
unsigned char bcan_msg_data[8]
Definition
bcan_defs.h:32
bcan_msg::bcan_msg_datalen
unsigned char bcan_msg_datalen
Definition
bcan_defs.h:30
modules
drivers
canbus
can_client
hermes_can
bcan_defs.h