Example program with HTTPServer and sensor data streaming over TCPSockets, using Donatien Garnier's Net APIs and services code on top of LWIP. Files StreamServer.h and .cpp encapsulate streaming over TCPSockets. Broadcast is done by sendToAll(), and all incoming data is echoed back to the client. Echo code can be replaced with some remote control of the streaming interface. See main() that shows how to periodically send some data to all subscribed clients. To subscribe, a client should open a socket at <mbed_ip> port 123. I used few lines in TCL code to set up a quick sink for the data. HTTP files are served on port 80 concurrently to the streaming.
pppdebug.h
00001 /***************************************************************************** 00002 * pppdebug.h - System debugging utilities. 00003 * 00004 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 00005 * portions Copyright (c) 1998 Global Election Systems Inc. 00006 * portions Copyright (c) 2001 by Cognizant Pty Ltd. 00007 * 00008 * The authors hereby grant permission to use, copy, modify, distribute, 00009 * and license this software and its documentation for any purpose, provided 00010 * that existing copyright notices are retained in all copies and that this 00011 * notice and the following disclaimer are included verbatim in any 00012 * distributions. No written agreement, license, or royalty fee is required 00013 * for any of the authorized uses. 00014 * 00015 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 00016 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00017 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00018 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00019 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00020 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00021 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00022 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00023 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00024 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 * 00026 ****************************************************************************** 00027 * REVISION HISTORY (please don't use tabs!) 00028 * 00029 * 03-01-01 Marc Boucher <marc@mbsi.ca> 00030 * Ported to lwIP. 00031 * 98-07-29 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc. 00032 * Original. 00033 * 00034 ***************************************************************************** 00035 */ 00036 #ifndef PPPDEBUG_H 00037 #define PPPDEBUG_H 00038 00039 /* Trace levels. */ 00040 #define LOG_CRITICAL (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) 00041 #define LOG_ERR (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) 00042 #define LOG_NOTICE (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) 00043 #define LOG_WARNING (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) 00044 #define LOG_INFO (PPP_DEBUG) 00045 #define LOG_DETAIL (PPP_DEBUG) 00046 #define LOG_DEBUG (PPP_DEBUG) 00047 00048 00049 #define TRACELCP PPP_DEBUG 00050 00051 #if PPP_DEBUG 00052 00053 #define AUTHDEBUG(a, b) LWIP_DEBUGF(a, b) 00054 #define IPCPDEBUG(a, b) LWIP_DEBUGF(a, b) 00055 #define UPAPDEBUG(a, b) LWIP_DEBUGF(a, b) 00056 #define LCPDEBUG(a, b) LWIP_DEBUGF(a, b) 00057 #define FSMDEBUG(a, b) LWIP_DEBUGF(a, b) 00058 #define CHAPDEBUG(a, b) LWIP_DEBUGF(a, b) 00059 #define PPPDEBUG(a, b) LWIP_DEBUGF(a, b) 00060 00061 #else /* PPP_DEBUG */ 00062 00063 #define AUTHDEBUG(a, b) 00064 #define IPCPDEBUG(a, b) 00065 #define UPAPDEBUG(a, b) 00066 #define LCPDEBUG(a, b) 00067 #define FSMDEBUG(a, b) 00068 #define CHAPDEBUG(a, b) 00069 #define PPPDEBUG(a, b) 00070 00071 #endif /* PPP_DEBUG */ 00072 00073 #endif /* PPPDEBUG_H */
Generated on Tue Jul 12 2022 21:10:26 by 1.7.2