cc3000 hostdriver with the mbed socket interface

Dependents:   cc3000_hello_world_demo cc3000_simple_socket_demo cc3000_ntp_demo cc3000_ping_demo ... more

Committer:
SolderSplashLabs
Date:
Thu Oct 03 21:00:00 2013 +0000
Revision:
23:fed7f64dd520
Parent:
0:615c697c33b0
Added separate debug messages and VT100 formatting

Who changed what in which revision?

UserRevisionLine numberNew contents of line
SolderSplashLabs 23:fed7f64dd520 1 /*****************************************************************************
SolderSplashLabs 23:fed7f64dd520 2 *
SolderSplashLabs 23:fed7f64dd520 3 * C++ interface/implementation created by Martin Kojtal (0xc0170). Thanks to
SolderSplashLabs 23:fed7f64dd520 4 * Jim Carver and Frank Vannieuwkerke for their inital cc3000 mbed port and
SolderSplashLabs 23:fed7f64dd520 5 * provided help.
SolderSplashLabs 23:fed7f64dd520 6 *
SolderSplashLabs 23:fed7f64dd520 7 * This version of "host driver" uses CC3000 Host Driver Implementation. Thus
SolderSplashLabs 23:fed7f64dd520 8 * read the following copyright:
SolderSplashLabs 23:fed7f64dd520 9 *
SolderSplashLabs 23:fed7f64dd520 10 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
SolderSplashLabs 23:fed7f64dd520 11 *
SolderSplashLabs 23:fed7f64dd520 12 * Redistribution and use in source and binary forms, with or without
SolderSplashLabs 23:fed7f64dd520 13 * modification, are permitted provided that the following conditions
SolderSplashLabs 23:fed7f64dd520 14 * are met:
SolderSplashLabs 23:fed7f64dd520 15 *
SolderSplashLabs 23:fed7f64dd520 16 * Redistributions of source code must retain the above copyright
SolderSplashLabs 23:fed7f64dd520 17 * notice, this list of conditions and the following disclaimer.
SolderSplashLabs 23:fed7f64dd520 18 *
SolderSplashLabs 23:fed7f64dd520 19 * Redistributions in binary form must reproduce the above copyright
SolderSplashLabs 23:fed7f64dd520 20 * notice, this list of conditions and the following disclaimer in the
SolderSplashLabs 23:fed7f64dd520 21 * documentation and/or other materials provided with the
SolderSplashLabs 23:fed7f64dd520 22 * distribution.
SolderSplashLabs 23:fed7f64dd520 23 *
SolderSplashLabs 23:fed7f64dd520 24 * Neither the name of Texas Instruments Incorporated nor the names of
SolderSplashLabs 23:fed7f64dd520 25 * its contributors may be used to endorse or promote products derived
SolderSplashLabs 23:fed7f64dd520 26 * from this software without specific prior written permission.
SolderSplashLabs 23:fed7f64dd520 27 *
SolderSplashLabs 23:fed7f64dd520 28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
SolderSplashLabs 23:fed7f64dd520 29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
SolderSplashLabs 23:fed7f64dd520 30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
SolderSplashLabs 23:fed7f64dd520 31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
SolderSplashLabs 23:fed7f64dd520 32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SolderSplashLabs 23:fed7f64dd520 33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
SolderSplashLabs 23:fed7f64dd520 34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
SolderSplashLabs 23:fed7f64dd520 35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
SolderSplashLabs 23:fed7f64dd520 36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SolderSplashLabs 23:fed7f64dd520 37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
SolderSplashLabs 23:fed7f64dd520 38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SolderSplashLabs 23:fed7f64dd520 39 *
SolderSplashLabs 23:fed7f64dd520 40 *****************************************************************************/
SolderSplashLabs 23:fed7f64dd520 41 #ifndef CC3000_NETAPP_H
SolderSplashLabs 23:fed7f64dd520 42 #define CC3000_NETAPP_H
SolderSplashLabs 23:fed7f64dd520 43
SolderSplashLabs 23:fed7f64dd520 44 #define MIN_TIMER_VAL_SECONDS 20
SolderSplashLabs 23:fed7f64dd520 45 #define MIN_TIMER_SET(t) if ((0 != t) && (t < MIN_TIMER_VAL_SECONDS)) \
SolderSplashLabs 23:fed7f64dd520 46 { \
SolderSplashLabs 23:fed7f64dd520 47 t = MIN_TIMER_VAL_SECONDS; \
SolderSplashLabs 23:fed7f64dd520 48 }
SolderSplashLabs 23:fed7f64dd520 49
SolderSplashLabs 23:fed7f64dd520 50
SolderSplashLabs 23:fed7f64dd520 51 #define NETAPP_DHCP_PARAMS_LEN (20)
SolderSplashLabs 23:fed7f64dd520 52 #define NETAPP_SET_TIMER_PARAMS_LEN (20)
SolderSplashLabs 23:fed7f64dd520 53 #define NETAPP_SET_DEBUG_LEVEL_PARAMS_LEN (4)
SolderSplashLabs 23:fed7f64dd520 54 #define NETAPP_PING_SEND_PARAMS_LEN (16)
SolderSplashLabs 23:fed7f64dd520 55
SolderSplashLabs 23:fed7f64dd520 56
SolderSplashLabs 23:fed7f64dd520 57 typedef struct _netapp_dhcp_ret_args_t
SolderSplashLabs 23:fed7f64dd520 58 {
SolderSplashLabs 23:fed7f64dd520 59 uint8_t aucIP[4];
SolderSplashLabs 23:fed7f64dd520 60 uint8_t aucSubnetMask[4];
SolderSplashLabs 23:fed7f64dd520 61 uint8_t aucDefaultGateway[4];
SolderSplashLabs 23:fed7f64dd520 62 uint8_t aucDHCPServer[4];
SolderSplashLabs 23:fed7f64dd520 63 uint8_t aucDNSServer[4];
SolderSplashLabs 23:fed7f64dd520 64 }tNetappDhcpParams;
SolderSplashLabs 23:fed7f64dd520 65
SolderSplashLabs 23:fed7f64dd520 66 typedef struct _netapp_ipconfig_ret_args_t
SolderSplashLabs 23:fed7f64dd520 67 {
SolderSplashLabs 23:fed7f64dd520 68 uint8_t aucIP[4];
SolderSplashLabs 23:fed7f64dd520 69 uint8_t aucSubnetMask[4];
SolderSplashLabs 23:fed7f64dd520 70 uint8_t aucDefaultGateway[4];
SolderSplashLabs 23:fed7f64dd520 71 uint8_t aucDHCPServer[4];
SolderSplashLabs 23:fed7f64dd520 72 uint8_t aucDNSServer[4];
SolderSplashLabs 23:fed7f64dd520 73 uint8_t uaMacAddr[6];
SolderSplashLabs 23:fed7f64dd520 74 uint8_t uaSSID[32];
SolderSplashLabs 23:fed7f64dd520 75 }tNetappIpconfigRetArgs;
SolderSplashLabs 23:fed7f64dd520 76
SolderSplashLabs 23:fed7f64dd520 77
SolderSplashLabs 23:fed7f64dd520 78 /*Ping send report parameters*/
SolderSplashLabs 23:fed7f64dd520 79 typedef struct _netapp_pingreport_args
SolderSplashLabs 23:fed7f64dd520 80 {
SolderSplashLabs 23:fed7f64dd520 81 uint32_t packets_sent;
SolderSplashLabs 23:fed7f64dd520 82 uint32_t packets_received;
SolderSplashLabs 23:fed7f64dd520 83 uint32_t min_round_time;
SolderSplashLabs 23:fed7f64dd520 84 uint32_t max_round_time;
SolderSplashLabs 23:fed7f64dd520 85 uint32_t avg_round_time;
SolderSplashLabs 23:fed7f64dd520 86 } netapp_pingreport_args_t;
SolderSplashLabs 23:fed7f64dd520 87
SolderSplashLabs 23:fed7f64dd520 88 #endif