equal
deleted
inserted
replaced
55 #endif |
55 #endif |
56 |
56 |
57 /*****************************************************************************/ |
57 /*****************************************************************************/ |
58 |
58 |
59 /** Constructor. |
59 /** Constructor. |
60 * |
60 * |
61 * \return 0 in case of success, else < 0 |
61 * \return 0 in case of success, else < 0 |
62 */ |
62 */ |
63 int ec_device_init( |
63 int ec_device_init( |
64 ec_device_t *device, /**< EtherCAT device */ |
64 ec_device_t *device, /**< EtherCAT device */ |
65 ec_master_t *master /**< master owning the device */ |
65 ec_master_t *master /**< master owning the device */ |
522 __func__, mac_str); |
522 __func__, mac_str); |
523 sprintf(dev_str, "UNKNOWN"); |
523 sprintf(dev_str, "UNKNOWN"); |
524 } |
524 } |
525 |
525 |
526 EC_MASTER_INFO(master, "Releasing %s device %s.\n", dev_str, mac_str); |
526 EC_MASTER_INFO(master, "Releasing %s device %s.\n", dev_str, mac_str); |
527 |
527 |
528 down(&master->device_sem); |
528 down(&master->device_sem); |
529 ec_device_detach(device); |
529 ec_device_detach(device); |
530 up(&master->device_sem); |
530 up(&master->device_sem); |
531 } |
531 } |
532 |
532 |
585 |
585 |
586 /** Accepts a received frame. |
586 /** Accepts a received frame. |
587 * |
587 * |
588 * Forwards the received data to the master. The master will analyze the frame |
588 * Forwards the received data to the master. The master will analyze the frame |
589 * and dispatch the received commands to the sending instances. |
589 * and dispatch the received commands to the sending instances. |
590 * |
590 * |
591 * \ingroup DeviceInterface |
591 * \ingroup DeviceInterface |
592 */ |
592 */ |
593 void ecdev_receive( |
593 void ecdev_receive( |
594 ec_device_t *device, /**< EtherCAT device */ |
594 ec_device_t *device, /**< EtherCAT device */ |
595 const void *data, /**< pointer to received data */ |
595 const void *data, /**< pointer to received data */ |
629 |
629 |
630 /** Sets a new link state. |
630 /** Sets a new link state. |
631 * |
631 * |
632 * If the device notifies the master about the link being down, the master |
632 * If the device notifies the master about the link being down, the master |
633 * will not try to send frames using this device. |
633 * will not try to send frames using this device. |
634 * |
634 * |
635 * \ingroup DeviceInterface |
635 * \ingroup DeviceInterface |
636 */ |
636 */ |
637 void ecdev_set_link( |
637 void ecdev_set_link( |
638 ec_device_t *device, /**< EtherCAT device */ |
638 ec_device_t *device, /**< EtherCAT device */ |
639 uint8_t state /**< new link state */ |
639 uint8_t state /**< new link state */ |