Beispiel #1
0
  /**
   * "Pack" the infrared command so that it can be sent to the IRTrans device
   *
   * @param led the led
   * @param theCommand the the command
   * @return a string which is the full command to be sent to the device
   */
  protected String packHexCommand(Leds led, IrCommand theCommand) {
    String output = new String();

    output = "Asndhex ";
    output += "L";
    switch (led) {
      case ALL:
        output += "B";
        break;
      case ONE:
        output += "1";
        break;
      case TWO:
        output += "2";
        break;
      case THREE:
        output += "3";
        break;
      case FOUR:
        output += "4";
        break;
      case FIVE:
        output += "5";
        break;
      case SIX:
        output += "6";
        break;
      case SEVEN:
        output += "7";
        break;
      case EIGHT:
        output += "8";
        break;
      case INTERNAL:
        output += "I";
        break;
      case EXTERNAL:
        output += "E";
        break;
      case DEFAULT:
        output += "D";
        break;
    }

    output += ",";
    output += "H" + theCommand.toHEXString();

    output += (char) 13;

    return output;
  }