master/slave.c
changeset 928 7fbc0b943c65
parent 926 6bb33c6ec770
child 960 36e460ffbb5e
equal deleted inserted replaced
927:ffb7d1876ce0 928:7fbc0b943c65
  1198 }
  1198 }
  1199 
  1199 
  1200 /*****************************************************************************/
  1200 /*****************************************************************************/
  1201 
  1201 
  1202 /**
  1202 /**
  1203    \return 0 in case of success, else < 0
       
  1204 */
       
  1205 
       
  1206 int ec_slave_validate(const ec_slave_t *slave, /**< EtherCAT slave */
       
  1207                       uint32_t vendor_id, /**< vendor ID */
       
  1208                       uint32_t product_code /**< product code */
       
  1209                       )
       
  1210 {
       
  1211     if (vendor_id != slave->sii.vendor_id ||
       
  1212         product_code != slave->sii.product_code) {
       
  1213         EC_ERR("Invalid slave type at position %u:\n", slave->ring_position);
       
  1214         EC_ERR("  Requested: 0x%08X 0x%08X\n", vendor_id, product_code);
       
  1215         EC_ERR("      Found: 0x%08X 0x%08X\n",
       
  1216                 slave->sii.vendor_id, slave->sii.product_code);
       
  1217         return -1;
       
  1218     }
       
  1219     return 0;
       
  1220 }
       
  1221 
       
  1222 /*****************************************************************************/
       
  1223 
       
  1224 /**
       
  1225    Counts the total number of Sdos and entries in the dictionary.
  1203    Counts the total number of Sdos and entries in the dictionary.
  1226 */
  1204 */
  1227 
  1205 
  1228 void ec_slave_sdo_dict_info(const ec_slave_t *slave, /**< EtherCAT slave */
  1206 void ec_slave_sdo_dict_info(const ec_slave_t *slave, /**< EtherCAT slave */
  1229                             unsigned int *sdo_count, /**< number of Sdos */
  1207                             unsigned int *sdo_count, /**< number of Sdos */