863 ec_datagram_t *datagram /**< datagram */ |
863 ec_datagram_t *datagram /**< datagram */ |
864 ) |
864 ) |
865 { |
865 { |
866 ec_datagram_t *queued_datagram; |
866 ec_datagram_t *queued_datagram; |
867 |
867 |
868 switch (datagram->state) { |
|
869 case EC_DATAGRAM_QUEUED: |
|
870 datagram->skip_count++; |
|
871 EC_MASTER_DBG(master, 1, "Skipping already queued datagram %p.\n", |
|
872 datagram); |
|
873 break; |
|
874 |
|
875 case EC_DATAGRAM_SENT: |
|
876 datagram->skip_count++; |
|
877 EC_MASTER_DBG(master, 1, "Skipping already sent datagram %p.\n", |
|
878 datagram); |
|
879 break; |
|
880 |
|
881 default: |
|
882 break; |
|
883 } |
|
884 |
|
885 /* It is possible, that a datagram in the queue is re-initialized with the |
868 /* It is possible, that a datagram in the queue is re-initialized with the |
886 * ec_datagram_<type>() methods and then shall be queued with this method. |
869 * ec_datagram_<type>() methods and then shall be queued with this method. |
887 * In that case, the state is already reset to EC_DATAGRAM_INIT. Check if |
870 * In that case, the state is already reset to EC_DATAGRAM_INIT. Check if |
888 * the datagram is queued to avoid duplicate queuing (which results in an |
871 * the datagram is queued to avoid duplicate queuing (which results in an |
889 * infinite loop!). Set the state to EC_DATAGRAM_QUEUED again, probably |
872 * infinite loop!). Set the state to EC_DATAGRAM_QUEUED again, probably |