Update revision to use TI's mqtt and Freertos.

Dependencies:   mbed client server

Fork of cc3100_Test_mqtt_CM3 by David Fletcher

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers cc3100_sl_common.h Source File

cc3100_sl_common.h

00001 /*
00002  * sl_config.h - get time sample application
00003  *
00004  * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
00005  *
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *    Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  *
00014  *    Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in the
00016  *    documentation and/or other materials provided with the
00017  *    distribution.
00018  *
00019  *    Neither the name of Texas Instruments Incorporated nor the names of
00020  *    its contributors may be used to endorse or promote products derived
00021  *    from this software without specific prior written permission.
00022  *
00023  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00024  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00025  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00026  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00027  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00028  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00029  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00030  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00031  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00032  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00033  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034  *
00035  */
00036 
00037 #ifndef SL_CONFIG_H_
00038 #define SL_CONFIG_H_
00039 
00040 //*****************************************************************************
00041 //
00042 // If building with a C++ compiler, make all of the definitions in this header
00043 // have a C binding.
00044 //
00045 //*****************************************************************************
00046 
00047 /**/
00048 
00049 namespace mbed_cc3100 {
00050 
00051 #define LOOP_FOREVER() \
00052             {\
00053                 while(1); \
00054             }
00055 
00056 #define ASSERT_ON_ERROR(error_code) \
00057             {\
00058                 /* Handling the error-codes is specific to the application */ \
00059                 if (error_code < 0) return error_code; \
00060                 /* else, continue w/ execution */ \
00061             }
00062 
00063 
00064 /*
00065  * Values for below macros shall be modified per the access-point's (AP) properties
00066  * SimpleLink device will connect to following AP when the application is executed
00067  */
00068 #define SSID_NAME         "*********"
00069 //#define SSID_NAME       "*"         /* Access point name to connect to. */
00070 #define SEC_TYPE        SL_SEC_TYPE_WPA_WPA2    /* Security type of the Access point */
00071 #define PASSKEY           "**********"
00072 //#define PASSKEY         "********"                  /* Password in case of secure AP */
00073 #define PASSKEY_LEN     strlen(PASSKEY)  /* Password length in case of secure AP */
00074 
00075 /* Configuration of the device when it comes up in AP mode */
00076 #define SSID_AP_MODE       "mysimplelink"       /* SSID of the CC3100 in AP mode */
00077 #define PASSWORD_AP_MODE   ""                  /* Password of CC3100 AP */
00078 #define SEC_TYPE_AP_MODE   SL_SEC_TYPE_OPEN    /* Can take SL_SEC_TYPE_WEP or
00079 * SL_SEC_TYPE_WPA as well */
00080 
00081 /*
00082  * Values for below macros shall be modified based on current time
00083  */
00084 #define DATE        26      /* Current Date */
00085 #define MONTH       4       /* Month */
00086 #define YEAR        2015    /* Current year */
00087 #define HOUR        17      /* Time - hours */
00088 #define MINUTE      06      /* Time - minutes */
00089 #define SECOND      0       /* Time - seconds */
00090 
00091 #define SUCCESS             0
00092 
00093 }//namespace mbed_cc3100
00094 
00095 #endif /*__SL_CONFIG_H__*/
00096