-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathutils.cpp
More file actions
49 lines (45 loc) · 1.32 KB
/
utils.cpp
File metadata and controls
49 lines (45 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Unpublished Copyright (c) 2009-2017 AutonomouStuff, LLC, All Rights Reserved.
*
* This file is part of the network_interface ROS 1.0 driver which is released under the MIT license.
* See file LICENSE included with this software or go to https://opensource.org/licenses/MIT for full license details.
*/
#include <string>
#include <network_interface.h>
std::string AS::Network::return_status_desc(const return_statuses &ret)
{
std::string status_string;
if (ret == INIT_FAILED)
{
status_string = "Initialization of the network interface failed.";
}
else if (ret == BAD_PARAM)
{
status_string = "A bad parameter was provided to the network interface during initalization.";
}
else if (ret == SOCKET_ERROR)
{
status_string = "A socket error was encountered.";
}
else if (ret == SOCKET_CLOSED)
{
status_string = "Socket is not currently open.";
}
else if (ret == NO_MESSAGES_RECEIVED)
{
status_string = "No messages were received on the interface.";
}
else if (ret == READ_FAILED)
{
status_string = "A read operation failed on the network interface.";
}
else if (ret == WRITE_FAILED)
{
status_string = "A write operation failed on the network interface.";
}
else if (ret == CLOSE_FAILED)
{
status_string = "Closing the network failed.";
}
return status_string;
}