
Contains example code to connect the mbed LPC1768 or FRDM-K64F devices to the IBM Internet of Things Cloud service via ethernet.
Dependencies: C12832 MQTT LM75B MMA7660
Dependents: MFT_IoT_demo_USB400 IBM_RFID
MQTT/MQTTPacket/StackTrace.h@6:37b6d0d56190, 2014-08-20 (annotated)
- Committer:
- samdanbury
- Date:
- Wed Aug 20 12:45:14 2014 +0000
- Revision:
- 6:37b6d0d56190
Code completely changed to improve the structure, flow and memory usage of the application
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
samdanbury | 6:37b6d0d56190 | 1 | /******************************************************************************* |
samdanbury | 6:37b6d0d56190 | 2 | * Copyright (c) 2014 IBM Corp. |
samdanbury | 6:37b6d0d56190 | 3 | * |
samdanbury | 6:37b6d0d56190 | 4 | * All rights reserved. This program and the accompanying materials |
samdanbury | 6:37b6d0d56190 | 5 | * are made available under the terms of the Eclipse Public License v1.0 |
samdanbury | 6:37b6d0d56190 | 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. |
samdanbury | 6:37b6d0d56190 | 7 | * |
samdanbury | 6:37b6d0d56190 | 8 | * The Eclipse Public License is available at |
samdanbury | 6:37b6d0d56190 | 9 | * http://www.eclipse.org/legal/epl-v10.html |
samdanbury | 6:37b6d0d56190 | 10 | * and the Eclipse Distribution License is available at |
samdanbury | 6:37b6d0d56190 | 11 | * http://www.eclipse.org/org/documents/edl-v10.php. |
samdanbury | 6:37b6d0d56190 | 12 | * |
samdanbury | 6:37b6d0d56190 | 13 | * Contributors: |
samdanbury | 6:37b6d0d56190 | 14 | * Ian Craggs - initial API and implementation and/or initial documentation |
samdanbury | 6:37b6d0d56190 | 15 | * Ian Craggs - fix for bug #434081 |
samdanbury | 6:37b6d0d56190 | 16 | *******************************************************************************/ |
samdanbury | 6:37b6d0d56190 | 17 | |
samdanbury | 6:37b6d0d56190 | 18 | #ifndef STACKTRACE_H_ |
samdanbury | 6:37b6d0d56190 | 19 | #define STACKTRACE_H_ |
samdanbury | 6:37b6d0d56190 | 20 | |
samdanbury | 6:37b6d0d56190 | 21 | #include <stdio.h> |
samdanbury | 6:37b6d0d56190 | 22 | #define NOSTACKTRACE 1 |
samdanbury | 6:37b6d0d56190 | 23 | |
samdanbury | 6:37b6d0d56190 | 24 | #if defined(NOSTACKTRACE) |
samdanbury | 6:37b6d0d56190 | 25 | #define FUNC_ENTRY |
samdanbury | 6:37b6d0d56190 | 26 | #define FUNC_ENTRY_NOLOG |
samdanbury | 6:37b6d0d56190 | 27 | #define FUNC_ENTRY_MED |
samdanbury | 6:37b6d0d56190 | 28 | #define FUNC_ENTRY_MAX |
samdanbury | 6:37b6d0d56190 | 29 | #define FUNC_EXIT |
samdanbury | 6:37b6d0d56190 | 30 | #define FUNC_EXIT_NOLOG |
samdanbury | 6:37b6d0d56190 | 31 | #define FUNC_EXIT_MED |
samdanbury | 6:37b6d0d56190 | 32 | #define FUNC_EXIT_MAX |
samdanbury | 6:37b6d0d56190 | 33 | #define FUNC_EXIT_RC(x) |
samdanbury | 6:37b6d0d56190 | 34 | #define FUNC_EXIT_MED_RC(x) |
samdanbury | 6:37b6d0d56190 | 35 | #define FUNC_EXIT_MAX_RC(x) |
samdanbury | 6:37b6d0d56190 | 36 | |
samdanbury | 6:37b6d0d56190 | 37 | #else |
samdanbury | 6:37b6d0d56190 | 38 | |
samdanbury | 6:37b6d0d56190 | 39 | #if defined(WIN32) |
samdanbury | 6:37b6d0d56190 | 40 | #define inline __inline |
samdanbury | 6:37b6d0d56190 | 41 | #define FUNC_ENTRY StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MINIMUM) |
samdanbury | 6:37b6d0d56190 | 42 | #define FUNC_ENTRY_NOLOG StackTrace_entry(__FUNCTION__, __LINE__, -1) |
samdanbury | 6:37b6d0d56190 | 43 | #define FUNC_ENTRY_MED StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MEDIUM) |
samdanbury | 6:37b6d0d56190 | 44 | #define FUNC_ENTRY_MAX StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MAXIMUM) |
samdanbury | 6:37b6d0d56190 | 45 | #define FUNC_EXIT StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MINIMUM) |
samdanbury | 6:37b6d0d56190 | 46 | #define FUNC_EXIT_NOLOG StackTrace_exit(__FUNCTION__, __LINE__, -1) |
samdanbury | 6:37b6d0d56190 | 47 | #define FUNC_EXIT_MED StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MEDIUM) |
samdanbury | 6:37b6d0d56190 | 48 | #define FUNC_EXIT_MAX StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MAXIMUM) |
samdanbury | 6:37b6d0d56190 | 49 | #define FUNC_EXIT_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MINIMUM) |
samdanbury | 6:37b6d0d56190 | 50 | #define FUNC_EXIT_MED_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MEDIUM) |
samdanbury | 6:37b6d0d56190 | 51 | #define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MAXIMUM) |
samdanbury | 6:37b6d0d56190 | 52 | #else |
samdanbury | 6:37b6d0d56190 | 53 | #define FUNC_ENTRY StackTrace_entry(__func__, __LINE__, TRACE_MINIMUM) |
samdanbury | 6:37b6d0d56190 | 54 | #define FUNC_ENTRY_NOLOG StackTrace_entry(__func__, __LINE__, -1) |
samdanbury | 6:37b6d0d56190 | 55 | #define FUNC_ENTRY_MED StackTrace_entry(__func__, __LINE__, TRACE_MEDIUM) |
samdanbury | 6:37b6d0d56190 | 56 | #define FUNC_ENTRY_MAX StackTrace_entry(__func__, __LINE__, TRACE_MAXIMUM) |
samdanbury | 6:37b6d0d56190 | 57 | #define FUNC_EXIT StackTrace_exit(__func__, __LINE__, NULL, TRACE_MINIMUM) |
samdanbury | 6:37b6d0d56190 | 58 | #define FUNC_EXIT_NOLOG StackTrace_exit(__func__, __LINE__, NULL, -1) |
samdanbury | 6:37b6d0d56190 | 59 | #define FUNC_EXIT_MED StackTrace_exit(__func__, __LINE__, NULL, TRACE_MEDIUM) |
samdanbury | 6:37b6d0d56190 | 60 | #define FUNC_EXIT_MAX StackTrace_exit(__func__, __LINE__, NULL, TRACE_MAXIMUM) |
samdanbury | 6:37b6d0d56190 | 61 | #define FUNC_EXIT_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MINIMUM) |
samdanbury | 6:37b6d0d56190 | 62 | #define FUNC_EXIT_MED_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MEDIUM) |
samdanbury | 6:37b6d0d56190 | 63 | #define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MAXIMUM) |
samdanbury | 6:37b6d0d56190 | 64 | |
samdanbury | 6:37b6d0d56190 | 65 | void StackTrace_entry(const char* name, int line, int trace); |
samdanbury | 6:37b6d0d56190 | 66 | void StackTrace_exit(const char* name, int line, void* return_value, int trace); |
samdanbury | 6:37b6d0d56190 | 67 | |
samdanbury | 6:37b6d0d56190 | 68 | void StackTrace_printStack(FILE* dest); |
samdanbury | 6:37b6d0d56190 | 69 | char* StackTrace_get(unsigned long); |
samdanbury | 6:37b6d0d56190 | 70 | |
samdanbury | 6:37b6d0d56190 | 71 | #endif |
samdanbury | 6:37b6d0d56190 | 72 | |
samdanbury | 6:37b6d0d56190 | 73 | #endif |
samdanbury | 6:37b6d0d56190 | 74 | |
samdanbury | 6:37b6d0d56190 | 75 | |
samdanbury | 6:37b6d0d56190 | 76 | |
samdanbury | 6:37b6d0d56190 | 77 | |
samdanbury | 6:37b6d0d56190 | 78 | #endif /* STACKTRACE_H_ */ |