Package ch.ethz.inf.vs.californium.coap

Examples of ch.ethz.inf.vs.californium.coap.OptionSet


          Request request = exchange.getRequest();
          int num = block2.getNum() + 1;
          int szx = block2.getSzx();
          boolean m = false;
          Request block = new Request(request.getCode());
          block.setOptions(new OptionSet(request.getOptions()));
          block.setDestination(request.getDestination());
          block.setDestinationPort(request.getDestinationPort());
         
          block.setType(request.getType()); // NON could make sense over SMS or similar transports
          block.getOptions().setBlock2(szx, m, num);
View Full Code Here


 
  private Request getNextRequestBlock(Request request, BlockwiseStatus status) {
    int num = status.getCurrentNum();
    int szx = status.getCurrentSzx();
    Request block = new Request(request.getCode());
    block.setOptions(new OptionSet(request.getOptions()));
    block.setDestination(request.getDestination());
    block.setDestinationPort(request.getDestinationPort());
    block.setToken(request.getToken());
    block.setType(Type.CON);
   
View Full Code Here

    Response block = new Response(response.getCode());
//    block.setType(response.getType()); // NO! First block has type from origin response, all other depend on current request
    block.setDestination(response.getDestination());
    block.setDestinationPort(response.getDestinationPort());
    block.setToken(response.getToken());
    block.setOptions(new OptionSet(response.getOptions()));
    block.addMessageObserver(new TimeoutForwarder(response));
   
    if (response.getPayloadSize() > 0) {
      int currentSize = 1 << (4 + szx);
      int from = num * currentSize;
 
View Full Code Here

    message.setMID(last.getMID());
    message.setSource(last.getSource());
    message.setSourcePort(last.getSourcePort());
    message.setToken(last.getToken());
    message.setType(last.getType());
    message.setOptions(new OptionSet(last.getOptions()));
   
    int length = 0;
    for (byte[] block:status.getBlocks())
      length += block.length;
   
View Full Code Here

    // have to be assigned by the proper layer
    // do not copy the block* option because it is a local option and
    // have to be assigned by the proper layer
    // do not copy the uri-* options because they are already filled in
    // the new message
    OptionSet options = new OptionSet(incomingRequest.getOptions());
    options.removeProxyURI();
    options.removeBlock1();
    options.removeBlock2();
    options.clearURIPaths();
    options.clearURIQuery();
    outgoingRequest.setOptions(options);
   
    // set the proxy-uri as the outgoing uri
    if (serverUri != null) {
      outgoingRequest.setURI(serverUri);
View Full Code Here

    // copy the timestamp
    long timestamp = incomingResponse.getTimestamp();
    outgoingResponse.setTimestamp(timestamp);

    // copy every option
    outgoingResponse.setOptions(new OptionSet(
        incomingResponse.getOptions()));
   
    LOGGER.finer("Incoming response translated correctly");
    return outgoingResponse;
  }
View Full Code Here

TOP

Related Classes of ch.ethz.inf.vs.californium.coap.OptionSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.