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 
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 }
std::string return_status_desc(const return_statuses &ret)
Definition: utils.cpp:11


network_interface
Author(s): Joshua Whitley , Daniel Stanek , Joe Kale
autogenerated on Thu Jun 6 2019 19:57:06