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

Examples of ch.ethz.inf.vs.californium.coap.CoAP.Type


    LOGGER.finer("Send response, failed transmissions: "+exchange.getFailedTransmissionCount());

    // If a response type is set, we do not mess around with it.
    // Only if none is set, we have to decide for one here.
   
    Type respType = response.getType();
    if (respType == null) {
      Type reqType = exchange.getCurrentRequest().getType();
      if (reqType == Type.CON) {
        if (exchange.getCurrentRequest().isAcknowledged()) {
          // send separate response
          response.setType(Type.CON);
        } else {
View Full Code Here


   * Returns true if the specified response is still in transit. A response is
   * in transit if it has not yet been acknowledged, rejected or its current
   * transmission has not yet timed out.
   */
  private boolean isInTransit(Response response) {
    Type type = response.getType();
    boolean acked = response.isAcknowledged();
    boolean timeout = response.isTimedOut();
    boolean result = type == Type.CON && !acked && !timeout;
    return result;
  }
View Full Code Here

        if (next != null) {
          LOGGER.fine("The notification has timed out and there is a younger notification. Send the younger one");
          relation.setNextControlNotification(null);
          // Send the next notification
          response.cancel();
          Type nt = next.getType();
          if (nt != Type.CON); {
            LOGGER.finer("The next notification's type was "+nt+". Since it replaces a CON control notification, it becomes a CON as well");
            prepareSelfReplacement(exchange, next);
            next.setType(Type.CON); // Force the next to be a Confirmable as well
          }
View Full Code Here

    // get the code
    Code code = incomingRequest.getCode();

    // get message type
    Type type = incomingRequest.getType();

    // create the request
    Request outgoingRequest = new Request(code);
    outgoingRequest.setConfirmable(type == Type.CON);
View Full Code Here

TOP

Related Classes of ch.ethz.inf.vs.californium.coap.CoAP.Type

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.