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 Kvaser 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 <kvaser_interface.h>
00009 
00010 std::string AS::CAN::return_status_desc(const return_statuses& ret)
00011 {
00012   std::string status_string;
00013 
00014   if (ret == INIT_FAILED)
00015   {
00016     status_string = "Initialization of the CAN interface failed.";
00017   }
00018   else if (ret == BAD_PARAM)
00019   {
00020     status_string = "A bad parameter was provided to the CAN interface during initalization.";
00021   }
00022   else if (ret == NO_CHANNELS_FOUND)
00023   {
00024     status_string = "No available CAN channels were found.";
00025   }
00026   else if (ret == CHANNEL_CLOSED)
00027   {
00028     status_string = "CAN channel is not currently open.";
00029   }
00030   else if (ret == NO_MESSAGES_RECEIVED)
00031   {
00032     status_string = "No messages were received on the interface.";
00033   }
00034   else if (ret == READ_FAILED)
00035   {
00036     status_string = "A read operation failed on the CAN interface.";
00037   }
00038   else if (ret == WRITE_FAILED)
00039   {
00040     status_string = "A write operation failed on the CAN interface.";
00041   }
00042   else if (ret == CLOSE_FAILED)
00043   {
00044     status_string = "Closing the CAN interface failed.";
00045   }
00046 
00047   return status_string;
00048 }


kvaser_interface
Author(s): Joshua Whitley , Daniel Stanek
autogenerated on Fri Jun 21 2019 19:31:13