Quantum Leaps / Mbed 2 deprecated qp_lwip

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dpp.h Source File

dpp.h

00001 //////////////////////////////////////////////////////////////////////////////
00002 // Product: DPP example with lwIP
00003 // Last Updated for Version: 4.0.03
00004 // Date of the Last Update:  Mar 16, 2009
00005 //
00006 //                    Q u a n t u m     L e a P s
00007 //                    ---------------------------
00008 //                    innovating embedded systems
00009 //
00010 // Copyright (C) 2002-2009 Quantum Leaps, LLC. All rights reserved.
00011 //
00012 // This software may be distributed and modified under the terms of the GNU
00013 // General Public License version 2 (GPL) as published by the Free Software
00014 // Foundation and appearing in the file GPL.TXT included in the packaging of
00015 // this file. Please note that GPL Section 2[b] requires that all works based
00016 // on this software must also be made publicly available under the terms of
00017 // the GPL ("Copyleft").
00018 //
00019 // Alternatively, this software may be distributed and modified under the
00020 // terms of Quantum Leaps commercial licenses, which expressly supersede
00021 // the GPL and are specifically designed for licensees interested in
00022 // retaining the proprietary status of their code.
00023 //
00024 // Contact information:
00025 // Quantum Leaps Web site:  http://www.quantum-leaps.com
00026 // e-mail:                  info@quantum-leaps.com
00027 //////////////////////////////////////////////////////////////////////////////
00028 #ifndef dpp_h
00029 #define dpp_h
00030 
00031 enum DPPSignals {
00032    EAT_SIG = Q_USER_SIG,        // published by Table to let a philosopher eat
00033    DONE_SIG,                      // published by Philosopher when done eating
00034    BTN_DOWN_SIG,       // published by ISR_SysTick when user button is pressed
00035    BTN_UP_SIG,        // published by ISR_SysTick when user button is released
00036 
00037    DISPLAY_IPADDR_SIG,            // published by lwIPMgr to display IP addres
00038    DISPLAY_CGI_SIG,                // published by lwIPMgr to display CGI text
00039    DISPLAY_UDP_SIG,                // published by lwIPMgr to display UDP text
00040    TERMINATE_SIG,             // published by BSP to terminate the application
00041    MAX_PUB_SIG,                                   // the last published signal
00042 
00043    HUNGRY_SIG,             // posted direclty to Table from hungry Philosopher
00044    SEND_UDP_SIG,            // posted directly to lwIPMgr to send text via UDP
00045    MAX_SIG                                                  // the last signal
00046 };
00047 
00048 struct TableEvt : public QEvent {
00049     uint8_t philoNum;                                    // philosopher number
00050 };
00051 
00052 #define MAX_TEXT_LEN 16
00053 struct TextEvt : public QEvent {
00054     char text[MAX_TEXT_LEN];                                // text to deliver
00055 };
00056 
00057                                                      // number of philosophers
00058 #define N_PHILO 5
00059 
00060 extern QActive * const AO_Philo[N_PHILO];    // "opaque" pointers to Philo  AO
00061 extern QActive * const AO_Table;             // "opaque" pointer to Table   AO
00062 extern QActive * const AO_LwIPMgr;           // "opaque" pointer to LwIPMgr AO
00063 
00064 #ifdef Q_SPY
00065     enum AppRecords {                    // application-specific trace records
00066         PHILO_STAT = QS_USER,             // traced by Philo to display status
00067         LWIP_SLOW_TICK,                // traced by lwIPMgr for each slow tick 
00068         LWIP_IPADDR,                 // traced by lwIPMgr to display IP addres
00069         LWIP_CGI,                     // traced by lwIPMgr to display CGI text
00070         LWIP_RECV_UDP,                 // traced by lwIPMgr when receiving UDP
00071         LWIP_SEND_UDP,                   // traced by lwIPMgr when sending UDP
00072     };
00073 #endif
00074 
00075 #endif                                                                // dpp_h