def init_device_api(self):
        """
        Initialize the protocols used by this
        instance based on the protocol capabilities
        array which is return from A000.
        """
        product_data = self.get_product_data()
        try:
            self.device_id = product_data.by_pid[L000.PID_PRODUCT_DATA][0].data
            self.protocol_array = product_data.by_pid[L000.PID_PROTOCOL_ARRAY][0].data.protocol_array
            _log.debug("init_device_api: product_id=%d, software_version=%0.2f, description=%s",
                    self.device_id.product_id, self.device_id.software_version/100., self.device_id.description)
            _log.debug("init_device_api: protocol_array=%s", self.protocol_array)
        except (__HOLE__, TypeError):
            raise DeviceNotSupportedError("Product data not returned by device.")
        self.data_types_by_protocol = data_types_by_protocol(self.protocol_array)
        # the tuples in this section define an ordered collection
        # of protocols which are candidates to provide each specific
        # function. Each proto will be device based on the first one
        # whihc exists in this devices capabiltities.
        # This section needs to be updated whenever a new protocol 
        # needs to be supported.
        self.link_proto = self._find_core_protocol("link", (L000, L001))
        self.cmd_proto = self._find_core_protocol("command", (A010,))
        self.trk_proto = self._find_app_protocol("get_trks", (A301, A302))
        self.lap_proto = self._find_app_protocol("get_laps", (A906,))
        self.run_proto = self._find_app_protocol("get_runs", (A1000,))
dataset/ETHPy150Open braiden/python-ant-downloader/antd/garmin.py/Device.init_device_api