fp@1335: /***************************************************************************** fp@1335: * fp@1363: * $Id$ fp@1363: * fp@1363: * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH fp@1363: * fp@1363: * This file is part of the IgH EtherCAT Master. fp@1363: * fp@1363: * The IgH EtherCAT Master is free software; you can redistribute it and/or fp@1363: * modify it under the terms of the GNU General Public License version 2, as fp@1363: * published by the Free Software Foundation. fp@1363: * fp@1363: * The IgH EtherCAT Master is distributed in the hope that it will be useful, fp@1363: * but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1363: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General fp@1363: * Public License for more details. fp@1363: * fp@1363: * You should have received a copy of the GNU General Public License along fp@1363: * with the IgH EtherCAT Master; if not, write to the Free Software fp@1363: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@1363: * fp@1363: * --- fp@1363: * fp@1363: * The license mentioned above concerns the source code only. Using the fp@1363: * EtherCAT technology and brand is only permitted in compliance with the fp@1363: * industrial property and similar rights of Beckhoff Automation GmbH. fp@1335: * fp@1335: ****************************************************************************/ fp@1335: fp@1335: #include "FoeCommand.h" fp@1335: #include "foe.h" fp@1335: fp@1335: /*****************************************************************************/ fp@1335: fp@1335: FoeCommand::FoeCommand(const string &name, const string &briefDesc): fp@1335: Command(name, briefDesc) fp@1335: { fp@1335: } fp@1335: fp@1335: /****************************************************************************/ fp@1335: fp@1336: std::string FoeCommand::resultText(int result) fp@1335: { fp@1804: switch (result) { fp@1804: case FOE_BUSY: fp@1804: return "FOE_BUSY"; fp@1804: case FOE_READY: fp@1804: return "FOE_READY"; fp@1804: case FOE_IDLE: fp@1804: return "FOE_IDLE"; fp@1804: case FOE_WC_ERROR: fp@1804: return "FOE_WC_ERROR"; fp@1804: case FOE_RECEIVE_ERROR: fp@1804: return "FOE_RECEIVE_ERROR"; fp@1804: case FOE_PROT_ERROR: fp@1804: return "FOE_PROT_ERROR"; fp@1804: case FOE_NODATA_ERROR: fp@1804: return "FOE_NODATA_ERROR"; fp@1804: case FOE_PACKETNO_ERROR: fp@1804: return "FOE_PACKETNO_ERROR"; fp@1804: case FOE_OPCODE_ERROR: fp@1804: return "FOE_OPCODE_ERROR"; fp@1804: case FOE_TIMEOUT_ERROR: fp@1804: return "FOE_TIMEOUT_ERROR"; fp@1804: case FOE_SEND_RX_DATA_ERROR: fp@1804: return "FOE_SEND_RX_DATA_ERROR"; fp@1804: case FOE_RX_DATA_ACK_ERROR: fp@1804: return "FOE_RX_DATA_ACK_ERROR"; fp@1804: case FOE_ACK_ERROR: fp@1804: return "FOE_ACK_ERROR"; fp@1804: case FOE_MBOX_FETCH_ERROR: fp@1804: return "FOE_MBOX_FETCH_ERROR"; fp@1804: case FOE_READ_NODATA_ERROR: fp@1804: return "FOE_READ_NODATA_ERROR"; fp@1804: case FOE_MBOX_PROT_ERROR: fp@1804: return "FOE_MBOX_PROT_ERROR"; fp@1804: default: fp@1804: return "???"; fp@1804: } fp@1335: } fp@1335: fp@1335: /****************************************************************************/ fp@1336: fp@1336: std::string FoeCommand::errorText(int errorCode) fp@1336: { fp@1804: switch (errorCode) { fp@1336: case 0x00008001: fp@1336: return "Not found."; fp@1336: case 0x00008002: fp@1336: return "Access denied."; fp@1336: case 0x00008003: fp@1336: return "Disk full."; fp@1336: case 0x00008004: fp@1336: return "Illegal."; fp@1336: case 0x00008005: fp@1336: return "Packet number wrong."; fp@1336: case 0x00008006: fp@1336: return "Already exists."; fp@1336: case 0x00008007: fp@1336: return "No user."; fp@1336: case 0x00008008: fp@1336: return "Bootstrap only."; fp@1336: case 0x00008009: fp@1336: return "Not Bootstrap."; fp@1336: case 0x0000800a: fp@1336: return "No rights."; fp@1336: case 0x0000800b: fp@1336: return "Program Error."; fp@1804: default: fp@1804: return "Unknown error code"; fp@1804: } fp@1336: } fp@1336: fp@1336: /****************************************************************************/