def update(self, heap):
        """Update the item descriptors and items from an incoming heap.

        Parameters
        ----------
        heap : :class:`spead2.recv.Heap`
            Incoming heap

        Returns
        -------
        dict
            Items that have been updated from this heap, indexed by name
        """
        for descriptor in heap.get_descriptors():
            item = Item.from_raw(descriptor, flavour=heap.flavour)
            self._add_item(item)
        updated_items = {}
        for raw_item in heap.get_items():
            if raw_item.id <= STREAM_CTRL_ID:
                continue     # Special fields, not real items
            try:
                item = self._by_id[raw_item.id]
            except KeyError:
                _logger.warning('Item with ID %#x received but there is no descriptor', raw_item.id)
            else:
                item.set_from_raw(raw_item)
                item.version += 1
                updated_items[item.name] = item
        return updated_items
def update ( self , heap ) : for descriptor in heap . get_descriptors ( ) : item = Item . from_raw ( descriptor , flavour = heap . flavour ) self . _add_item ( item ) updated_items = { } for raw_item in heap . get_items ( ) : if raw_item . id <= STREAM_CTRL_ID : continue try : item = self . _by_id [ raw_item . id ] except KeyError : _logger . warning ( 'Item with ID %#x received but there is no descriptor' , raw_item . id ) else : item . set_from_raw ( raw_item ) item . version += 1 updated_items [ item . name ] = item return updated_items
Update the item descriptors and items from an incoming heap.

        Parameters
        ----------
        heap : :class:`spead2.recv.Heap`
            Incoming heap

        Returns
        -------
        dict
            Items that have been updated from this heap, indexed by name