def indicate_acked_tx(self, cell, pending_bit): self.track_has_packet_pending_tx[ cell.trackId] = pending_bit and not self._is_last_tx_cell(cell) logPrint('Acked TX on mote', self.mote.id, ', pending packet = ', self.track_has_packet_pending_tx[cell.trackId]) for cell in self._get_next_tx_cells(cell): cell.set_send(pending_bit)
def indicate_active_rx_cell(self, cell, pending_bit): # read the pending packet bit from packet pending_packet = pending_bit self.track_has_packet_pending_rx[cell.trackId] = pending_packet and self._is_last_rx_cell(cell) != True for _followingCell in self._get_next_rx_cells(cell): _followingCell.set_listen(pending_packet) logPrint('Received packet on mote ', self.mote.id, ' cell ', (self._get_index_of_cell(cell) + 1) ,'/', self._get_size_of_rx_bundle(cell.trackId), ' # pending_bit=',pending_packet)
def indicate_active_rx_cell(self, cell, pending_bit): pending_packet = pending_bit self.track_has_packet_pending_rx[cell.trackId] = pending_packet and not self._is_last_rx_cell(cell) logPrint('Received packet on mote ', self.mote.id, ' cell ', (self._get_index_of_cell(cell) + 1) ,'/', self._get_size_of_rx_bundle(cell.trackId), '# pending_bit=',pending_packet) next_cells = self._get_next_rx_cells(cell) for _cell in next_cells: _cell.set_listen(pending_packet)
def register_track_cell(self, cell): assert cell.trackId != None trackId = cell.trackId if cell.is_rx_on(): if trackId not in self.track_rx_bundles: self.track_rx_bundles[trackId] = [] self.track_has_packet_pending_rx[trackId] = False self.track_rx_bundles[trackId].append(cell) elif cell.is_tx_on(): if trackId not in self.track_tx_bundles: self.track_tx_bundles[trackId] = [] self.track_has_packet_pending_tx[trackId] = False self.track_tx_bundles[trackId].append(cell) logPrint('Registered cell -> [slotOffset:', cell.slot_offset , "trackId: ", cell.trackId, '] on mote ', self.mote.id)
def indicate_non_acked_tx(self, cell): logPrint('!!!!Non acked TX on mote', self.mote.id, ', pending packet = ', self.track_has_packet_pending_tx[cell.trackId]) for cell in self._get_next_tx_cells(cell): cell.set_send(self.track_has_packet_pending_tx[cell.trackId])
def indicate_non_acked_tx(self, cell): logPrint('_____Non acked TX on mote', self.mote.id, ', packet pending = ', self.track_has_packet_pending_tx[cell.trackId])