wrapper of the mbed port of Cyassl. It's based of the work of Ashley Mills

Dependencies:   cyassl-lib

Dependents:   TLS_cyassl-Example TLS_cyassl-Example2 HTTPSClientExample2

Fork of TLS_cyassl by Francois Berder

Import programTLS_cyassl-Example

This program shows how to use TLS_cyassl to connect to mbed.org

Import programTLS_cyassl-Example2

This example show how to create a small TLS server using the TLS_cyassl library.

Committer:
feb11
Date:
Thu Sep 12 16:37:08 2013 +0000
Revision:
0:815067fd66c9
initial import

Who changed what in which revision?

UserRevisionLine numberNew contents of line
feb11 0:815067fd66c9 1 /* dbg.h */
feb11 0:815067fd66c9 2 /* Copyright (C) 2012 mbed.org, MIT License
feb11 0:815067fd66c9 3 *
feb11 0:815067fd66c9 4 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
feb11 0:815067fd66c9 5 * and associated documentation files (the "Software"), to deal in the Software without restriction,
feb11 0:815067fd66c9 6 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
feb11 0:815067fd66c9 7 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
feb11 0:815067fd66c9 8 * furnished to do so, subject to the following conditions:
feb11 0:815067fd66c9 9 *
feb11 0:815067fd66c9 10 * The above copyright notice and this permission notice shall be included in all copies or
feb11 0:815067fd66c9 11 * substantial portions of the Software.
feb11 0:815067fd66c9 12 *
feb11 0:815067fd66c9 13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
feb11 0:815067fd66c9 14 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
feb11 0:815067fd66c9 15 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
feb11 0:815067fd66c9 16 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
feb11 0:815067fd66c9 17 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
feb11 0:815067fd66c9 18 */
feb11 0:815067fd66c9 19
feb11 0:815067fd66c9 20 #ifndef DBG_H_
feb11 0:815067fd66c9 21 #define DBG_H_
feb11 0:815067fd66c9 22
feb11 0:815067fd66c9 23 #ifdef __cplusplus
feb11 0:815067fd66c9 24 extern "C" {
feb11 0:815067fd66c9 25 #endif
feb11 0:815067fd66c9 26
feb11 0:815067fd66c9 27
feb11 0:815067fd66c9 28 void debug_init(void);
feb11 0:815067fd66c9 29 void debug(int level, const char* module, int line, const char* fmt, ...);
feb11 0:815067fd66c9 30 void debug_set_newline(const char* newline);
feb11 0:815067fd66c9 31 void debug_set_speed(int speed);
feb11 0:815067fd66c9 32 void debug_error(const char* module, int line, int ret);
feb11 0:815067fd66c9 33 void debug_exact(const char* fmt, ...);
feb11 0:815067fd66c9 34
feb11 0:815067fd66c9 35 #define DBG_INIT() do{ debug_init(); }while(0)
feb11 0:815067fd66c9 36
feb11 0:815067fd66c9 37 #define DBG_SET_NEWLINE( x ) do{ debug_set_newline(x); }while(0)
feb11 0:815067fd66c9 38
feb11 0:815067fd66c9 39 #define DBG_SET_SPEED( x ) do{ debug_set_speed(x); }while(0)
feb11 0:815067fd66c9 40
feb11 0:815067fd66c9 41 #if __DEBUG__ > 0
feb11 0:815067fd66c9 42 #ifndef __MODULE__
feb11 0:815067fd66c9 43 #error "__MODULE__ must be defined"
feb11 0:815067fd66c9 44 #endif
feb11 0:815067fd66c9 45 #endif
feb11 0:815067fd66c9 46
feb11 0:815067fd66c9 47 #if __DEBUG__ >= 1
feb11 0:815067fd66c9 48 #define ERR(...) do{ debug(1, __MODULE__, __LINE__, __VA_ARGS__); }while(0)
feb11 0:815067fd66c9 49 #else
feb11 0:815067fd66c9 50 #define ERR(...) do{ }while(0)
feb11 0:815067fd66c9 51 #endif
feb11 0:815067fd66c9 52
feb11 0:815067fd66c9 53 #if __DEBUG__ >= 2
feb11 0:815067fd66c9 54 #define WARN(...) do{ debug(2, __MODULE__, __LINE__, __VA_ARGS__); }while(0)
feb11 0:815067fd66c9 55 #else
feb11 0:815067fd66c9 56 #define WARN(...) do{ }while(0)
feb11 0:815067fd66c9 57 #endif
feb11 0:815067fd66c9 58
feb11 0:815067fd66c9 59 #if __DEBUG__ >= 3
feb11 0:815067fd66c9 60 #define INFO(...) do{ debug(3, __MODULE__, __LINE__, __VA_ARGS__); }while(0)
feb11 0:815067fd66c9 61 #define CHECK(ret) do{ if(ret){ debug_error(__MODULE__, __LINE__, ret); } }while(0)
feb11 0:815067fd66c9 62 #else
feb11 0:815067fd66c9 63 #define INFO(...) do{ }while(0)
feb11 0:815067fd66c9 64 #define CHECK(ret) do{ }while(0)
feb11 0:815067fd66c9 65 #endif
feb11 0:815067fd66c9 66
feb11 0:815067fd66c9 67 #if __DEBUG__ >= 4
feb11 0:815067fd66c9 68 #define DBG(...) do{ debug(4, __MODULE__, __LINE__, __VA_ARGS__); }while(0)
feb11 0:815067fd66c9 69 #define DBGX(...) do{ debug_exact(__VA_ARGS__); }while(0)
feb11 0:815067fd66c9 70 #else
feb11 0:815067fd66c9 71 #define DBG(...) do{ }while(0)
feb11 0:815067fd66c9 72 #define DBGX(...) do{ }while(0)
feb11 0:815067fd66c9 73 #endif
feb11 0:815067fd66c9 74
feb11 0:815067fd66c9 75 #ifdef __cplusplus
feb11 0:815067fd66c9 76 }
feb11 0:815067fd66c9 77 #endif
feb11 0:815067fd66c9 78
feb11 0:815067fd66c9 79 #endif /* DBG_H_ */