26 def __init__(self):
27
28 lMstCtx = ShellContext()
29
30
31 lMaster = self.device.getNode('master')
32 lExtTrigNode = self.device.getNode('trig_rx')
33 lIO = self.device.getNode('io')
34
35 lVersion = lMaster.getNode('global.version').read()
36 lGenerics = toolbox.readSubNodes(lMaster.getNode('global.config'), False)
37 self.device.dispatch()
38
39 lMajor = (lVersion >> 16) & 0xff
40 lMinor = (lVersion >> 8) & 0xff
41 lPatch = (lVersion >> 0) & 0xff
42
43 lMstCtx.version = (lVersion.value(), lMajor, lMinor, lPatch)
44 lMstCtx.generics = {k:v.value() for k,v in lGenerics.items()}
45
46 if lMajor < self.kFWMajorRequired:
47 secho('ERROR: Incompatible master firmware version. Found {}, required {}'.format(hex(lMajor), hex(kMasterFWMajorRequired)), fg='red')
48 raise click.Abort()
49
50
51 lMstCtx.masterNode = lMaster
52 lMstCtx.globalNode = lMaster.getNode('global')
53 lMstCtx.aCmdNode = lMaster.getNode('acmd')
54 lMstCtx.echoNode = lMaster.getNode('echo')
55 lMstCtx.extTrigNode = lExtTrigNode
56
57 self.masterCtx = lMstCtx
58 self.ioNode = lIO