#=========================================================================== # # NetworkInfo Message # #=========================================================================== from .Base import Base #========================================================================== class NetworkInfo ( Base ): """Network info message After construction, will have the following attributes: DeviceMacId int CoordMacId int Status str LinkStrength int Optional: Description str ExtPanId int Channel int ShortAddr int Sample: 0xd8d5b9000000103f 0x000781000086d0fe Connected Successfully Joined 0x000781000086d0fe 20 0xe1aa 0x64 """ # Hex keys turn into floats or ints. Taken care of automatically # in Base.__init__(). _numHexKeys = [] _intHexKeys = [ "DeviceMacId", "CoordMacId", "ExtPanId", "ShortAddr", "StatusCode", "LinkStrength" ] _jsonKeys = [ "DeviceMacid", "Status", "LinkStrength", "Description", "Channel" ] #------------------------------------------------------------------------ def __init__( self, node ): """node == xml ETree node """ assert( node.tag == "NetworkInfo" ) Base.__init__( self, "NetworkInfo", node ) # Convert channel string to integer. if hasattr( self, "Channel" ): self.Channel = int( self.Channel ) #------------------------------------------------------------------------ #==========================================================================