Esempio n. 1
0
void AsiMS2000::interpretCommand(char commandBuffer[])
{
    String c = String(commandBuffer);
    int s = c.indexOf(' ');
    clearCommandBuffer(commandBuffer);
    
    String base;
    if(s > 0)
    {
      base = c.substring(0,s);
      _args = c.substring(s);
#if ARDUINO>=100//toUppercase modifies string in place in 1.0
      _args.toUpperCase();
#else
      _args = _args.toUpperCase();
#endif
      
    }
    else
    {
      base = c;
    }
    
    _isQuery = isQueryCommand(c);
    isAxisInCommand();
    int commandNum = getCommandNum(base);
    if(commandNum > -1)
    {
      selectCommand(commandNum);
    }
}
Esempio n. 2
0
int getCollectorCommandNum(const char * name)
{
	// we have to do name lookup within the entire name table.
	int cmd = getCommandNum(name);
	// then check to see if we got back a collector command  id
	if (cmd >= DCTranslation[DCTranslation_COLLECTOR_start].id &&
		cmd <= DCTranslation[DCTranslation_COLLECTOR_start + DCTranslation_COLLECTOR_count -1].id)
		return cmd;
	return -1;
}