Function verify_mailbox_pdos

Source
pub fn verify_mailbox_pdos(
    slave_number: u32,
    data: &mut [u8],
    slave_mailbox_pdo_offsets: &mut Vec<Vec<Range<usize>>>,
    slave_mailbox_pdo_timestamps: &mut Vec<Instant>,
    slave_is_mailbox_pdo_responding: &mut Vec<bool>,
    slave_mailbox_pdo_data_buffer: &mut Vec<Vec<Vec<u8>>>,
    mailbox_wait_time_ms: u32,
) -> bool
Expand description

verify the mailboxe pdos of the slaves (if they are available) verify that the slaves are still writing checking if all the mailbox values are zero for more than 1s

  • if the values are not zero, update the timestamp
  • if the values are zero, check if the timestamp is more than 1s
    • if the timestamp is more than 1s, set the slave as not responding
  • if the values are not zero, update the timestamp

NOTE:

  • mailbox PDOs are different from the normal buffered PDOs as they are only updated once the slave writes to them and if the slave is not writing to them, the values will be read as zero
  • therefore this function is used to check if the slaves are still writing to the mailbox PDOs and if they are the mailbox pdo data is buffered and copied to the domain data