code: def getDeviceRole(self):
          
          print '%s call getDeviceRole' % self.port
          return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])
docs: get current device role in Thread Network