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 network_interface 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 <string>
9
#include <
network_interface.h
>
10
11
std::string
AS::Network::return_status_desc
(
const
return_statuses
&ret)
12
{
13
std::string status_string;
14
15
if
(ret ==
INIT_FAILED
)
16
{
17
status_string =
"Initialization of the network interface failed."
;
18
}
19
else
if
(ret ==
BAD_PARAM
)
20
{
21
status_string =
"A bad parameter was provided to the network interface during initalization."
;
22
}
23
else
if
(ret ==
SOCKET_ERROR
)
24
{
25
status_string =
"A socket error was encountered."
;
26
}
27
else
if
(ret ==
SOCKET_CLOSED
)
28
{
29
status_string =
"Socket is not currently open."
;
30
}
31
else
if
(ret ==
NO_MESSAGES_RECEIVED
)
32
{
33
status_string =
"No messages were received on the interface."
;
34
}
35
else
if
(ret ==
READ_FAILED
)
36
{
37
status_string =
"A read operation failed on the network interface."
;
38
}
39
else
if
(ret ==
WRITE_FAILED
)
40
{
41
status_string =
"A write operation failed on the network interface."
;
42
}
43
else
if
(ret ==
CLOSE_FAILED
)
44
{
45
status_string =
"Closing the network failed."
;
46
}
47
48
return
status_string;
49
}
AS::Network::INIT_FAILED
Definition:
network_interface.h:31
AS::Network::NO_MESSAGES_RECEIVED
Definition:
network_interface.h:35
AS::Network::return_status_desc
std::string return_status_desc(const return_statuses &ret)
Definition:
utils.cpp:11
AS::Network::READ_FAILED
Definition:
network_interface.h:36
AS::Network::return_statuses
return_statuses
Definition:
network_interface.h:28
AS::Network::SOCKET_ERROR
Definition:
network_interface.h:33
AS::Network::WRITE_FAILED
Definition:
network_interface.h:37
AS::Network::CLOSE_FAILED
Definition:
network_interface.h:38
AS::Network::SOCKET_CLOSED
Definition:
network_interface.h:34
AS::Network::BAD_PARAM
Definition:
network_interface.h:32
network_interface.h
network_interface
Author(s): Joshua Whitley
, Daniel Stanek
, Joe Kale
autogenerated on Thu Jun 6 2019 19:57:06