Main Page
Namespaces
Classes
Files
File List
File Members
src
utils.cpp
Go to the documentation of this file.
1
/*
2
* Unpublished Copyright (c) 2009-2017 AutonomouStuff, LLC, All Rights Reserved.
3
*
4
* This file is part of the Kvaser ROS 1.0 driver which is released under the MIT license.
5
* See file LICENSE included with this software or go to https://opensource.org/licenses/MIT for full license details.
6
*/
7
8
#include <
kvaser_interface.h
>
9
10
std::string
AS::CAN::return_status_desc
(
const
return_statuses
& ret)
11
{
12
std::string status_string;
13
14
if
(ret ==
INIT_FAILED
)
15
{
16
status_string =
"Initialization of the CAN interface failed."
;
17
}
18
else
if
(ret ==
BAD_PARAM
)
19
{
20
status_string =
"A bad parameter was provided to the CAN interface during initalization."
;
21
}
22
else
if
(ret ==
NO_CHANNELS_FOUND
)
23
{
24
status_string =
"No available CAN channels were found."
;
25
}
26
else
if
(ret ==
CHANNEL_CLOSED
)
27
{
28
status_string =
"CAN channel is not currently open."
;
29
}
30
else
if
(ret ==
NO_MESSAGES_RECEIVED
)
31
{
32
status_string =
"No messages were received on the interface."
;
33
}
34
else
if
(ret ==
READ_FAILED
)
35
{
36
status_string =
"A read operation failed on the CAN interface."
;
37
}
38
else
if
(ret ==
WRITE_FAILED
)
39
{
40
status_string =
"A write operation failed on the CAN interface."
;
41
}
42
else
if
(ret ==
CLOSE_FAILED
)
43
{
44
status_string =
"Closing the CAN interface failed."
;
45
}
46
47
return
status_string;
48
}
AS::CAN::BAD_PARAM
Definition:
kvaser_interface.h:28
kvaser_interface.h
AS::CAN::NO_MESSAGES_RECEIVED
Definition:
kvaser_interface.h:31
AS::CAN::CLOSE_FAILED
Definition:
kvaser_interface.h:34
AS::CAN::return_statuses
return_statuses
Definition:
kvaser_interface.h:24
AS::CAN::NO_CHANNELS_FOUND
Definition:
kvaser_interface.h:29
AS::CAN::INIT_FAILED
Definition:
kvaser_interface.h:27
AS::CAN::CHANNEL_CLOSED
Definition:
kvaser_interface.h:30
AS::CAN::WRITE_FAILED
Definition:
kvaser_interface.h:33
AS::CAN::READ_FAILED
Definition:
kvaser_interface.h:32
AS::CAN::return_status_desc
std::string return_status_desc(const return_statuses &ret)
Definition:
utils.cpp:10
kvaser_interface
Author(s): Joshua Whitley
, Daniel Stanek
autogenerated on Wed Jun 19 2019 19:36:17