utils.cpp
Go to the documentation of this file.
00001 /*
00002 * Unpublished Copyright (c) 2009-2017 AutonomouStuff, LLC, All Rights Reserved.
00003 *
00004 * This file is part of the network_interface ROS 1.0 driver which is released under the MIT license.
00005 * See file LICENSE included with this software or go to https://opensource.org/licenses/MIT for full license details.
00006 */
00007 
00008 #include <string>
00009 #include <network_interface.h>
00010 
00011 std::string AS::Network::return_status_desc(const return_statuses &ret)
00012 {
00013   std::string status_string;
00014 
00015   if (ret == INIT_FAILED)
00016   {
00017     status_string = "Initialization of the network interface failed.";
00018   }
00019   else if (ret == BAD_PARAM)
00020   {
00021     status_string = "A bad parameter was provided to the network interface during initalization.";
00022   }
00023   else if (ret == SOCKET_ERROR)
00024   {
00025     status_string = "A socket error was encountered.";
00026   }
00027   else if (ret == SOCKET_CLOSED)
00028   {
00029     status_string = "Socket is not currently open.";
00030   }
00031   else if (ret == NO_MESSAGES_RECEIVED)
00032   {
00033     status_string = "No messages were received on the interface.";
00034   }
00035   else if (ret == READ_FAILED)
00036   {
00037     status_string = "A read operation failed on the network interface.";
00038   }
00039   else if (ret == WRITE_FAILED)
00040   {
00041     status_string = "A write operation failed on the network interface.";
00042   }
00043   else if (ret == CLOSE_FAILED)
00044   {
00045     status_string = "Closing the network failed.";
00046   }
00047 
00048   return status_string;
00049 }


network_interface
Author(s): Joshua Whitley , Daniel Stanek , Joe Kale
autogenerated on Thu Jun 6 2019 21:43:30