TI's CC3100 host driver and demo. Experimental and a work in progress.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers cc3100_device.h Source File

cc3100_device.h

00001 /*
00002  * device.h - CC31xx/CC32xx Host Driver Implementation
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 __DEVICE_H__
00038 #define __DEVICE_H__
00039 
00040 /*****************************************************************************/
00041 /* Include files                                                             */
00042 /*****************************************************************************/
00043 #include "cc3100_simplelink.h"
00044 
00045 #ifdef __cplusplus
00046 extern "C" {
00047 #endif
00048 
00049 
00050 
00051 /*!
00052 
00053     \addtogroup device
00054     @{
00055 
00056 */
00057 
00058 /*****************************************************************************/
00059 /* Macro declarations                                                        */
00060 /*****************************************************************************/
00061      
00062      
00063 /* SL internal Error codes */
00064          
00065 /* Receive this error in case there are no resources to issue the command
00066    If possible, increase the number of MAX_CUNCURENT_ACTIONS (result in memory increase)
00067    If not, try again later */
00068 #define SL_POOL_IS_EMPTY (-2000)
00069          
00070 /* Receive this error in case a given length for RX buffer was too small. 
00071    Receive payload was bigger than the given buffer size. Therefore, payload is cut according to receive size 
00072    Recommend to increase buffer size */
00073 #define SL_ESMALLBUF     (-2001)
00074 
00075 /* Receive this error in case zero length is supplied to a "get" API
00076    Recommend to supply length according to requested information (view options defines for help) */
00077 #define SL_EZEROLEN      (-2002)
00078 
00079 /* User supplied invalid parameter */
00080 #define SL_INVALPARAM    (-2003)
00081 
00082 /* End of SL internal Error codes */
00083 
00084 
00085 
00086 /*****************************************************************************/
00087 /* Errors returned from the general error async event                        */
00088 /*****************************************************************************/
00089 
00090 /* Send types */
00091 typedef enum
00092 {
00093     SL_ERR_SENDER_HEALTH_MON,
00094     SL_ERR_SENDER_CLI_UART,
00095     SL_ERR_SENDER_SUPPLICANT,
00096     SL_ERR_SENDER_NETWORK_STACK,
00097     SL_ERR_SENDER_WLAN_DRV_IF,
00098     SL_ERR_SENDER_WILINK,
00099     SL_ERR_SENDER_INIT_APP,
00100     SL_ERR_SENDER_NETX,
00101     SL_ERR_SENDER_HOST_APD,
00102     SL_ERR_SENDER_MDNS,
00103     SL_ERR_SENDER_HTTP_SERVER,
00104     SL_ERR_SENDER_DHCP_SERVER,
00105     SL_ERR_SENDER_DHCP_CLIENT,
00106     SL_ERR_DISPATCHER,
00107     SL_ERR_NUM_SENDER_LAST=0xFF
00108 }SlErrorSender_e; 
00109 
00110 
00111 /* Error codes */
00112 #define SL_ERROR_STATIC_ADDR_SUBNET_ERROR                   (-60)  /* network stack error*/
00113 #define SL_ERROR_ILLEGAL_CHANNEL                            (-61)  /* supplicant error */
00114 #define SL_ERROR_SUPPLICANT_ERROR                           (-72)  /* init error code */
00115 #define SL_ERROR_HOSTAPD_INIT_FAIL                          (-73)  /* init error code */
00116 #define SL_ERROR_HOSTAPD_INIT_IF_FAIL                       (-74)  /* init error code */
00117 #define SL_ERROR_WLAN_DRV_INIT_FAIL                         (-75)  /* init error code */
00118 #define SL_ERROR_WLAN_DRV_START_FAIL                        (-76)  /* wlan start error */
00119 #define SL_ERROR_FS_FILE_TABLE_LOAD_FAILED                  (-77)  /* init file system failed */
00120 #define SL_ERROR_PREFERRED_NETWORKS_FILE_LOAD_FAILED        (-78)  /* init file system failed */
00121 #define SL_ERROR_HOSTAPD_BSSID_VALIDATION_ERROR             (-79)  /* Ap configurations BSSID error */
00122 #define SL_ERROR_HOSTAPD_FAILED_TO_SETUP_INTERFACE          (-80)  /* Ap configurations interface error */
00123 #define SL_ERROR_MDNS_ENABLE_FAIL                           (-81)  /* mDNS enable failed                */
00124 #define SL_ERROR_HTTP_SERVER_ENABLE_FAILED                  (-82)  /* HTTP server enable failed         */
00125 #define SL_ERROR_DHCP_SERVER_ENABLE_FAILED                  (-83)  /* DHCP server enable failed         */
00126 #define SL_ERROR_PREFERRED_NETWORK_LIST_FULL                (-93)  /* supplicant error  */
00127 #define SL_ERROR_PREFERRED_NETWORKS_FILE_WRITE_FAILED       (-94)  /* supplicant error  */
00128 #define SL_ERROR_DHCP_CLIENT_RENEW_FAILED                   (-100) /* DHCP client error */
00129 /* WLAN Connection management status */
00130 #define SL_ERROR_CON_MGMT_STATUS_UNSPECIFIED                (-102)  
00131 #define SL_ERROR_CON_MGMT_STATUS_AUTH_REJECT                (-103)  
00132 #define SL_ERROR_CON_MGMT_STATUS_ASSOC_REJECT               (-104)  
00133 #define SL_ERROR_CON_MGMT_STATUS_SECURITY_FAILURE           (-105)  
00134 #define SL_ERROR_CON_MGMT_STATUS_AP_DEAUTHENTICATE          (-106)  
00135 #define SL_ERROR_CON_MGMT_STATUS_AP_DISASSOCIATE            (-107)  
00136 #define SL_ERROR_CON_MGMT_STATUS_ROAMING_TRIGGER            (-108)  
00137 #define SL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_CONNECT  (-109)  
00138 #define SL_ERROR_CON_MGMT_STATUS_SG_RESELECT                (-110)  
00139 #define SL_ERROR_CON_MGMT_STATUS_ROC_FAILURE                (-111)  
00140 #define SL_ERROR_CON_MGMT_STATUS_MIC_FAILURE                (-112)  
00141 /* end of WLAN connection management error statuses */
00142 #define SL_ERROR_WAKELOCK_ERROR_PREFIX                      (-115)  /* Wake lock expired */
00143 #define SL_ERROR_LENGTH_ERROR_PREFIX                        (-116)  /* Uart header length error */
00144 #define SL_ERROR_MDNS_CREATE_FAIL                           (-121)  /* mDNS create failed */
00145 #define SL_ERROR_GENERAL_ERROR                              (-127)
00146 
00147 
00148 
00149 #define SL_DEVICE_GENERAL_CONFIGURATION           (1)
00150 #define SL_DEVICE_GENERAL_CONFIGURATION_DATE_TIME (11)
00151 #define SL_DEVICE_GENERAL_VERSION                 (12)
00152 #define SL_DEVICE_STATUS                          (2)
00153 
00154 /*
00155     Declare the different event group classifications
00156     The SimpleLink device send asynchronous events. Each event has a group 
00157     classification according to its nature.
00158 */
00159 /* SL_EVENT_CLASS_WLAN connection user events */
00160 #define SL_WLAN_CONNECT_EVENT                     (1)
00161 #define SL_WLAN_DISCONNECT_EVENT                  (2)
00162 /* WLAN Smart Config user events */
00163 #define SL_WLAN_SMART_CONFIG_COMPLETE_EVENT       (3)
00164 #define SL_WLAN_SMART_CONFIG_STOP_EVENT           (4)
00165 /* WLAN AP user events */
00166 #define SL_WLAN_STA_CONNECTED_EVENT               (5)
00167 #define SL_WLAN_STA_DISCONNECTED_EVENT            (6)
00168 /* WLAN P2P user events */
00169 #define SL_WLAN_P2P_DEV_FOUND_EVENT               (7)
00170 #define    SL_WLAN_P2P_NEG_REQ_RECEIVED_EVENT     (8)
00171 #define SL_WLAN_CONNECTION_FAILED_EVENT           (9)
00172 /* SL_EVENT_CLASS_DEVICE user events */
00173 #define SL_DEVICE_FATAL_ERROR_EVENT               (1)
00174 /* SL_EVENT_CLASS_BSD user events */               
00175 #define    SL_SOCKET_TX_FAILED_EVENT              (1) 
00176 #define SL_SOCKET_ASYNC_EVENT                     (2)
00177 /* SL_EVENT_CLASS_NETAPP user events */   
00178 #define    SL_NETAPP_IPV4_IPACQUIRED_EVENT        (1)
00179 #define    SL_NETAPP_IPV6_IPACQUIRED_EVENT        (2)
00180 #define SL_NETAPP_IP_LEASED_EVENT                 (3)
00181 #define SL_NETAPP_IP_RELEASED_EVENT               (4)
00182 
00183 /* Server Events */
00184 #define SL_NETAPP_HTTPGETTOKENVALUE_EVENT          (1)
00185 #define SL_NETAPP_HTTPPOSTTOKENVALUE_EVENT         (2)
00186 
00187 
00188 /*
00189     Declare the different event group classifications for sl_DevGet
00190     for getting status indications
00191  */
00192 
00193 /* Events list to mask/unmask*/
00194 #define SL_EVENT_CLASS_GLOBAL                     (0)
00195 #define SL_EVENT_CLASS_DEVICE                     (1)
00196 #define SL_EVENT_CLASS_WLAN                       (2)
00197 #define SL_EVENT_CLASS_BSD                        (3)
00198 #define SL_EVENT_CLASS_NETAPP                     (4)
00199 #define SL_EVENT_CLASS_NETCFG                     (5)
00200 #define SL_EVENT_CLASS_FS                         (6)
00201 
00202   
00203 /******************  DEVICE CLASS status ****************/
00204 #define EVENT_DROPPED_DEVICE_ASYNC_GENERAL_ERROR          (0x00000001L)
00205 #define STATUS_DEVICE_SMART_CONFIG_ACTIVE                 (0x80000000L)
00206   
00207 /******************  WLAN CLASS status ****************/
00208 #define EVENT_DROPPED_WLAN_WLANASYNCONNECTEDRESPONSE      (0x00000001L)
00209 #define EVENT_DROPPED_WLAN_WLANASYNCDISCONNECTEDRESPONSE  (0x00000002L)
00210 #define EVENT_DROPPED_WLAN_STA_CONNECTED                  (0x00000004L)
00211 #define EVENT_DROPPED_WLAN_STA_DISCONNECTED               (0x00000008L)
00212 #define STATUS_WLAN_STA_CONNECTED                         (0x80000000L)
00213                       
00214 /******************  NETAPP CLASS status ****************/
00215 #define EVENT_DROPPED_NETAPP_IPACQUIRED                   (0x00000001L)
00216 #define EVENT_DROPPED_NETAPP_IPACQUIRED_V6                (0x00000002L)
00217 #define EVENT_DROPPED_NETAPP_IP_LEASED                    (0x00000004L)
00218 #define EVENT_DROPPED_NETAPP_IP_RELEASED                  (0x00000008L)
00219                       
00220 /******************  BSD CLASS status ****************/
00221 #define EVENT_DROPPED_SOCKET_TXFAILEDASYNCRESPONSE        (0x00000001L)
00222   
00223 /******************  FS CLASS  ****************/
00224   
00225 
00226 
00227 /*****************************************************************************/
00228 /* Structure/Enum declarations                                               */
00229 /*****************************************************************************/
00230 
00231 #ifdef SL_IF_TYPE_UART
00232 typedef struct  
00233 {
00234     _u32             BaudRate;
00235     _u8              FlowControlEnable;
00236     _u8              CommPort;
00237 } SlUartIfParams_t;
00238 #endif
00239 
00240 typedef struct
00241 {
00242     _u32               ChipId;
00243     _u32               FwVersion[4];
00244     _u8                PhyVersion[4];
00245 }_SlPartialVersion;
00246 
00247 typedef struct
00248 {
00249     _SlPartialVersion ChipFwAndPhyVersion;
00250     _u32               NwpVersion[4];
00251     _u16               RomVersion;
00252     _u16               Padding;
00253 }SlVersionFull;
00254 
00255 typedef struct
00256 {
00257     _i8                status;
00258     SlErrorSender_e        sender;
00259 }sl_DeviceReport;
00260 
00261 typedef union
00262 {
00263   sl_DeviceReport           deviceEvent; 
00264 } _SlDeviceEventData_u;
00265 
00266 typedef struct
00267 {
00268    _u32                 Event;
00269    _SlDeviceEventData_u EventData;
00270 } SlDeviceEvent_t;
00271 
00272 typedef struct  
00273 {
00274        /* time */
00275     _u32                sl_tm_sec;
00276     _u32                sl_tm_min;
00277     _u32                sl_tm_hour;
00278        /* date */
00279     _u32                sl_tm_day; /* 1-31 */
00280     _u32                sl_tm_mon; /* 1-12 */
00281     _u32                sl_tm_year; /*  YYYY 4 digits  */
00282     _u32                sl_tm_week_day; /* not required */
00283     _u32                sl_tm_year_day; /* not required */ 
00284     _u32                reserved[3];  
00285 }SlDateTime_t;
00286 
00287 
00288 /******************************************************************************/
00289 /* Type declarations                                                          */
00290 /******************************************************************************/
00291 typedef void (*P_INIT_CALLBACK)(_u32 Status);
00292 
00293 /*****************************************************************************/
00294 /* Function prototypes                                                       */
00295 /*****************************************************************************/
00296 
00297 /*!
00298     \brief Start the SimpleLink device
00299     
00300     This function initialize the communication interface, set the enable pin 
00301     of the device, and call to the init complete callback.
00302 
00303     \param[in]      pIfHdl              Opened Interface Object. In case the interface 
00304                                         must be opened outside the SimpleLink Driver, the
00305                                         user might give the handler to be used in \n
00306                                         any access of the communication interface with the 
00307                                         device (UART/SPI). \n
00308                                         The SimpleLink driver will open an interface port
00309                                         only if this parameter is null! \n
00310     \param[in]      pDevName            The name of the device to open. Could be used when 
00311                                         the pIfHdl is null, to transfer information to the 
00312                                         open interface function \n
00313                                         This pointer could be used to pass additional information to
00314                                         sl_IfOpen in case it is required (e.g. UART com port name)
00315     \param[in]      pInitCallBack       Pointer to function that would be called
00316                                         on completion of the initialization process.\n
00317                                         If this parameter is NULL the function is 
00318                                         blocked until the device initialization 
00319                                         is completed, otherwise the function returns 
00320                                         immediately.
00321 
00322     \return         Returns the current active role (STA/AP/P2P) or an error code:
00323                     - ROLE_STA, ROLE_AP, ROLE_P2P in case of success, 
00324                       otherwise in failure one of the following is return:
00325                     - ROLE_STA_ERR  (Failure to load MAC/PHY in STA role)
00326                     - ROLE_AP_ERR  (Failure to load MAC/PHY in AP role)
00327                     - ROLE_P2P_ERR  (Failure to load MAC/PHY in P2P role)
00328 
00329     
00330      \sa             sl_Stop
00331 
00332     \note           belongs to \ref basic_api
00333 
00334     \warning        This function must be called before any other SimpleLink API is used, or after sl_Stop is called for reinit the device
00335     \par            Example:
00336     \code            
00337                    An example for open interface without callback routine. The interface name and handler are
00338                    handled by the sl_IfOpen routine: 
00339 
00340                     if( sl_Start(NULL, NULL, NULL) < 0 )
00341                    {
00342                        LOG("Error opening interface to device\n"); 
00343                    }
00344     \endcode
00345 */
00346 #if _SL_INCLUDE_FUNC(sl_Start)
00347 _i16 sl_Start(const void* pIfHdl, _i8*  pDevName, const P_INIT_CALLBACK pInitCallBack);
00348 #endif
00349 
00350 /*!
00351     \brief Stop the SimpleLink device
00352 
00353     This function clears the enable pin of the device, closes the communication \n
00354     interface and invokes the stop complete callback 
00355 
00356     \param[in]      timeout                       Stop timeout in msec. Should be used to give the device time to finish \n 
00357                                                   any transmission/reception that is not completed when the function was called. \n
00358                     Additional options:
00359                     - 0                             Enter to hibernate immediately \n
00360                     - 0xFFFF                        Host waits for device's response before \n
00361                                                     hibernating, without timeout protection \n      
00362                     - 0 < Timeout[msec] < 0xFFFF    Host waits for device's response before \n
00363                                                     hibernating, with a defined timeout protection \n
00364                                                     This timeout defines the max time to wait. The NWP \n
00365                                                     response can be sent earlier than this timeout.
00366 
00367     \return         On success, zero is returned. On error, -1 is returned     
00368  
00369     \sa             sl_Start
00370 
00371     \note           This API will shutdown the device and invoke the "i/f close" function regardless \n
00372                     if it was opened implicitly or explicitly. \n
00373                     It is up to the platform interface library to properly handle interface close \n
00374                     routine \n
00375                     belongs to \ref basic_api \n
00376     \warning     
00377 */
00378 #if _SL_INCLUDE_FUNC(sl_Stop)
00379 _i16 sl_Stop(_u16 timeout);
00380 #endif
00381 
00382 
00383 /*!
00384     \brief     Internal function for setting device configurations
00385 
00386     \return    On success, zero is returned. On error, -1 is 
00387                returned
00388    
00389     \param[in] DeviceSetId   configuration id
00390     \param[in] Option         configurations option
00391     \param[in] ConfigLen     configurations len
00392     \param[in] pValues         configurations values
00393 
00394     \sa         
00395     \note 
00396     \warning     
00397     \par   Examples:
00398     \code
00399          Setting device time and date example:
00400 
00401          SlDateTime_t dateTime= {0};
00402          dateTime.sl_tm_day =   (_u32)23;          // Day of month (DD format) range 1-13
00403          dateTime.sl_tm_mon =   (_u32)6;           // Month (MM format) in the range of 1-12 
00404          dateTime.sl_tm_year =  (_u32)2014;        // Year (YYYY format) 
00405          dateTime.sl_tm_hour =  (_u32)17;          // Hours in the range of 0-23
00406          dateTime.sl_tm_min =   (_u32)55;          // Minutes in the range of 0-59
00407          dateTime.sl_tm_sec =   (_u32)22;          // Seconds in the range of  0-59
00408          sl_DevSet(SL_DEVICE_GENERAL_CONFIGURATION,
00409                    SL_DEVICE_GENERAL_CONFIGURATION_DATE_TIME,
00410                    sizeof(SlDateTime_t),
00411                    (_u8 *)(&dateTime));
00412 
00413     \endcode
00414 */
00415 #if _SL_INCLUDE_FUNC(sl_DevSet)
00416 _i32 sl_DevSet(_u8 DeviceSetId ,_u8 Option,_u8 ConfigLen, _u8 *pValues);
00417 #endif
00418 
00419 /*!
00420     \brief      Internal function for getting device configurations
00421     \return     On success, zero is returned. On error, -1 is 
00422                 returned
00423     \param[in]  DeviceGetId   configuration id - example SL_DEVICE_STATUS
00424     \param[out] pOption   Get configurations option, example for get status options
00425                             - SL_EVENT_CLASS_GLOBAL
00426                             - SL_EVENT_CLASS_DEVICE
00427                             - SL_EVENT_CLASS_WLAN  
00428                             - SL_EVENT_CLASS_BSD   
00429                             - SL_EVENT_CLASS_NETAPP
00430                             - SL_EVENT_CLASS_NETCFG
00431                             - SL_EVENT_CLASS_FS 
00432     \param[out] pConfigLen   The length of the allocated memory as input, when the
00433                              function complete, the value of this parameter would be
00434                              the len that actually read from the device.\n 
00435                              If the device return length that is longer from the input 
00436                              value, the function will cut the end of the returned structure
00437                              and will return SL_ESMALLBUF
00438     \param[out] pValues      Get configurations values
00439     \sa         
00440     \note 
00441     \warning  
00442     \par        Examples:
00443     \code
00444      Example for getting WLAN class status:
00445      _u32 statusWlan;
00446      _u8 pConfigOpt;
00447      _u8 pConfigLen;
00448      pConfigOpt = SL_EVENT_CLASS_WLAN;
00449      sl_DevGet(SL_DEVICE_STATUS,&pConfigOpt,&pConfigLen,(_u8 *)(&statusWlan));
00450      Example for getting version:
00451      SlVersionFull ver;
00452      pConfigOpt = SL_DEVICE_GENERAL_VERSION;
00453      sl_DevGet(SL_DEVICE_GENERAL_CONFIGURATION,&pConfigOpt,&pConfigLen,(_u8 *)(&ver));
00454      printf("CHIP %d\nMAC 31.%d.%d.%d.%d\nPHY %d.%d.%d.%d\nNWP %d.%d.%d.%d\nROM %d\nHOST %d.%d.%d.%d\n",
00455              ver.ChipFwAndPhyVersion.ChipId,
00456              ver.ChipFwAndPhyVersion.FwVersion[0],ver.ChipFwAndPhyVersion.FwVersion[1],
00457              ver.ChipFwAndPhyVersion.FwVersion[2],ver.ChipFwAndPhyVersion.FwVersion[3],
00458              ver.ChipFwAndPhyVersion.PhyVersion[0],ver.ChipFwAndPhyVersion.PhyVersion[1],
00459              ver.ChipFwAndPhyVersion.PhyVersion[2],ver.ChipFwAndPhyVersion.PhyVersion[3],
00460              ver.NwpVersion[0],ver.NwpVersion[1],ver.NwpVersion[2],ver.NwpVersion[3],
00461              ver.RomVersion,
00462              SL_MAJOR_VERSION_NUM,SL_MINOR_VERSION_NUM,SL_VERSION_NUM,SL_SUB_VERSION_NUM);
00463 
00464      \endcode
00465      \code
00466          Getting Device time and date example:
00467          
00468          SlDateTime_t dateTime =  {0};  
00469          _i8 configLen = sizeof(SlDateTime_t); 
00470          _i8 configOpt = SL_DEVICE_GENERAL_CONFIGURATION_DATE_TIME;
00471          sl_DevGet(SL_DEVICE_GENERAL_CONFIGURATION,&configOpt, &configLen,(_u8 *)(&dateTime)); 
00472          
00473          printf("Day %d,Mon %d,Year %d,Hour %,Min %d,Sec %d\n",dateTime.sl_tm_day,dateTime.sl_tm_mon,dateTime.sl_tm_year
00474                  dateTime.sl_tm_hour,dateTime.sl_tm_min,dateTime.sl_tm_sec);
00475      \endcode
00476 */
00477 #if _SL_INCLUDE_FUNC(sl_DevGet)
00478 _i32 sl_DevGet(_u8 DeviceGetId, _u8 *pOption,_u8 *pConfigLen, _u8 *pValues);
00479 #endif
00480 
00481 
00482 /*!
00483     \brief          Set asynchronous event mask
00484     
00485     Mask asynchronous events from the device. Masked events do not
00486     generate asynchronous messages from the device. 
00487     By default - all events are active
00488     
00489     \param[in]      EventClass          The classification groups that the 
00490                                         mask is referred to. Need to be one of
00491                                         the following:
00492                                         - SL_EVENT_CLASS_GLOBAL
00493                                         - SL_EVENT_CLASS_DEVICE
00494                                         - SL_EVENT_CLASS_WLAN  
00495                                         - SL_EVENT_CLASS_BSD   
00496                                         - SL_EVENT_CLASS_NETAPP
00497                                         - SL_EVENT_CLASS_NETCFG
00498                                         - SL_EVENT_CLASS_FS 
00499 
00500 
00501     \param[in]      Mask               Event Mask bitmap. Valid mask are (per group):
00502                                         - SL_EVENT_CLASS_WLAN user events
00503                                           - SL_WLAN_CONNECT_EVENT                     
00504                                           - SL_WLAN_DISCONNECT_EVENT
00505                                         - SL_EVENT_CLASS_DEVICE user events
00506                                           - SL_DEVICE_FATAL_ERROR_EVENT
00507                                         - SL_EVENT_CLASS_BSD user events
00508                                           - SL_SOCKET_TX_FAILED_EVENT     
00509                                           - SL_SOCKET_ASYNC_EVENT 
00510                                         - SL_EVENT_CLASS_NETAPP user events
00511                                           - SL_NETAPP_IPV4_IPACQUIRED_EVENT 
00512                                           - SL_NETAPP_IPV6_IPACQUIRED_EVENT
00513      
00514     \return         On success, zero is returned. On error, -1 is returned       
00515 
00516     \sa             sl_EventMaskGet
00517 
00518     \note           belongs to \ref ext_api
00519      
00520     \warning     
00521     \par           Example:
00522     \code          
00523 
00524     An example of masking connection/disconnection async events from WLAN class:
00525                    sl_EventMaskSet(SL_EVENT_CLASS_WLAN, (SL_WLAN_CONNECT_EVENT | SL_WLAN_DISCONNECT_EVENT) );
00526     
00527     \endcode
00528 */
00529 #if _SL_INCLUDE_FUNC(sl_EventMaskSet)
00530 _i16 sl_EventMaskSet(_u8 EventClass , _u32 Mask);
00531 #endif
00532 
00533 /*!
00534     \brief Get current event mask of the device
00535     
00536     return the events bit mask from the device. In case that event is 
00537     masked, the device is not sending this event.  
00538     
00539     \param[in]      EventClass          The classification groups that the 
00540                                         mask is referred to. Need to be one of
00541                                         the following:
00542                                         - SL_EVENT_CLASS_GLOBAL
00543                                         - SL_EVENT_CLASS_DEVICE
00544                                         - SL_EVENT_CLASS_WLAN  
00545                                         - SL_EVENT_CLASS_BSD   
00546                                         - SL_EVENT_CLASS_NETAPP
00547                                         - SL_EVENT_CLASS_NETCFG
00548                                         - SL_EVENT_CLASS_FS 
00549 
00550     \param[out]      pMask              Pointer to Mask bitmap where the 
00551                                         value should be stored. Bitmasks are the same as in \ref sl_EventMaskSet
00552      
00553     \return         On success, zero is returned. On error, -1 is returned       
00554      
00555     \sa             sl_EventMaskSet         
00556 
00557     \note           belongs to \ref ext_api
00558 
00559     \warning     
00560     \par           Example:
00561     \code          
00562 
00563     An example of getting an event mask for WLAN class
00564     _u32 maskWlan;
00565                    sl_StatusGet(SL_EVENT_CLASS_WLAN,&maskWlan);
00566 
00567    \endcode
00568 */
00569 #if _SL_INCLUDE_FUNC(sl_EventMaskGet)
00570 _i16 sl_EventMaskGet(_u8 EventClass, _u32 *pMask);
00571 #endif
00572 
00573 
00574 /*!
00575     \brief the simple link task entry
00576 
00577     \Param
00578     This function must be called from the main loop or from dedicated thread in
00579     the following cases:
00580         - Non-Os Platform - should be called from the mail loop
00581         - Multi Threaded Platform when the user does not implement the external spawn functions - 
00582            should be called from dedicated thread allocated to the simplelink driver.
00583            In this mode the function never return.
00584     
00585     \return         None
00586     
00587     \sa             sl_Stop
00588 
00589     \note           belongs to \ref basic_api
00590 
00591     \warning        This function must be called from a thread that is start running before 
00592                     any call to other simple link API
00593 */
00594 #if _SL_INCLUDE_FUNC(sl_Task)
00595 void sl_Task(void);
00596 #endif
00597 
00598 
00599 /*!
00600     \brief Setting the internal uart mode 
00601 
00602     \param[in]      pUartParams          Pointer to the uart configuration parameter set: 
00603                                          baudrate     - up to 711 Kbps
00604                                          flow control - enable/disable 
00605                                          comm port    - the comm port number
00606     
00607     \return         On success zero is returned, otherwise - Failed.   
00608     
00609     \sa             sl_Stop
00610 
00611     \note           belongs to \ref basic_api
00612 
00613     \warning        This function must consider the host uart capability
00614 */
00615 #ifdef SL_IF_TYPE_UART
00616 #if _SL_INCLUDE_FUNC(sl_UartSetMode)
00617 _i16 sl_UartSetMode(const SlUartIfParams_t* pUartParams);
00618 #endif
00619 #endif
00620 
00621 /*!
00622 
00623  Close the Doxygen group.
00624  @}
00625 
00626  */
00627 
00628 
00629 #ifdef  __cplusplus
00630 }
00631 #endif /*  __cplusplus */
00632 
00633 #endif  /*  __DEVICE_H__ */
00634 
00635 
00636