code: def __setDeviceMode(self, mode):
          
          print 'call __setDeviceMode'
  
          try:
              cmd = WPANCTL_CMD + 'setprop Thread:DeviceMode %d' % mode
              return self.__sendCommand(cmd)[0] != 'Fail'
          except Exception, e:
              ModuleHelper.WriteIntoDebugLogger('setDeviceMode() Error: ' + str(e))
docs: set thread device mode:
  
          Args:
             mode: thread device mode. 15=rsdn, 13=rsn, 4=s
             r: rx-on-when-idle
             s: secure IEEE 802.15.4 data request
             d: full thread device
             n: full network data
  
          Returns:
             True: successful to set the device mode
             False: fail to set the device mode