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

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


   *
   * @param exchange the exchange with the request
   */
  @Override
  public void handleRequest(final Exchange exchange) {
    Code code = exchange.getRequest().getCode();
    switch (code) {
      case GET:  handleGET(new CoapExchange(exchange, this)); break;
      case POST:  handlePOST(new CoapExchange(exchange, this)); break;
      case PUT:  handlePUT(new CoapExchange(exchange, this)); break;
      case DELETE: handleDELETE(new CoapExchange(exchange, this)); break;
View Full Code Here


 
  private DatagramWriter writer;
 
  public byte[] serializeRequest(Request request) {
    writer = new DatagramWriter();
    Code code = request.getCode();
    serializeMessage(request, code == null ? 0 : code.value);
    return writer.toByteArray();
  }
View Full Code Here

    if (incomingRequest == null) {
      throw new IllegalArgumentException("incomingRequest == null");
    }

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

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

    // create the request
View Full Code Here

    }

    // get/set the response code
    int httpCode = httpResponse.getStatusLine().getStatusCode();
    ResponseCode coapCode;
    Code coapMethod = coapRequest.getCode();

    // the code 204-"no content" should be managed
    // separately because it can be mapped to different coap codes
    // depending on the request that has originated the response
    if (httpCode == HttpStatus.SC_NO_CONTENT) {
View Full Code Here

TOP

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

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.