Coap Client and Server

Dependencies:   DebugLib EthernetInterface cantcoap mbed-rtos

Dependents:   COAP coap

Fork of yeswecancoap by Sille Van Landschoot

YesWeCanCoap

Is a small coap client and server library for mbed based on the cantcoap library.

Import librarycantcoap

This is CoAP library with a focus on simplicity. It offers minimal CoAP PDU construction and decoding to and from byte buffers.

yeswecancoap server enables easy implementation of coap resources, each with a dedicated function. When the function is registered by the server, it will do the rest.

Coap server example

Repository: YesWeCanCoap-example

Coap client example

under construction

Committer:
sillevl
Date:
Tue Nov 17 16:44:39 2015 +0000
Revision:
29:62113a57353b
Parent:
19:6414961fb98d
added method to get the ip address

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dwini 19:6414961fb98d 1 /* mbed Microcontroller Library
dwini 19:6414961fb98d 2 * Copyright (c) 2006-2013 ARM Limited
dwini 19:6414961fb98d 3 *
dwini 19:6414961fb98d 4 * Licensed under the Apache License, Version 2.0 (the "License");
dwini 19:6414961fb98d 5 * you may not use this file except in compliance with the License.
dwini 19:6414961fb98d 6 * You may obtain a copy of the License at
dwini 19:6414961fb98d 7 *
dwini 19:6414961fb98d 8 * http://www.apache.org/licenses/LICENSE-2.0
dwini 19:6414961fb98d 9 *
dwini 19:6414961fb98d 10 * Unless required by applicable law or agreed to in writing, software
dwini 19:6414961fb98d 11 * distributed under the License is distributed on an "AS IS" BASIS,
dwini 19:6414961fb98d 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dwini 19:6414961fb98d 13 * See the License for the specific language governing permissions and
dwini 19:6414961fb98d 14 * limitations under the License.
dwini 19:6414961fb98d 15 */
dwini 19:6414961fb98d 16 #ifndef MBED_ERROR_H
dwini 19:6414961fb98d 17 #define MBED_ERROR_H
dwini 19:6414961fb98d 18
dwini 19:6414961fb98d 19 /** To generate a fatal compile-time error, you can use the pre-processor #error directive.
dwini 19:6414961fb98d 20 *
dwini 19:6414961fb98d 21 * @code
dwini 19:6414961fb98d 22 * #error "That shouldn't have happened!"
dwini 19:6414961fb98d 23 * @endcode
dwini 19:6414961fb98d 24 *
dwini 19:6414961fb98d 25 * If the compiler evaluates this line, it will report the error and stop the compile.
dwini 19:6414961fb98d 26 *
dwini 19:6414961fb98d 27 * For example, you could use this to check some user-defined compile-time variables:
dwini 19:6414961fb98d 28 *
dwini 19:6414961fb98d 29 * @code
dwini 19:6414961fb98d 30 * #define NUM_PORTS 7
dwini 19:6414961fb98d 31 * #if (NUM_PORTS > 4)
dwini 19:6414961fb98d 32 * #error "NUM_PORTS must be less than 4"
dwini 19:6414961fb98d 33 * #endif
dwini 19:6414961fb98d 34 * @endcode
dwini 19:6414961fb98d 35 *
dwini 19:6414961fb98d 36 * Reporting Run-Time Errors:
dwini 19:6414961fb98d 37 * To generate a fatal run-time error, you can use the mbed error() function.
dwini 19:6414961fb98d 38 *
dwini 19:6414961fb98d 39 * @code
dwini 19:6414961fb98d 40 * error("That shouldn't have happened!");
dwini 19:6414961fb98d 41 * @endcode
dwini 19:6414961fb98d 42 *
dwini 19:6414961fb98d 43 * If the mbed running the program executes this function, it will print the
dwini 19:6414961fb98d 44 * message via the USB serial port, and then die with the blue lights of death!
dwini 19:6414961fb98d 45 *
dwini 19:6414961fb98d 46 * The message can use printf-style formatting, so you can report variables in the
dwini 19:6414961fb98d 47 * message too. For example, you could use this to check a run-time condition:
dwini 19:6414961fb98d 48 *
dwini 19:6414961fb98d 49 * @code
dwini 19:6414961fb98d 50 * if(x >= 5) {
dwini 19:6414961fb98d 51 * error("expected x to be less than 5, but got %d", x);
dwini 19:6414961fb98d 52 * }
dwini 19:6414961fb98d 53 * #endcode
dwini 19:6414961fb98d 54 */
dwini 19:6414961fb98d 55
dwini 19:6414961fb98d 56 #ifdef __cplusplus
dwini 19:6414961fb98d 57 extern "C" {
dwini 19:6414961fb98d 58 #endif
dwini 19:6414961fb98d 59
dwini 19:6414961fb98d 60 void error(const char* format, ...);
dwini 19:6414961fb98d 61
dwini 19:6414961fb98d 62 #ifdef __cplusplus
dwini 19:6414961fb98d 63 }
dwini 19:6414961fb98d 64 #endif
dwini 19:6414961fb98d 65
dwini 19:6414961fb98d 66 #endif