def list_blocks_of_type(self, blocktype, size):
        """This function returns the AG list of a specified block type."""

        blocktype = snap7.snap7types.block_types.get(blocktype)

        if not blocktype:
            raise Snap7Exception("The blocktype parameter was invalid")

        logging.debug("listing blocks of type: %s size: %s" %
                      (blocktype, size))

        data = (c_int * 10)()
        count = c_int(size)
        result = self.library.Cli_ListBlocksOfType(
            self.pointer, blocktype,
            byref(data),
            byref(count))

        logging.debug("number of items found: %s" % count)

        check_error(result, context="client")
        return data
dataset/ETHPy150Open gijzelaerr/python-snap7/snap7/client.py/Client.list_blocks_of_type/original