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.

Dependencies:   mbed

Committer:
iva2k
Date:
Sat Jun 12 06:01:50 2010 +0000
Revision:
0:e614f7875b60

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
iva2k 0:e614f7875b60 1 /*****************************************************************************
iva2k 0:e614f7875b60 2 * chpms.h - Network Microsoft Challenge Handshake Protocol header file.
iva2k 0:e614f7875b60 3 *
iva2k 0:e614f7875b60 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
iva2k 0:e614f7875b60 5 * portions Copyright (c) 1998 Global Election Systems Inc.
iva2k 0:e614f7875b60 6 *
iva2k 0:e614f7875b60 7 * The authors hereby grant permission to use, copy, modify, distribute,
iva2k 0:e614f7875b60 8 * and license this software and its documentation for any purpose, provided
iva2k 0:e614f7875b60 9 * that existing copyright notices are retained in all copies and that this
iva2k 0:e614f7875b60 10 * notice and the following disclaimer are included verbatim in any
iva2k 0:e614f7875b60 11 * distributions. No written agreement, license, or royalty fee is required
iva2k 0:e614f7875b60 12 * for any of the authorized uses.
iva2k 0:e614f7875b60 13 *
iva2k 0:e614f7875b60 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
iva2k 0:e614f7875b60 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
iva2k 0:e614f7875b60 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
iva2k 0:e614f7875b60 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
iva2k 0:e614f7875b60 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
iva2k 0:e614f7875b60 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
iva2k 0:e614f7875b60 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
iva2k 0:e614f7875b60 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
iva2k 0:e614f7875b60 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
iva2k 0:e614f7875b60 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
iva2k 0:e614f7875b60 24 *
iva2k 0:e614f7875b60 25 ******************************************************************************
iva2k 0:e614f7875b60 26 * REVISION HISTORY
iva2k 0:e614f7875b60 27 *
iva2k 0:e614f7875b60 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
iva2k 0:e614f7875b60 29 * Ported to lwIP.
iva2k 0:e614f7875b60 30 * 98-01-30 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc.
iva2k 0:e614f7875b60 31 * Original built from BSD network code.
iva2k 0:e614f7875b60 32 ******************************************************************************/
iva2k 0:e614f7875b60 33 /*
iva2k 0:e614f7875b60 34 * chap.h - Challenge Handshake Authentication Protocol definitions.
iva2k 0:e614f7875b60 35 *
iva2k 0:e614f7875b60 36 * Copyright (c) 1995 Eric Rosenquist, Strata Software Limited.
iva2k 0:e614f7875b60 37 * http://www.strataware.com/
iva2k 0:e614f7875b60 38 *
iva2k 0:e614f7875b60 39 * All rights reserved.
iva2k 0:e614f7875b60 40 *
iva2k 0:e614f7875b60 41 * Redistribution and use in source and binary forms are permitted
iva2k 0:e614f7875b60 42 * provided that the above copyright notice and this paragraph are
iva2k 0:e614f7875b60 43 * duplicated in all such forms and that any documentation,
iva2k 0:e614f7875b60 44 * advertising materials, and other materials related to such
iva2k 0:e614f7875b60 45 * distribution and use acknowledge that the software was developed
iva2k 0:e614f7875b60 46 * by Eric Rosenquist. The name of the author may not be used to
iva2k 0:e614f7875b60 47 * endorse or promote products derived from this software without
iva2k 0:e614f7875b60 48 * specific prior written permission.
iva2k 0:e614f7875b60 49 *
iva2k 0:e614f7875b60 50 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
iva2k 0:e614f7875b60 51 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
iva2k 0:e614f7875b60 52 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
iva2k 0:e614f7875b60 53 *
iva2k 0:e614f7875b60 54 * $Id: chpms.h,v 1.5 2007/12/19 20:47:23 fbernon Exp $
iva2k 0:e614f7875b60 55 */
iva2k 0:e614f7875b60 56
iva2k 0:e614f7875b60 57 #ifndef CHPMS_H
iva2k 0:e614f7875b60 58 #define CHPMS_H
iva2k 0:e614f7875b60 59
iva2k 0:e614f7875b60 60 #define MAX_NT_PASSWORD 256 /* Maximum number of (Unicode) chars in an NT password */
iva2k 0:e614f7875b60 61
iva2k 0:e614f7875b60 62 void ChapMS (chap_state *, char *, int, char *, int);
iva2k 0:e614f7875b60 63
iva2k 0:e614f7875b60 64 #endif /* CHPMS_H */