fp@359: /****************************************************************************** fp@359: * fp@359: * $Id$ fp@359: * fp@359: * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH fp@359: * fp@359: * This file is part of the IgH EtherCAT Master. fp@359: * fp@359: * The IgH EtherCAT Master is free software; you can redistribute it fp@359: * and/or modify it under the terms of the GNU General Public License fp@359: * as published by the Free Software Foundation; either version 2 of the fp@359: * License, or (at your option) any later version. fp@359: * fp@359: * The IgH EtherCAT Master is distributed in the hope that it will be fp@359: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of fp@359: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fp@359: * GNU General Public License for more details. fp@359: * fp@359: * You should have received a copy of the GNU General Public License fp@359: * along with the IgH EtherCAT Master; if not, write to the Free Software fp@359: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@359: * fp@359: * The right to use EtherCAT Technology is granted and comes free of fp@359: * charge under condition of compatibility of product made by fp@359: * Licensee. People intending to distribute/sell products based on the fp@359: * code, have to sign an agreement to guarantee that products using fp@359: * software based on IgH EtherCAT master stay compatible with the actual fp@359: * EtherCAT specification (which are released themselves as an open fp@359: * standard) as the (only) precondition to have the right to use EtherCAT fp@359: * Technology, IP and trade marks. fp@359: * fp@359: *****************************************************************************/ fp@359: fp@359: /** fp@359: \file fp@359: Slave Type. fp@359: */ fp@359: fp@359: /*****************************************************************************/ fp@359: fp@359: #include "slave_device.hpp" fp@359: fp@359: /*****************************************************************************/ fp@359: fp@359: SlaveDevice::SlaveDevice() fp@359: { fp@359: } fp@359: fp@359: /*****************************************************************************/ fp@359: fp@359: SlaveDevice::~SlaveDevice() fp@359: { fp@359: } fp@359: fp@359: /*****************************************************************************/ fp@359: fp@359: void SlaveDevice::fromXml(xmlDocPtr doc, xmlNodePtr cur) fp@359: { fp@359: xmlChar *str; fp@359: fp@359: cout << "device" << endl; fp@359: cur = cur->xmlChildrenNode; fp@359: fp@359: while (cur) { fp@359: if ((!xmlStrcmp(cur->name, (const xmlChar *) "Type"))) { fp@359: str = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); fp@359: cout << "Type: " << str << endl; fp@359: xmlFree(str); fp@359: str = xmlGetProp(cur, (const xmlChar *) "ProductRevision"); fp@359: cout << "ProductRevision: " << str << endl; fp@359: xmlFree(str); fp@359: } fp@359: else if ((!xmlStrcmp(cur->name, (const xmlChar *) "Name"))) { fp@359: str = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); fp@359: cout << "Name: " << str << endl; fp@359: xmlFree(str); fp@359: } fp@359: else if ((!xmlStrcmp(cur->name, (const xmlChar *) "TxPdo"))) { fp@359: pdos.push_back(Pdo()); fp@359: pdos.back().fromXml(doc, cur); fp@359: } fp@359: else if ((!xmlStrcmp(cur->name, (const xmlChar *) "Sm"))) { fp@359: str = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); fp@359: cout << "Sm: " << str << endl; fp@359: xmlFree(str); fp@359: } fp@359: cur = cur->next; fp@359: } fp@359: } fp@359: fp@359: /*****************************************************************************/