本文整理了Java中org.eclipse.californium.core.coap.OptionSet.getBlock1()
方法的一些代码示例,展示了OptionSet.getBlock1()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OptionSet.getBlock1()
方法的具体详情如下:
包路径:org.eclipse.californium.core.coap.OptionSet
类名称:OptionSet
方法名:getBlock1
[英]Returns the Block1 option as encoded object.
[中]将Block1选项作为编码对象返回。
代码示例来源:origin: eclipse/californium
@Override
protected boolean checkResponse(Request request, Response response) {
boolean success = response.getOptions().hasBlock1();
if (!success) {
System.out.println("FAIL: no Block1 option");
} else {
int maxNUM = response.getOptions().getBlock1().getNum();
success &= checkInt(EXPECTED_RESPONSE_CODE.value,
response.getCode().value, "code");
success &= checkOption(new BlockOption(PlugtestChecker.PLUGTEST_BLOCK_SZX,
false, maxNUM), response.getOptions().getBlock1(),
"Block1");
success &= hasLocation(response);
}
return success;
}
}
代码示例来源:origin: eclipse/californium
@Override
protected boolean checkResponse(Request request, Response response) {
boolean success = response.getOptions().hasBlock1();
if (!success) {
System.out.println("FAIL: no Block1 option");
} else {
int maxNUM = response.getOptions().getBlock1().getNum();
success &= checkType(Type.ACK, response.getType());
success &= checkInt(EXPECTED_RESPONSE_CODE.value,
response.getCode().value, "code");
success &= checkOption(new BlockOption(PlugtestChecker.PLUGTEST_BLOCK_SZX,
false, maxNUM), response.getOptions().getBlock1(),
"Block1");
}
return success;
}
}
代码示例来源:origin: eclipse/californium
options.add(new Option(OptionNumberRegistry.BLOCK1, getBlock1().getValue()));
if (hasBlock2())
options.add(new Option(OptionNumberRegistry.BLOCK2, getBlock2().getValue()));
代码示例来源:origin: eclipse/californium
protected final void appendRequestDetails(final Request request) {
if (request.isCanceled()) {
buffer.append("CANCELED ");
}
buffer.append(request.getType()).append(" [MID=").append(request.getMID())
.append(", T=").append(request.getTokenString()).append("], ")
.append(request.getCode()).append(", /").append(request.getOptions().getUriPathString());
appendBlockOption(1, request.getOptions().getBlock1());
appendBlockOption(2, request.getOptions().getBlock2());
appendObserveOption(request.getOptions());
appendSize1(request.getOptions());
appendEtags(request.getOptions());
}
代码示例来源:origin: org.eclipse.californium/californium-core
options.add(new Option(OptionNumberRegistry.BLOCK1, getBlock1().getValue()));
if (hasBlock2())
options.add(new Option(OptionNumberRegistry.BLOCK2, getBlock2().getValue()));
代码示例来源:origin: eclipse/californium
protected final void appendResponseDetails(final Response response) {
if (response.isCanceled()) {
buffer.append("CANCELED ");
}
buffer.append(response.getType()).append(" [MID=").append(response.getMID())
.append(", T=").append(response.getTokenString()).append("], ")
.append(response.getCode());
appendBlockOption(1, response.getOptions().getBlock1());
appendBlockOption(2, response.getOptions().getBlock2());
appendObserveOption(response.getOptions());
appendSize1(response.getOptions());
appendSize2(response.getOptions());
appendEtags(response.getOptions());
}
代码示例来源:origin: eclipse/californium
BlockOption block = response.getOptions().getBlock1();
if (block != null) {
handleBlock1Response(exchange, response, block);
代码示例来源:origin: eclipse/californium
@Override
public void receiveRequest(final Exchange exchange, final Request request) {
BlockOption block1 = request.getOptions().getBlock1();
if (block1 != null) {
代码示例来源:origin: eclipse/californium
public void check(Message message) {
assertTrue("No Block1 option:", message.getOptions().hasBlock1());
BlockOption block1 = message.getOptions().getBlock1();
assertEquals("Wrong Block1 num:", num, block1.getNum());
assertEquals("Wrong Block1 m:", m, block1.isM());
assertEquals("Wrong Block1 size:", size, block1.getSize());
print("Correct Block1 option: " + block1);
}
代码示例来源:origin: org.eclipse.californium/californium-core
BlockOption block1 = request.getOptions().getBlock1();
LOGGER.log(Level.FINE, "Request contains block1 option {0}", block1);
代码示例来源:origin: org.eclipse.californium/californium-core
BlockOption block1 = response.getOptions().getBlock1();
LOGGER.log(Level.FINER, "Response acknowledges block {0}", block1);
内容来源于网络,如有侵权,请联系作者删除!