Exemplo n.º 1
0
 def debug_level(self, level=None):
     if level is None:
         try:
             ret = pycom.nvs_get('pymesh_debug')
         except:
             ret = None
         return ret
     try:
         ret = int(level)
     except:
         ret = self.debug_level
     debug_level(ret)
Exemplo n.º 2
0
            weight = 0
        ret = self.ot_cli('leaderweight '+ str(weight))
        return ret == ''

    def debug_level(self, level = None):
        if level is None:
            try:
                ret = pycom.nvs_get('pymesh_debug')
            except:
                ret = None
            return ret
        try:
            ret = int(level)
        except:
            ret = self.debug_level
        debug_level(ret)

    # def parent(self):
    #     """ Returns the Parent MAC for the current Child node
    #     Returns 0 if node is not Child """

    #     if self.mesh.mesh.mesh.state() != self.mesh.mesh.STATE_CHILD:
    #         print("Not Child, no Parent")
    #         return 0
    #     # try:
    #     parent_mac = int(self.mesh.mesh.mesh.cli('parent').split('\r\n')[0].split('Ext Addr: ')[1], 16)
    #     # except:
    #         # parent_mac = 0
    #     print('Parent mac is:', parent_mac)
    #     return parent_mac