fp@2269: /****************************************************************************** fp@2269: * fp@2269: * $Id$ fp@2269: * fp@2269: * Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH fp@2269: * fp@2269: * This file is part of the IgH EtherCAT Master. fp@2269: * fp@2269: * The IgH EtherCAT Master is free software; you can redistribute it and/or fp@2269: * modify it under the terms of the GNU General Public License version 2, as fp@2269: * published by the Free Software Foundation. fp@2269: * fp@2269: * The IgH EtherCAT Master is distributed in the hope that it will be useful, fp@2269: * but WITHOUT ANY WARRANTY; without even the implied warranty of fp@2269: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General fp@2269: * Public License for more details. fp@2269: * fp@2269: * You should have received a copy of the GNU General Public License along fp@2269: * with the IgH EtherCAT Master; if not, write to the Free Software fp@2269: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@2269: * fp@2269: * --- fp@2269: * fp@2269: * The license mentioned above concerns the source code only. Using the fp@2269: * EtherCAT technology and brand is only permitted in compliance with the fp@2269: * industrial property and similar rights of Beckhoff Automation GmbH. fp@2269: * fp@2269: *****************************************************************************/ fp@2269: fp@2269: /** fp@2269: \file fp@2269: EtherCAT datagram pair methods. fp@2269: */ fp@2269: fp@2269: /*****************************************************************************/ fp@2269: fp@2269: #include "datagram_pair.h" fp@2269: fp@2269: /*****************************************************************************/ fp@2269: fp@2269: /** Datagram pair constructor. fp@2269: */ fp@2269: void ec_datagram_pair_init( fp@2269: ec_datagram_pair_t *pair /**< Datagram pair. */ fp@2269: ) fp@2269: { fp@2269: unsigned int i; fp@2269: fp@2269: INIT_LIST_HEAD(&pair->list); fp@2269: fp@2269: for (i = 0; i < EC_NUM_DEVICES; i++) { fp@2269: ec_datagram_init(&pair->datagrams[i]); fp@2269: } fp@2269: } fp@2269: fp@2269: /*****************************************************************************/ fp@2269: fp@2269: /** Datagram pair destructor. fp@2269: */ fp@2269: void ec_datagram_pair_clear( fp@2269: ec_datagram_pair_t *pair /**< Datagram pair. */ fp@2269: ) fp@2269: { fp@2269: unsigned int i; fp@2269: fp@2269: for (i = 0; i < EC_NUM_DEVICES; i++) { fp@2269: ec_datagram_clear(&pair->datagrams[i]); fp@2269: } fp@2269: } fp@2269: fp@2269: /*****************************************************************************/