22def irig(obj, device):
23 '''
24 IRIG commands.
25
26 \b
27 DEVICE: uhal device identifier
28 IDS: id(s) of the target endpoint(s).
29 '''
30
31 lDevice = obj.mConnectionManager.getDevice(str(device))
32 if obj.mTimeout:
33 lDevice.setTimeoutPeriod(obj.mTimeout)
34
35
36 echo('Created IRIG device')
37 lTopDesign = lDevice.getNode('')
38 lBoardInfo = toolbox.readSubNodes(lDevice.getNode('io.config'), False)
39 lDevice.dispatch()
40
41 if lBoardInfo['board_type'].value() in kLibrarySupportedBoards and lBoardInfo['design_type'].value() in kLibrarySupportedDesigns:
42 lTopDesign.validate_firmware_version()
43 try:
44 echo(lDevice.getNode('io').get_hardware_info())
45 except:
46 secho("Failed to retrieve hardware information! I2C issue? Initial board reset needed?", fg='yellow')
47 e = sys.exc_info()[0]
48 secho("Error: {}".format(e), fg='red')
49
50 obj.mDevice = lDevice
51 obj.mTopDesign = lDevice.getNode('')
52 obj.mIRIG = lDevice.getNode('irig_time_source')
53
54
55
56
57@irig.command('status')
58@click.pass_obj
59@click.pass_context