Improved error messages in mailbox.c
authorFlorian Pose <fp@igh-essen.com>
Mon, 18 Dec 2006 17:53:29 +0000
changeset 504 63d11bdfe3df
parent 503 e84388b86c38
child 505 bc443ca0077f
Improved error messages in mailbox.c
master/mailbox.c
--- a/master/mailbox.c	Mon Dec 18 11:54:10 2006 +0000
+++ b/master/mailbox.c	Mon Dec 18 17:53:29 2006 +0000
@@ -89,6 +89,7 @@
 
 /**
    Prepares a datagram for checking the mailbox state.
+   \todo: Determine sync manager used for receive mailbox
    \return 0 in case of success, else < 0
 */
 
@@ -96,7 +97,6 @@
                                 ec_datagram_t *datagram /**< datagram */
                                 )
 {
-    // FIXME: second sync manager?
     if (ec_datagram_nprd(datagram, slave->station_address, 0x808, 8))
         return -1;
 
@@ -168,7 +168,8 @@
     data_size = EC_READ_U16(datagram->data);
 
     if (data_size > slave->sii_tx_mailbox_size - 6) {
-        EC_ERR("Corrupt mailbox response detected!\n");
+        EC_ERR("Corrupt mailbox response received from slave %i!\n",
+               slave->ring_position);
         ec_print_data(datagram->data, slave->sii_tx_mailbox_size);
         return NULL;
     }
@@ -180,7 +181,8 @@
         const ec_code_msg_t *mbox_msg;
 	uint16_t code = EC_READ_U16(datagram->data + 8);
 
-        EC_ERR("Mailbox error response received - ");
+        EC_ERR("Mailbox error response received from slave %i - ",
+               slave->ring_position);
 
 	for (mbox_msg = mbox_error_messages; mbox_msg->code; mbox_msg++) {
             if (mbox_msg->code != code) continue;