示例#1
0
  public String getParameter(String key) {
    logger.trace("Get parameter " + deviceId + ", " + key);
    Pointer pointer = library.tdGetDeviceParameter(deviceId, key, "");
    String value = pointer.getString(0);

    logger.trace("Release parameter " + deviceId);
    library.tdReleaseString(pointer);

    return value;
  }
示例#2
0
  protected Device(DeviceHandler deviceHandler, int deviceId) {
    this.deviceHandler = deviceHandler;
    this.deviceId = deviceId;

    library = deviceHandler.getLibrary();

    // Name
    {
      logger.trace("Get device name " + deviceId);
      Pointer namePointer = library.tdGetName(deviceId);
      name = namePointer.getString(0);

      logger.trace("Release name " + deviceId);
      library.tdReleaseString(namePointer);
    }

    // Model
    {
      logger.trace("Get model " + deviceId);
      Pointer modelPointer = library.tdGetModel(deviceId);
      model = modelPointer.getString(0);

      logger.trace("Release model " + deviceId);
      library.tdReleaseString(modelPointer);
    }

    // Protocol
    {
      logger.trace("Get protocol " + deviceId);
      Pointer protocolPointer = library.tdGetProtocol(deviceId);
      protocol = protocolPointer.getString(0);

      logger.trace("Release protocol " + deviceId);
      library.tdReleaseString(protocolPointer);
    }

    deviceType = library.tdGetDeviceType(deviceId);
  }
示例#3
0
  public int getStatus() {
    logger.trace("Get status {}", deviceId);

    return library.tdLastSentCommand(deviceId, deviceHandler.getSupportedMethods());
  }