Simple LED control project using CC3100 as Access Point and socket

Dependencies:   mbed

Fork of cc3100_Test_Demo by David Fletcher

Committer:
ArcN00b
Date:
Wed May 31 17:03:57 2017 +0000
Revision:
13:0b58d32f9290
Parent:
11:43bc5ac03428
Pulizia codice

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dflet 6:778b081f6a13 1 /*
dflet 6:778b081f6a13 2 * sl_config.h - get time sample application
dflet 6:778b081f6a13 3 *
dflet 6:778b081f6a13 4 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
dflet 6:778b081f6a13 5 *
dflet 6:778b081f6a13 6 *
dflet 6:778b081f6a13 7 * Redistribution and use in source and binary forms, with or without
dflet 6:778b081f6a13 8 * modification, are permitted provided that the following conditions
dflet 6:778b081f6a13 9 * are met:
dflet 6:778b081f6a13 10 *
dflet 6:778b081f6a13 11 * Redistributions of source code must retain the above copyright
dflet 6:778b081f6a13 12 * notice, this list of conditions and the following disclaimer.
dflet 6:778b081f6a13 13 *
dflet 6:778b081f6a13 14 * Redistributions in binary form must reproduce the above copyright
dflet 6:778b081f6a13 15 * notice, this list of conditions and the following disclaimer in the
dflet 6:778b081f6a13 16 * documentation and/or other materials provided with the
dflet 6:778b081f6a13 17 * distribution.
dflet 6:778b081f6a13 18 *
dflet 6:778b081f6a13 19 * Neither the name of Texas Instruments Incorporated nor the names of
dflet 6:778b081f6a13 20 * its contributors may be used to endorse or promote products derived
dflet 6:778b081f6a13 21 * from this software without specific prior written permission.
dflet 6:778b081f6a13 22 *
dflet 6:778b081f6a13 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dflet 6:778b081f6a13 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dflet 6:778b081f6a13 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dflet 6:778b081f6a13 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dflet 6:778b081f6a13 27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dflet 6:778b081f6a13 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dflet 6:778b081f6a13 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
dflet 6:778b081f6a13 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
dflet 6:778b081f6a13 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
dflet 6:778b081f6a13 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
dflet 6:778b081f6a13 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dflet 6:778b081f6a13 34 *
dflet 6:778b081f6a13 35 */
dflet 6:778b081f6a13 36
dflet 6:778b081f6a13 37 #ifndef SL_CONFIG_H_
dflet 6:778b081f6a13 38 #define SL_CONFIG_H_
dflet 6:778b081f6a13 39
dflet 6:778b081f6a13 40 //*****************************************************************************
dflet 6:778b081f6a13 41 //
dflet 6:778b081f6a13 42 // If building with a C++ compiler, make all of the definitions in this header
dflet 6:778b081f6a13 43 // have a C binding.
dflet 6:778b081f6a13 44 //
dflet 6:778b081f6a13 45 //*****************************************************************************
dflet 6:778b081f6a13 46
dflet 6:778b081f6a13 47 /**/
dflet 6:778b081f6a13 48
dflet 6:778b081f6a13 49 namespace mbed_cc3100 {
dflet 6:778b081f6a13 50
dflet 6:778b081f6a13 51 #define LOOP_FOREVER() \
dflet 6:778b081f6a13 52 {\
dflet 6:778b081f6a13 53 while(1); \
dflet 6:778b081f6a13 54 }
dflet 6:778b081f6a13 55
dflet 6:778b081f6a13 56 #define ASSERT_ON_ERROR(error_code) \
dflet 6:778b081f6a13 57 {\
dflet 6:778b081f6a13 58 /* Handling the error-codes is specific to the application */ \
dflet 6:778b081f6a13 59 if (error_code < 0) return error_code; \
dflet 6:778b081f6a13 60 /* else, continue w/ execution */ \
dflet 6:778b081f6a13 61 }
dflet 6:778b081f6a13 62
dflet 6:778b081f6a13 63
dflet 6:778b081f6a13 64 /*
dflet 6:778b081f6a13 65 * Values for below macros shall be modified per the access-point's (AP) properties
dflet 6:778b081f6a13 66 * SimpleLink device will connect to following AP when the application is executed
dflet 6:778b081f6a13 67 */
ArcN00b 10:d24deb1afd1b 68 #define SSID_NAME "eduroam"
dflet 7:0687d16b9781 69 //#define SSID_NAME "OpenWrt" /* Access point name to connect to. */
ArcN00b 10:d24deb1afd1b 70 #define SEC_TYPE SL_SEC_TYPE_WPA_ENT /* Security type of the Access point */
ArcN00b 11:43bc5ac03428 71 #define PASSKEY ""
dflet 7:0687d16b9781 72 //#define PASSKEY "**********" /* Password in case of secure AP */
dflet 6:778b081f6a13 73 #define PASSKEY_LEN strlen(PASSKEY) /* Password length in case of secure AP */
ArcN00b 11:43bc5ac03428 74 #define EAP_USER_NAME ""
ArcN00b 11:43bc5ac03428 75 #define EAP_ANON_USER ""
ArcN00b 11:43bc5ac03428 76 #define EAP_SEC_METHOD SL_ENT_EAP_METHOD_TTLS_MSCHAPv2
dflet 6:778b081f6a13 77
dflet 6:778b081f6a13 78 /* Configuration of the device when it comes up in AP mode */
ArcN00b 9:30d6c10d4eab 79 #define SSID_AP_MODE "cc3100" /* SSID of the CC3100 in AP mode */
dflet 6:778b081f6a13 80 #define PASSWORD_AP_MODE "" /* Password of CC3100 AP */
dflet 6:778b081f6a13 81 #define SEC_TYPE_AP_MODE SL_SEC_TYPE_OPEN /* Can take SL_SEC_TYPE_WEP or
dflet 6:778b081f6a13 82 * SL_SEC_TYPE_WPA as well */
dflet 6:778b081f6a13 83
dflet 6:778b081f6a13 84 /*
dflet 6:778b081f6a13 85 * Values for below macros shall be modified based on current time
dflet 6:778b081f6a13 86 */
ArcN00b 8:2acb25effa3a 87 #define DATE 25 /* Current Date */
ArcN00b 8:2acb25effa3a 88 #define MONTH 5 /* Month */
ArcN00b 8:2acb25effa3a 89 #define YEAR 2017 /* Current year */
dflet 6:778b081f6a13 90 #define HOUR 10 /* Time - hours */
dflet 6:778b081f6a13 91 #define MINUTE 34 /* Time - minutes */
dflet 6:778b081f6a13 92 #define SECOND 0 /* Time - seconds */
dflet 6:778b081f6a13 93
dflet 6:778b081f6a13 94 #define SUCCESS 0
dflet 6:778b081f6a13 95
dflet 6:778b081f6a13 96 }//namespace mbed_cc3100
dflet 6:778b081f6a13 97
dflet 6:778b081f6a13 98 #endif /*__SL_CONFIG_H__*/
dflet 6:778b081f6a13 99