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:
13:6667e331c719
added method to get the ip address

Who changed what in which revision?

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