TI's CC3100. A test demo with very little testing done!

Dependencies:   mbed

Fork of cc3100_Test_Demo2 by 高 杨

Revision:
3:b89198ac2efe
Parent:
2:b3fd5b3d9860
diff -r b3fd5b3d9860 -r b89198ac2efe simplelink/cc3100.cpp
--- a/simplelink/cc3100.cpp	Sun Feb 15 11:01:37 2015 +0000
+++ b/simplelink/cc3100.cpp	Sun Feb 22 18:33:10 2015 +0000
@@ -96,41 +96,6 @@
 
     return SUCCESS;
 }
-
-int32_t cc3100::NetAppPingStart(SlPingStartCommand_t* pPingParams, uint8_t family, SlPingReport_t *pReport, const P_SL_DEV_PING_CALLBACK pPingCallback){
-
-    return (_netapp.sl_NetAppPingStart(pPingParams, family, pReport, pPingCallback));
-
-}
-
-int32_t cc3100::NetAppSet(uint8_t AppId ,uint8_t Option,uint8_t OptionLen, uint8_t *pOptionValue){
-	
-	return (_netapp.sl_NetAppSet(AppId ,Option, OptionLen, (uint8_t *)pOptionValue));
-	
-}	
-
-int16_t cc3100::NetCfgSet(uint8_t ConfigId ,uint8_t ConfigOpt, uint8_t ConfigLen, uint8_t *pValues){
-	
-	return (_netcfg.sl_NetCfgSet(ConfigId ,ConfigOpt, ConfigLen, (uint8_t *)pValues));
-	
-}	
-
-int16_t cc3100::WlanSet(uint16_t ConfigId ,uint16_t ConfigOpt,uint16_t ConfigLen, uint8_t *pValues){
-	
-	return (_wlan.sl_WlanSet(ConfigId, ConfigOpt, ConfigLen, (uint8_t*)pValues));
-	
-}	
-
-void cc3100::SlNonOsMainLoopTask(){
-	
-	_nonos._SlNonOsMainLoopTask();
-	
-}	
-
-int16_t cc3100::WlanSetMode(const uint8_t mode){
-	
-	return ( _wlan.sl_WlanSetMode(mode));
-}
     
 /*!
     \brief Disconnecting from a WLAN Access point
@@ -157,7 +122,7 @@
     if(0 == retVal)
     {
         /* Wait */
-        while(IS_CONNECTED(g_Status,STATUS_BIT_CONNECTION)) { SlNonOsMainLoopTask(); }
+        while(IS_CONNECTED(g_Status,STATUS_BIT_CONNECTION)) { _nonos._SlNonOsMainLoopTask(); }
     }
 
     return SUCCESS;
@@ -244,7 +209,7 @@
     if(0 == retVal) {
         /* Wait */
         while(IS_CONNECTED(g_Status,STATUS_BIT_CONNECTION)) {
-            SlNonOsMainLoopTask();
+            _nonos._SlNonOsMainLoopTask();
         }
     }
     
@@ -306,11 +271,6 @@
     }
 
     return sd;
-}
-
-int32_t cc3100::sock_Close(int16_t sd){
-	
-	return _socket.sl_Close(sd);
 }	
 
 /*!
@@ -798,7 +758,7 @@
     ASSERT_ON_ERROR(retVal);
 
     /* Wait */
-    while(!IS_PING_DONE(g_Status,STATUS_BIT_PING_DONE)) { SlNonOsMainLoopTask(); }
+    while(!IS_PING_DONE(g_Status,STATUS_BIT_PING_DONE)) { _nonos._SlNonOsMainLoopTask(); }
 
     if(0 == g_PingPacketsRecv)
     {
@@ -851,7 +811,7 @@
     ASSERT_ON_ERROR(retVal);
 
     /* Wait */
-    while(!IS_PING_DONE(g_Status,STATUS_BIT_PING_DONE)) { SlNonOsMainLoopTask(); }
+    while(!IS_PING_DONE(g_Status,STATUS_BIT_PING_DONE)) { _nonos._SlNonOsMainLoopTask(); }
 
     if (0 == g_PingPacketsRecv)
     {
@@ -994,15 +954,15 @@
 void cc3100::CLR_STATUS_BIT(uint32_t status_variable, const uint32_t bit){
 	    
 	    g_Status = status_variable;
-	    status_variable &= ~((uint32_t)1L<<(bit));
-	    g_Status = status_variable;
+	    g_Status &= ~((uint32_t)1L<<(bit));
+	    
 }
 
 void cc3100::SET_STATUS_BIT(uint32_t status_variable, const uint32_t bit){
 
 	    g_Status = status_variable;
-	    status_variable |= ((uint32_t)1L<<(bit));
-	    g_Status = status_variable;
+	    g_Status |= ((uint32_t)1L<<(bit));
+	    
 }
 	    
 /*****************************************************************************/
@@ -1028,7 +988,7 @@
     InitComplete_t  AsyncRsp;
 
     /* Perform any preprocessing before enable networking services */
-    sl_DeviceEnablePreamble();
+    sl_DeviceEnablePreamble();//stub only
     
     /* ControlBlock init */
     _driver._SlDrvDriverCBInit();
@@ -1049,6 +1009,7 @@
         printf("SL_POOL_IS_EMPTY\r\n");
         return SL_POOL_IS_EMPTY;
     }
+    
     OSI_RET_OK_CHECK(_nonos.sl_LockObjLock(&g_pCB->ProtectionLockObj,  NON_OS_LOCK_OBJ_UNLOCK_VALUE, NON_OS_LOCK_OBJ_LOCK_VALUE, SL_OS_WAIT_FOREVER));
     g_pCB->ObjPool[ObjIdx].pRespArgs = (uint8_t *)&AsyncRsp;
     OSI_RET_OK_CHECK(_nonos.sl_LockObjUnlock(&g_pCB->ProtectionLockObj, NON_OS_LOCK_OBJ_UNLOCK_VALUE));