示例#1
0
    def handleDeviceListAnnounceRequest(self, pdu: DeviceListAnnounceRequest):
        """
        Log mapped devices.
        :param pdu: the device list announce request.
        """

        for device in pdu.deviceList:
            self.log.info(
                "%(deviceName)s mapped with ID %(deviceID)d: %(deviceData)s", {
                    "deviceName": DeviceType.getPrettyName(device.deviceType),
                    "deviceID": device.deviceID,
                    "deviceData":
                    device.preferredDosName.rstrip(b"\x00").decode()
                })
    def handleDeviceListAnnounceRequest(self, pdu: DeviceListAnnounceRequest):
        """
        Log mapped devices.
        :param pdu: the device list announce request.
        """

        for device in pdu.deviceList:
            self.log.info("%(deviceType)s mapped with ID %(deviceID)d: %(deviceName)s", {
                "deviceType": DeviceType.getPrettyName(device.deviceType),
                "deviceID": device.deviceID,
                "deviceName": device.preferredDOSName
            })

            self.observer.onDeviceAnnounce(device)