Update revision to use TI's mqtt and Freertos.

Dependencies:   mbed client server

Fork of cc3100_Test_mqtt_CM3 by David Fletcher

Committer:
dflet
Date:
Thu Sep 03 14:02:37 2015 +0000
Revision:
3:a8c249046181
SPI Mode change 1 to 0

Who changed what in which revision?

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