# Path: pyads/commands/adscommand.py
# class AdsCommand:
# 
#     def __init__(self):
#         pass
# 
# 
#     CommandID = 0
# 
# 
#     def CreateRequest(self):
#         raise NotImplementedError()
# 
# 
#     def CreateResponse(self, responsePacket):
#         raise NotImplementedError()
# 
# 
#     def GetAmsPacket(self, adsConnection):
#         packet = AmsPacket(adsConnection)
#         packet.CommandID = self.CommandID
#         packet.StateFlags = 0x0004
#         packet.Data = self.CreateRequest()
# 
#         return packet
# 
# 
#     def Execute(self, adsClient):
# 
#         # create packet
#         packet = self.GetAmsPacket(adsClient.AdsConnection)
# 
#         # send to client
#         responsePacket = adsClient.SendAndRecv(packet)
# 
#         # check for error
#         if (responsePacket.ErrorCode > 0):
#             raise AdsException(responsePacket.ErrorCode)
# 
#         # return response object
#         result = self.CreateResponse(responsePacket)
#         if (result.Error > 0):
#             raise AdsException(result.Error)
# 
#         return result
# 
# Path: pyads/commands/deviceinforesponse.py
# class DeviceInfoResponse(AdsResponse):
# 
#     def __init__(self, responseAmsPacket):
#         AdsResponse.__init__(self, responseAmsPacket)
# 
#         self.MajorVersion = struct.unpack_from('B', responseAmsPacket.Data, 4)[0]
#         self.MinorVersion = struct.unpack_from('B', responseAmsPacket.Data, 5)[0]
#         self.Build = struct.unpack_from('H', responseAmsPacket.Data, 6)[0]
# 
#         deviceNameEnd = 16
#         for i in range(8, 24):
#             if ord(responseAmsPacket.Data[i]) == 0:
#                 deviceNameEnd = i
#                 break
# 
#         deviceNameRaw = responseAmsPacket.Data[8:deviceNameEnd]
#         self.DeviceName = deviceNameRaw.decode("latin-1").strip(' \t\n\r')
# 
# 
#     MajorVersion = 0
# 
#     MinorVersion = 0
# 
#     Build = 0
# 
#     DeviceName = 'Ads Device'
# 
# 
#     def __str__(self):
#         return "%s (Version %s)" % (self.DeviceName, self.Version())
# 
# 
#     def Version(self):
#         return "%s.%s.%s" % (self.MajorVersion, self.MinorVersion, self.Build)


from .adscommand import AdsCommand
from .deviceinforesponse import DeviceInfoResponse

class DeviceInfoCommand(AdsCommand):

    def __init__(self):
        self.CommandID = 0x0001


    def CreateRequest(self):
        return b''



# Path: pyads/commands/adscommand.py
# class AdsCommand:
# 
#     def __init__(self):
#         pass
# 
# 
#     CommandID = 0
# 
# 
#     def CreateRequest(self):
#         raise NotImplementedError()
# 
# 
#     def CreateResponse(self, responsePacket):
#         raise NotImplementedError()
# 
# 
#     def GetAmsPacket(self, adsConnection):
#         packet = AmsPacket(adsConnection)
#         packet.CommandID = self.CommandID
#         packet.StateFlags = 0x0004
#         packet.Data = self.CreateRequest()
# 
#         return packet
# 
# 
#     def Execute(self, adsClient):
# 
#         # create packet
#         packet = self.GetAmsPacket(adsClient.AdsConnection)
# 
#         # send to client
#         responsePacket = adsClient.SendAndRecv(packet)
# 
#         # check for error
#         if (responsePacket.ErrorCode > 0):
#             raise AdsException(responsePacket.ErrorCode)
# 
#         # return response object
#         result = self.CreateResponse(responsePacket)
#         if (result.Error > 0):
#             raise AdsException(result.Error)
# 
#         return result
# 
# Path: pyads/commands/deviceinforesponse.py
# class DeviceInfoResponse(AdsResponse):
# 
#     def __init__(self, responseAmsPacket):
#         AdsResponse.__init__(self, responseAmsPacket)
# 
#         self.MajorVersion = struct.unpack_from('B', responseAmsPacket.Data, 4)[0]
#         self.MinorVersion = struct.unpack_from('B', responseAmsPacket.Data, 5)[0]
#         self.Build = struct.unpack_from('H', responseAmsPacket.Data, 6)[0]
# 
#         deviceNameEnd = 16
#         for i in range(8, 24):
#             if ord(responseAmsPacket.Data[i]) == 0:
#                 deviceNameEnd = i
#                 break
# 
#         deviceNameRaw = responseAmsPacket.Data[8:deviceNameEnd]
#         self.DeviceName = deviceNameRaw.decode("latin-1").strip(' \t\n\r')
# 
# 
#     MajorVersion = 0
# 
#     MinorVersion = 0
# 
#     Build = 0
# 
#     DeviceName = 'Ads Device'
# 
# 
#     def __str__(self):
#         return "%s (Version %s)" % (self.DeviceName, self.Version())
# 
# 
#     def Version(self):
#         return "%s.%s.%s" % (self.MajorVersion, self.MinorVersion, self.Build)


# Path: pyads/commands/deviceinfocommand.py
from .adscommand import AdsCommand
from .deviceinforesponse import DeviceInfoResponse


class DeviceInfoCommand(AdsCommand):

    def __init__(self):
        self.CommandID = 0x0001


    def CreateRequest(self):
        return b''



    def CreateResponse(self, responsePacket):