Base library for cellular modem implementations

Dependencies:   Socket lwip-sys lwip

Dependents:   CellularUSBModem CellularUSBModem

Deprecated

This is an mbed 2 networking library. For mbed 5, the networking libraries have been revised to better support additional network stacks and thread safety here.

Committer:
mbed_official
Date:
Thu May 08 11:00:26 2014 +0100
Revision:
8:944cd194963e
Parent:
1:4a23efdf0da9
Synchronized with git revision df12bf01ac7dbb50751e2b16a351c894994e1dcf

Full URL: https://github.com/mbedmicro/mbed/commit/df12bf01ac7dbb50751e2b16a351c894994e1dcf/

Who changed what in which revision?

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