11
11
12
12
from pymate .value import Value
13
13
from pymate .cstruct import Struct
14
- from pymate . matenet import Mate
14
+ from . import MateDevice , MateNET
15
15
16
16
class DCStatusPacket (object ):
17
17
fmt = Struct ('>28B' )
@@ -71,16 +71,16 @@ def scan(self):
71
71
devid = super (MateFlexNetDC , self ).scan ()
72
72
if devid == None :
73
73
raise RuntimeError ("No response from the FLEXnet DC unit" )
74
- if devid != MateDevice .DEVICE_FLEXNETDC :
74
+ if devid != MateNET .DEVICE_FLEXNETDC :
75
75
raise RuntimeError ("Attached device is not a FLEXnet DC unit! (DeviceID: %s)" % devid )
76
76
77
77
def get_status (self ):
78
78
"""
79
79
Request a status packet from the FLEXnet DC
80
80
:return: A DCStatusPacket
81
81
"""
82
- resp1 = self .send (MateDevice .TYPE_STATUS , addr = 1 )
83
- resp2 = self .send (MateDevice .TYPE_STATUS , addr = 2 ) # TODO: This also returns data!
82
+ resp1 = self .send (MateNET .TYPE_STATUS , addr = 1 )
83
+ resp2 = self .send (MateNET .TYPE_STATUS , addr = 2 ) # TODO: This also returns data!
84
84
if resp1 and resp2 :
85
85
print 'RAW[1]:' , (' ' .join ("{:02x}" .format (ord (c )) for c in resp1 [1 :]))
86
86
print 'RAW[2]:' , (' ' .join ("{:02x}" .format (ord (c )) for c in resp2 [1 :]))
@@ -94,7 +94,7 @@ def get_logpage(self, day):
94
94
"""
95
95
# TODO: This doesn't return anything. It must have a different command.
96
96
# The UserGuide does mention having access to log pages
97
- #resp = self.send(MateDevice .TYPE_LOG, addr=0, param=-day)
97
+ #resp = self.send(MateNET .TYPE_LOG, addr=0, param=-day)
98
98
#if resp:
99
99
# print 'RAW:', (' '.join("{:02x}".format(ord(c)) for c in resp[1:]))
100
100
# #return DCLogPagePacket.from_buffer(resp)
0 commit comments