com.zsmartsystems.zigbee.zcl.ZclStatus.getId()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(84)

本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclStatus.getId()方法的一些代码示例,展示了ZclStatus.getId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclStatus.getId()方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.ZclStatus
类名称:ZclStatus
方法名:getId

ZclStatus.getId介绍

[英]Gets the integer status ID for this code
[中]获取此代码的整数状态ID

代码示例

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

@Override
  public String toString() {
    StringBuilder builder = new StringBuilder(60);
    builder.append("CommandResult [");
    if (isSuccess()) {
      builder.append("SUCCESS, ");
      builder.append(response);
    } else if (isTimeout()) {
      builder.append("TIMEOUT");
    } else {
      final ZclStatus status = ZclStatus.getStatus((byte) getStatusCode().intValue());
      builder.append("ERROR (");
      builder.append(status.name());
      builder.append(String.format(",0x%02X), ", status.getId()));
      builder.append(response);
    }
    builder.append(']');
    return builder.toString();
  }
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

@Test
public void getId() {
  assertEquals(0x00, ZclStatus.SUCCESS.getId());
  assertEquals(0x01, ZclStatus.FAILURE.getId());
  assertEquals(0x7E, ZclStatus.NOT_AUTHORIZED.getId());
  assertEquals(0x88, ZclStatus.READ_ONLY.getId());
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

/**
 * Gets status code received in default response.
 *
 * @return the status code as {@link Integer}
 */
public Integer getStatusCode() {
  if (hasStatusCode()) {
    if (response instanceof DefaultResponse) {
      return ((DefaultResponse) response).getStatusCode().getId();
    } else {
      return ((ZdoResponse) response).getStatus().getId();
    }
  } else {
    return 0xffff;
  }
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

break;
case ZCL_STATUS:
  buffer[length++] = ((ZclStatus) data).getId();
  break;
case BYTE_ARRAY:

相关文章