def __startOpenThreadWpan(self):
        """start OpenThreadWpan

        Returns:
            True: successful to start OpenThreadWpan up
            False: fail to start OpenThreadWpan
        """
        print 'call startOpenThreadWpan'
        try:

            # restore whitelist/blacklist address filter mode if rejoin after reset
            if self.isPowerDown:
                if self._addressfilterMode == 'whitelist':
                    if self.__setAddressfilterMode('whitelist'):
                        for addr in self._addressfilterSet:
                            self.addAllowMAC(addr)
                elif self._addressfilterMode == 'blacklist':
                    if self.__setAddressfilterMode('blacklist'):
                        for addr in self._addressfilterSet:
                            self.addBlockedMAC(addr)
            time.sleep(1)
            if ModuleHelper.LeaderDutChannelFound:
                self.channel = ModuleHelper.Default_Channel
            nodeType = 'router'
            startType = 'join'
            if self.deviceRole == Thread_Device_Role.Leader:
                nodeType = 'router'
                startType = 'form'
            elif self.deviceRole == Thread_Device_Role.Router:
                nodeType = 'router'
            elif self.deviceRole == Thread_Device_Role.SED:
                nodeType = 'sed'
            elif self.deviceRole == Thread_Device_Role.EndDevice:
                nodeType = 'end'
            elif self.deviceRole == Thread_Device_Role.REED:
                nodeType = 'router'
            elif self.deviceRole == Thread_Device_Role.EndDevice_FED:
                nodeType = 'router'
            elif self.deviceRole == Thread_Device_Role.EndDevice_MED:
                nodeType = 'end'
            else:
                pass

            if self.deviceRole in [Thread_Device_Role.Leader, Thread_Device_Role.Router, Thread_Device_Role.REED]:
                self.__setRouterSelectionJitter(1)

            if startType == 'form':
                startCmd = WPANCTL_CMD + '%s %s -c %s -T %s ' % (startType, self.networkName, str(self.channel), nodeType)
            else:
                startCmd = WPANCTL_CMD + '%s %s -p %s -c %s -T %s ' % (startType, self.networkName, str(hex(self.panId)), str(self.channel), nodeType)
            if self.__sendCommand(startCmd)[0] != 'Fail':
                if self.__isOpenThreadWpanRunning():
                    self.isPowerDown = False
                    if self.hasActiveDatasetToCommit:
                        if self.__sendCommand(WPANCTL_CMD + 'setprop Dataset:Command SetActive')[0] == 'Fail':
                            raise Exception('failed to commit active dataset')
                        else:
                            self.hasActiveDatasetToCommit = False

                    return True
            else:
                return False
        except Exception, e:
            ModuleHelper.WriteIntoDebugLogger('startOpenThreadWpan() Error: ' + str(e))
def __startOpenThreadWpan ( self ) : print 'call startOpenThreadWpan' try : if self . isPowerDown : if self . _addressfilterMode == 'whitelist' : if self . __setAddressfilterMode ( 'whitelist' ) : for addr in self . _addressfilterSet : self . addAllowMAC ( addr ) elif self . _addressfilterMode == 'blacklist' : if self . __setAddressfilterMode ( 'blacklist' ) : for addr in self . _addressfilterSet : self . addBlockedMAC ( addr ) time . sleep ( 1 ) if ModuleHelper . LeaderDutChannelFound : self . channel = ModuleHelper . Default_Channel nodeType = 'router' startType = 'join' if self . deviceRole == Thread_Device_Role . Leader : nodeType = 'router' startType = 'form' elif self . deviceRole == Thread_Device_Role . Router : nodeType = 'router' elif self . deviceRole == Thread_Device_Role . SED : nodeType = 'sed' elif self . deviceRole == Thread_Device_Role . EndDevice : nodeType = 'end' elif self . deviceRole == Thread_Device_Role . REED : nodeType = 'router' elif self . deviceRole == Thread_Device_Role . EndDevice_FED : nodeType = 'router' elif self . deviceRole == Thread_Device_Role . EndDevice_MED : nodeType = 'end' else : pass if self . deviceRole in [ Thread_Device_Role . Leader , Thread_Device_Role . Router , Thread_Device_Role . REED ] : self . __setRouterSelectionJitter ( 1 ) if startType == 'form' : startCmd = WPANCTL_CMD + '%s %s -c %s -T %s ' % ( startType , self . networkName , str ( self . channel ) , nodeType ) else : startCmd = WPANCTL_CMD + '%s %s -p %s -c %s -T %s ' % ( startType , self . networkName , str ( hex ( self . panId ) ) , str ( self . channel ) , nodeType ) if self . __sendCommand ( startCmd ) [ 0 ] != 'Fail' : if self . __isOpenThreadWpanRunning ( ) : self . isPowerDown = False if self . hasActiveDatasetToCommit : if self . __sendCommand ( WPANCTL_CMD + 'setprop Dataset:Command SetActive' ) [ 0 ] == 'Fail' : raise Exception ( 'failed to commit active dataset' ) else : self . hasActiveDatasetToCommit = False return True else : return False except Exception , e : ModuleHelper . WriteIntoDebugLogger ( 'startOpenThreadWpan() Error: ' + str ( e ) )
start OpenThreadWpan

        Returns:
            True: successful to start OpenThreadWpan up
            False: fail to start OpenThreadWpan