Ejemplo n.º 1
0
 def update(self,notif):
     StateElem.update(self)
     if len(self.data)==0:
         self.data.append({})
     self.data[0]['used']                     = notif.used
     self.data[0]['parentPreference']         = notif.parentPreference
     self.data[0]['stableNeighbor']           = notif.stableNeighbor
     self.data[0]['switchStabilityCounter']   = notif.switchStabilityCounter
     self.data[0]['joinPrio']                 = notif.joinPrio
     if 'addr' not in self.data[0]:
         self.data[0]['addr']                 = typeAddr.typeAddr()
     self.data[0]['addr'].update(notif.addr_type,
                                 notif.addr_bodyH,
                                 notif.addr_bodyL)
     self.data[0]['DAGrank']                  = notif.DAGrank
     if 'rssi' not in self.data[0]:
         self.data[0]['rssi']                 = typeRssi.typeRssi()
     self.data[0]['rssi'].update(notif.rssi)
     self.data[0]['numRx']                    = notif.numRx
     self.data[0]['numTx']                    = notif.numTx
     self.data[0]['numTxACK']                 = notif.numTxACK
     self.data[0]['numWraps']                 = notif.numWraps
     if 'asn' not in self.data[0]:
         self.data[0]['asn']                  = typeAsn.typeAsn()
     self.data[0]['asn'].update(notif.asn_0_1,
                                notif.asn_2_3,
                                notif.asn_4)
Ejemplo n.º 2
0
 def update(self, notif):
     StateElem.update(self)
     if len(self.data) == 0:
         self.data.append({})
     self.data[0]['used'] = notif.used
     self.data[0]['insecure'] = notif.insecure
     self.data[0]['parentPreference'] = notif.parentPreference
     self.data[0]['stableNeighbor'] = notif.stableNeighbor
     self.data[0]['switchStabilityCounter'] = notif.switchStabilityCounter
     self.data[0]['joinPrio'] = notif.joinPrio
     if 'addr' not in self.data[0]:
         self.data[0]['addr'] = typeAddr.typeAddr()
     self.data[0]['addr'].update(notif.addr_type, notif.addr_bodyH,
                                 notif.addr_bodyL)
     self.data[0]['DAGrank'] = notif.DAGrank
     if 'rssi' not in self.data[0]:
         self.data[0]['rssi'] = typeRssi.typeRssi()
     self.data[0]['rssi'].update(notif.rssi)
     self.data[0]['numRx'] = notif.numRx
     self.data[0]['numTx'] = notif.numTx
     self.data[0]['numTxACK'] = notif.numTxACK
     self.data[0]['numWraps'] = notif.numWraps
     if 'asn' not in self.data[0]:
         self.data[0]['asn'] = typeAsn.typeAsn()
     self.data[0]['asn'].update(notif.asn_0_1, notif.asn_2_3, notif.asn_4)
     self.data[0]['f6PNORES'] = notif.f6PNORES
     self.data[0]['sixtopGEN'] = notif.sixtopGEN
     self.data[0]['sixtopSeqNum'] = notif.sixtopSeqNum
     self.data[0]['backoffExponent'] = notif.backoffExponent
     self.data[0]['backoff'] = notif.backoff
Ejemplo n.º 3
0
    def update(self, notif):

        # update state
        StateElem.update(self)
        if len(self.data) == 0:
            self.data.append({})
        self.data[0]['isDAGroot'] = notif.isDAGroot
        self.data[0]['isBridge'] = notif.isBridge
        if 'my16bID' not in self.data[0]:
            self.data[0]['my16bID'] = typeAddr.typeAddr()
        self.data[0]['my16bID'].update(notif.my16bID_type, notif.my16bID_bodyH,
                                       notif.my16bID_bodyL)
        if 'my64bID' not in self.data[0]:
            self.data[0]['my64bID'] = typeAddr.typeAddr()
        self.data[0]['my64bID'].update(notif.my64bID_type, notif.my64bID_bodyH,
                                       notif.my64bID_bodyL)
        if 'myPANID' not in self.data[0]:
            self.data[0]['myPANID'] = typeAddr.typeAddr()
        self.data[0]['myPANID'].update(notif.myPANID_type, notif.myPANID_bodyH,
                                       notif.myPANID_bodyL)
        if 'myPrefix' not in self.data[0]:
            self.data[0]['myPrefix'] = typeAddr.typeAddr()
        self.data[0]['myPrefix'].update(notif.myPrefix_type,
                                        notif.myPrefix_bodyH,
                                        notif.myPrefix_bodyL)

        # announce information about the DAG root to the eventBus
        if self.isDAGroot != self.data[0]['isDAGroot']:

            # dispatch
            self.eventBusClient.dispatch(
                signal='infoDagRoot',
                data={
                    'isDAGroot': self.data[0]['isDAGroot'],
                    'eui64': self.data[0]['my64bID'].addr,
                    'serialPort': self.moteConnector.serialport,
                },
            )

        # record isDAGroot
        self.isDAGroot = self.data[0]['isDAGroot']
Ejemplo n.º 4
0
    def update(self, notif):

        # update state
        StateElem.update(self)
        if len(self.data) == 0:
            self.data.append({})
        self.data[0]["isDAGroot"] = notif.isDAGroot
        self.data[0]["isBridge"] = notif.isBridge
        if "my16bID" not in self.data[0]:
            self.data[0]["my16bID"] = typeAddr.typeAddr()
        self.data[0]["my16bID"].update(notif.my16bID_type, notif.my16bID_bodyH, notif.my16bID_bodyL)
        if "my64bID" not in self.data[0]:
            self.data[0]["my64bID"] = typeAddr.typeAddr()
        self.data[0]["my64bID"].update(notif.my64bID_type, notif.my64bID_bodyH, notif.my64bID_bodyL)
        if "myPANID" not in self.data[0]:
            self.data[0]["myPANID"] = typeAddr.typeAddr()
        self.data[0]["myPANID"].update(notif.myPANID_type, notif.myPANID_bodyH, notif.myPANID_bodyL)
        if "myPrefix" not in self.data[0]:
            self.data[0]["myPrefix"] = typeAddr.typeAddr()
        self.data[0]["myPrefix"].update(notif.myPrefix_type, notif.myPrefix_bodyH, notif.myPrefix_bodyL)

        # announce information about the DAG root to the eventBus
        if self.isDAGroot != self.data[0]["isDAGroot"]:

            # dispatch
            self.eventBusClient.dispatch(
                signal="infoDagRoot",
                data={
                    "isDAGroot": self.data[0]["isDAGroot"],
                    "eui64": self.data[0]["my64bID"].addr,
                    "serialPort": self.moteConnector.serialport,
                },
            )

        # record isDAGroot
        self.isDAGroot = self.data[0]["isDAGroot"]
Ejemplo n.º 5
0
 def update(self, notif):
     StateElem.update(self)
     if len(self.data) == 0:
         self.data.append({})
     self.data[0]["slotOffset"] = notif.slotOffset
     if "type" not in self.data[0]:
         self.data[0]["type"] = typeCellType.typeCellType()
     self.data[0]["type"].update(notif.type)
     self.data[0]["shared"] = notif.shared
     self.data[0]["channelOffset"] = notif.channelOffset
     if "neighbor" not in self.data[0]:
         self.data[0]["neighbor"] = typeAddr.typeAddr()
     self.data[0]["neighbor"].update(notif.neighbor_type, notif.neighbor_bodyH, notif.neighbor_bodyL)
     self.data[0]["numRx"] = notif.numRx
     self.data[0]["numTx"] = notif.numTx
     self.data[0]["numTxACK"] = notif.numTxACK
     if "lastUsedAsn" not in self.data[0]:
         self.data[0]["lastUsedAsn"] = typeAsn.typeAsn()
     self.data[0]["lastUsedAsn"].update(notif.lastUsedAsn_0_1, notif.lastUsedAsn_2_3, notif.lastUsedAsn_4)
Ejemplo n.º 6
0
 def update(self, notif):
     StateElem.update(self)
     if len(self.data) == 0:
         self.data.append({})
     self.data[0]['slotOffset'] = notif.slotOffset
     if 'type' not in self.data[0]:
         self.data[0]['type'] = typeCellType.typeCellType()
     self.data[0]['type'].update(notif.type)
     self.data[0]['shared'] = notif.shared
     self.data[0]['channelOffset'] = notif.channelOffset
     if 'neighbor' not in self.data[0]:
         self.data[0]['neighbor'] = typeAddr.typeAddr()
     self.data[0]['neighbor'].update(notif.neighbor_type,
                                     notif.neighbor_bodyH,
                                     notif.neighbor_bodyL)
     self.data[0]['numRx'] = notif.numRx
     self.data[0]['numTx'] = notif.numTx
     self.data[0]['numTxACK'] = notif.numTxACK
     if 'lastUsedAsn' not in self.data[0]:
         self.data[0]['lastUsedAsn'] = typeAsn.typeAsn()
     self.data[0]['lastUsedAsn'].update(notif.lastUsedAsn_0_1,
                                        notif.lastUsedAsn_2_3,
                                        notif.lastUsedAsn_4)
Ejemplo n.º 7
0
 def update(self,notif):
     StateElem.update(self)
     if len(self.data)==0:
         self.data.append({})
     self.data[0]['slotOffset']          = notif.slotOffset
     if 'type' not in self.data[0]:
         self.data[0]['type']            = typeCellType.typeCellType()
     self.data[0]['type'].update(notif.type)
     self.data[0]['shared']              = notif.shared
     self.data[0]['channelOffset']       = notif.channelOffset
     if 'neighbor' not in self.data[0]:
         self.data[0]['neighbor']        = typeAddr.typeAddr()
     self.data[0]['neighbor'].update(notif.neighbor_type,
                                     notif.neighbor_bodyH,
                                     notif.neighbor_bodyL)
     self.data[0]['numRx']               = notif.numRx
     self.data[0]['numTx']               = notif.numTx
     self.data[0]['numTxACK']            = notif.numTxACK
     if 'lastUsedAsn' not in self.data[0]:
         self.data[0]['lastUsedAsn']     = typeAsn.typeAsn()
     self.data[0]['lastUsedAsn'].update(notif.lastUsedAsn_0_1,
                                        notif.lastUsedAsn_2_3,
                                        notif.lastUsedAsn_4)
Ejemplo n.º 8
0
 def update(self, notif):
     StateElem.update(self)
     if len(self.data) == 0:
         self.data.append({})
     self.data[0]["used"] = notif.used
     self.data[0]["parentPreference"] = notif.parentPreference
     self.data[0]["stableNeighbor"] = notif.stableNeighbor
     self.data[0]["switchStabilityCounter"] = notif.switchStabilityCounter
     self.data[0]["joinPrio"] = notif.joinPrio
     if "addr" not in self.data[0]:
         self.data[0]["addr"] = typeAddr.typeAddr()
     self.data[0]["addr"].update(notif.addr_type, notif.addr_bodyH, notif.addr_bodyL)
     self.data[0]["DAGrank"] = notif.DAGrank
     if "rssi" not in self.data[0]:
         self.data[0]["rssi"] = typeRssi.typeRssi()
     self.data[0]["rssi"].update(notif.rssi)
     self.data[0]["numRx"] = notif.numRx
     self.data[0]["numTx"] = notif.numTx
     self.data[0]["numTxACK"] = notif.numTxACK
     self.data[0]["numWraps"] = notif.numWraps
     if "asn" not in self.data[0]:
         self.data[0]["asn"] = typeAsn.typeAsn()
     self.data[0]["asn"].update(notif.asn_0_1, notif.asn_2_3, notif.asn_4)
Ejemplo n.º 9
0
    def update(self, notif):

        # update state
        StateElem.update(self)
        if len(self.data) == 0:
            self.data.append({})

        self.data[0]['isDAGroot'] = notif.isDAGroot

        if 'myPANID' not in self.data[0]:
            self.data[0]['myPANID'] = typeAddr.typeAddr()
            self.data[0]['myPANID'].desc = 'panId'
        self.data[0]['myPANID'].addr = [
            notif.myPANID_0,
            notif.myPANID_1,
        ]

        if 'my16bID' not in self.data[0]:
            self.data[0]['my16bID'] = typeAddr.typeAddr()
            self.data[0]['my16bID'].desc = '16b'
        self.data[0]['my16bID'].addr = [
            notif.my16bID_0,
            notif.my16bID_1,
        ]

        if 'my64bID' not in self.data[0]:
            self.data[0]['my64bID'] = typeAddr.typeAddr()
            self.data[0]['my64bID'].desc = '64b'
        self.data[0]['my64bID'].addr = [
            notif.my64bID_0, notif.my64bID_1, notif.my64bID_2, notif.my64bID_3,
            notif.my64bID_4, notif.my64bID_5, notif.my64bID_6, notif.my64bID_7
        ]

        if 'myPrefix' not in self.data[0]:
            self.data[0]['myPrefix'] = typeAddr.typeAddr()
            self.data[0]['myPrefix'].desc = 'prefix'
        self.data[0]['myPrefix'].addr = [
            notif.myPrefix_0,
            notif.myPrefix_1,
            notif.myPrefix_2,
            notif.myPrefix_3,
            notif.myPrefix_4,
            notif.myPrefix_5,
            notif.myPrefix_6,
            notif.myPrefix_7,
        ]

        # announce information about the DAG root to the eventBus
        if self.isDAGroot != self.data[0]['isDAGroot']:

            # dispatch
            self.eventBusClient.dispatch(
                signal='infoDagRoot',
                data={
                    'isDAGroot': self.data[0]['isDAGroot'],
                    'eui64': self.data[0]['my64bID'].addr,
                    'serialPort': self.moteConnector.serialport,
                },
            )

        # record isDAGroot
        self.isDAGroot = self.data[0]['isDAGroot']
Ejemplo n.º 10
0
 def update(self,notif):
 
     # update state
     StateElem.update(self)
     if len(self.data)==0:
         self.data.append({})
     
     self.data[0]['isDAGroot']           = notif.isDAGroot
     
     if 'myPANID' not  in self.data[0]:
         self.data[0]['myPANID']         = typeAddr.typeAddr()
         self.data[0]['myPANID'].desc    = 'panId'
     self.data[0]['myPANID'].addr        = [
         notif.myPANID_0,
         notif.myPANID_1,
     ]
     
     if 'my16bID' not  in self.data[0]:
         self.data[0]['my16bID']         = typeAddr.typeAddr()
         self.data[0]['my16bID'].desc    = '16b'
     self.data[0]['my16bID'].addr        = [
         notif.my16bID_0,
         notif.my16bID_1,
     ]
     
     if 'my64bID' not  in self.data[0]:
         self.data[0]['my64bID']         = typeAddr.typeAddr()
         self.data[0]['my64bID'].desc    = '64b'
     self.data[0]['my64bID'].addr        = [
         notif.my64bID_0,
         notif.my64bID_1,
         notif.my64bID_2,
         notif.my64bID_3,
         notif.my64bID_4,
         notif.my64bID_5,
         notif.my64bID_6,
         notif.my64bID_7
     ]
     
     if 'myPrefix' not  in self.data[0]:
         self.data[0]['myPrefix']        = typeAddr.typeAddr()
         self.data[0]['myPrefix'].desc   = 'prefix'
     self.data[0]['myPrefix'].addr       = [
         notif.myPrefix_0,
         notif.myPrefix_1,
         notif.myPrefix_2,
         notif.myPrefix_3,
         notif.myPrefix_4,
         notif.myPrefix_5,
         notif.myPrefix_6,
         notif.myPrefix_7,
     ]
     
     # announce information about the DAG root to the eventBus
     if  self.isDAGroot!=self.data[0]['isDAGroot']:
         
         # dispatch
         self.eventBusClient.dispatch(
             signal        = 'infoDagRoot',
             data          = {
                                 'isDAGroot':    self.data[0]['isDAGroot'],
                                 'eui64':        self.data[0]['my64bID'].addr,
                                 'serialPort':   self.moteConnector.serialport,
                             },
         )
     
     # record isDAGroot
     self.isDAGroot = self.data[0]['isDAGroot']