David Fletcher
/
CC3000WebServer
A Port of TI's Webserver for the CC3000
WebServer/cc3000.h@0:6ad60d78b315, 2013-09-14 (annotated)
- Committer:
- dflet
- Date:
- Sat Sep 14 17:38:41 2013 +0000
- Revision:
- 0:6ad60d78b315
Mostly working will serve the default pages index.html and config.html, but config.html is not woring at present.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dflet | 0:6ad60d78b315 | 1 | /***************************************************************************** |
dflet | 0:6ad60d78b315 | 2 | * |
dflet | 0:6ad60d78b315 | 3 | * cc3000.h - CC3000 Function Definitions |
dflet | 0:6ad60d78b315 | 4 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
dflet | 0:6ad60d78b315 | 5 | * |
dflet | 0:6ad60d78b315 | 6 | * Redistribution and use in source and binary forms, with or without |
dflet | 0:6ad60d78b315 | 7 | * modification, are permitted provided that the following conditions |
dflet | 0:6ad60d78b315 | 8 | * are met: |
dflet | 0:6ad60d78b315 | 9 | * |
dflet | 0:6ad60d78b315 | 10 | * Redistributions of source code must retain the above copyright |
dflet | 0:6ad60d78b315 | 11 | * notice, this list of conditions and the following disclaimer. |
dflet | 0:6ad60d78b315 | 12 | * |
dflet | 0:6ad60d78b315 | 13 | * Redistributions in binary form must reproduce the above copyright |
dflet | 0:6ad60d78b315 | 14 | * notice, this list of conditions and the following disclaimer in the |
dflet | 0:6ad60d78b315 | 15 | * documentation and/or other materials provided with the |
dflet | 0:6ad60d78b315 | 16 | * distribution. |
dflet | 0:6ad60d78b315 | 17 | * |
dflet | 0:6ad60d78b315 | 18 | * Neither the name of Texas Instruments Incorporated nor the names of |
dflet | 0:6ad60d78b315 | 19 | * its contributors may be used to endorse or promote products derived |
dflet | 0:6ad60d78b315 | 20 | * from this software without specific prior written permission. |
dflet | 0:6ad60d78b315 | 21 | * |
dflet | 0:6ad60d78b315 | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
dflet | 0:6ad60d78b315 | 23 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
dflet | 0:6ad60d78b315 | 24 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
dflet | 0:6ad60d78b315 | 25 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
dflet | 0:6ad60d78b315 | 26 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
dflet | 0:6ad60d78b315 | 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
dflet | 0:6ad60d78b315 | 28 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
dflet | 0:6ad60d78b315 | 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
dflet | 0:6ad60d78b315 | 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
dflet | 0:6ad60d78b315 | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
dflet | 0:6ad60d78b315 | 32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
dflet | 0:6ad60d78b315 | 33 | * |
dflet | 0:6ad60d78b315 | 34 | *****************************************************************************/ |
dflet | 0:6ad60d78b315 | 35 | |
dflet | 0:6ad60d78b315 | 36 | #ifndef CC3000_H |
dflet | 0:6ad60d78b315 | 37 | #define CC3000_H |
dflet | 0:6ad60d78b315 | 38 | |
dflet | 0:6ad60d78b315 | 39 | #include "netapp.h" |
dflet | 0:6ad60d78b315 | 40 | |
dflet | 0:6ad60d78b315 | 41 | |
dflet | 0:6ad60d78b315 | 42 | #define NUM_STATES 6 |
dflet | 0:6ad60d78b315 | 43 | #define FIRST_STATE_LED_NUM 1 |
dflet | 0:6ad60d78b315 | 44 | #define MAX_SSID_LEN 32 |
dflet | 0:6ad60d78b315 | 45 | |
dflet | 0:6ad60d78b315 | 46 | // CC3000 State Machine Definitions |
dflet | 0:6ad60d78b315 | 47 | enum cc3000StateEnum |
dflet | 0:6ad60d78b315 | 48 | { |
dflet | 0:6ad60d78b315 | 49 | CC3000_UNINIT = 0x01, // CC3000 Driver Uninitialized |
dflet | 0:6ad60d78b315 | 50 | CC3000_INIT = 0x02, // CC3000 Driver Initialized |
dflet | 0:6ad60d78b315 | 51 | CC3000_ASSOC = 0x04, // CC3000 Associated to AP |
dflet | 0:6ad60d78b315 | 52 | CC3000_IP_ALLOC = 0x08, // CC3000 has IP Address |
dflet | 0:6ad60d78b315 | 53 | CC3000_SERVER_INIT = 0x10, // CC3000 Server Initialized |
dflet | 0:6ad60d78b315 | 54 | }; |
dflet | 0:6ad60d78b315 | 55 | |
dflet | 0:6ad60d78b315 | 56 | |
dflet | 0:6ad60d78b315 | 57 | |
dflet | 0:6ad60d78b315 | 58 | int ConnectUsingSSID(char * ssidName); |
dflet | 0:6ad60d78b315 | 59 | void setupLocalSocket(void); |
dflet | 0:6ad60d78b315 | 60 | void ConnectToServer(void); |
dflet | 0:6ad60d78b315 | 61 | void ConnectToServer(void); |
dflet | 0:6ad60d78b315 | 62 | |
dflet | 0:6ad60d78b315 | 63 | |
dflet | 0:6ad60d78b315 | 64 | char *sendDriverPatch(unsigned long *Length); |
dflet | 0:6ad60d78b315 | 65 | char *sendBootLoaderPatch(unsigned long *Length); |
dflet | 0:6ad60d78b315 | 66 | char *sendWLFWPatch(unsigned long *Length); |
dflet | 0:6ad60d78b315 | 67 | |
dflet | 0:6ad60d78b315 | 68 | void CC3000_UsynchCallback(long lEventType, char * data, unsigned char length); |
dflet | 0:6ad60d78b315 | 69 | |
dflet | 0:6ad60d78b315 | 70 | int initDriver(void); |
dflet | 0:6ad60d78b315 | 71 | void StartSmartConfig(void); |
dflet | 0:6ad60d78b315 | 72 | void closeLocalSocket(void); |
dflet | 0:6ad60d78b315 | 73 | void disconnectAll(); |
dflet | 0:6ad60d78b315 | 74 | |
dflet | 0:6ad60d78b315 | 75 | char isFTCSet(); |
dflet | 0:6ad60d78b315 | 76 | void setFTCFlag(); |
dflet | 0:6ad60d78b315 | 77 | |
dflet | 0:6ad60d78b315 | 78 | |
dflet | 0:6ad60d78b315 | 79 | // Machine State |
dflet | 0:6ad60d78b315 | 80 | char currentCC3000State(); |
dflet | 0:6ad60d78b315 | 81 | void setCC3000MachineState(char stat); |
dflet | 0:6ad60d78b315 | 82 | void unsetCC3000MachineState(char stat); |
dflet | 0:6ad60d78b315 | 83 | void resetCC3000StateMachine(); |
dflet | 0:6ad60d78b315 | 84 | char highestCC3000State(); |
dflet | 0:6ad60d78b315 | 85 | //static void StartUnsolicitedEventTimer(void); |
dflet | 0:6ad60d78b315 | 86 | static void DemoInitSpi(void); |
dflet | 0:6ad60d78b315 | 87 | |
dflet | 0:6ad60d78b315 | 88 | tNetappIpconfigRetArgs * getCC3000Info(); |
dflet | 0:6ad60d78b315 | 89 | |
dflet | 0:6ad60d78b315 | 90 | #endif |
dflet | 0:6ad60d78b315 | 91 |