TI's CC3100. A test demo with very little testing done!
Revision 1:c73566c6788a, committed 2015-02-10
- Comitter:
- dflet
- Date:
- Tue Feb 10 12:58:16 2015 +0000
- Parent:
- 0:e89ba455dbcf
- Child:
- 2:b3fd5b3d9860
- Commit message:
- Removed some debug comments.
Changed in this revision
| G_functions/fPtr_func.cpp | Show annotated file Show diff for this revision Revisions of this file |
| G_functions/fPtr_func.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/G_functions/fPtr_func.cpp Tue Feb 10 12:09:29 2015 +0000
+++ b/G_functions/fPtr_func.cpp Tue Feb 10 12:58:16 2015 +0000
@@ -33,14 +33,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-//#include "mbed.h"
+
#include "cc3100_simplelink.h"
-//#include "cc3100_sl_common.h"
-//#include "cc3100_protocol.h"
-//#include "cc3100_driver.h"
-//#include "cc3100_nonos.h"
-//#include "cc3100_netapp.h"
#include "cc3100.h"
#include "fPtr_func.h"
@@ -83,7 +78,6 @@
/*******************************************************************************/
void _sl_HandleAsync_Accept(void *pVoidBuf)
{
- //printf("_sl_HandleAsync_Accept\r\n");
_SocketAddrResponse_u *pMsgArgs = (_SocketAddrResponse_u *)_SL_RESP_ARGS_START(pVoidBuf);
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));
@@ -103,7 +97,6 @@
/*******************************************************************************/
void _sl_HandleAsync_Connect(void *pVoidBuf)
{
- //printf("_sl_HandleAsync_Connect\r\n");
_SocketResponse_t *pMsgArgs = (_SocketResponse_t *)_SL_RESP_ARGS_START(pVoidBuf);
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));
@@ -124,7 +117,6 @@
/*******************************************************************************/
void _sl_HandleAsync_Select(void *pVoidBuf)
{
- //printf("_sl_HandleAsync_Select\r\n");
_SelectAsyncResponse_t *pMsgArgs = (_SelectAsyncResponse_t *)_SL_RESP_ARGS_START(pVoidBuf);
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));
@@ -143,7 +135,6 @@
/******************************************************************************/
void _sl_HandleAsync_DnsGetHostByName(void *pVoidBuf)
{
- //printf("_sl_HandleAsync_DnsGetHostByName\r\n");
_GetHostByNameIPv4AsyncResponse_t *pMsgArgs = (_GetHostByNameIPv4AsyncResponse_t *)_SL_RESP_ARGS_START(pVoidBuf);
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));
@@ -220,7 +211,6 @@
******************************************************************************/
void _sl_HandleAsync_DnsGetHostByService(void *pVoidBuf)
{
- //printf("_sl_HandleAsync_DnsGetHostByService\r\n");
_GetHostByServiceAsyncResponse_t* Res;
uint16_t TextLen;
uint16_t UserTextLen;
@@ -286,7 +276,6 @@
/*****************************************************************************/
void _sl_HandleAsync_PingResponse(void *pVoidBuf)
{
- //printf("_sl_HandleAsync_PingResponse\r\n");
_PingReportResponse_t *pMsgArgs = (_PingReportResponse_t *)_SL_RESP_ARGS_START(pVoidBuf);
SlPingReport_t pingReport;
@@ -312,7 +301,6 @@
/* ******************************************************************************/
_SlReturnVal_t _SlDrvMsgReadSpawnCtx(void *pValue)
{
- //printf("_SlDrvMsgReadSpawnCtx\r\n");
#ifdef SL_POLLING_MODE_USED
int16_t retCode = OSI_OK;
@@ -323,7 +311,6 @@
if (TRUE == g_pCB->IsCmdRespWaited) {
OSI_RET_OK_CHECK( sl_SyncObjSignal(&g_pCB->CmdSyncObj) );
return SL_RET_CODE_OK;
- //return;
}
}
@@ -344,7 +331,6 @@
if(FALSE == (_driver->_SL_PENDING_RX_MSG(g_pCB))) {
OSI_RET_OK_CHECK(_nonos->sl_LockObjUnlock(&g_pCB->GlobalLockObj, NON_OS_LOCK_OBJ_UNLOCK_VALUE));
return SL_RET_CODE_OK;
- //return;
}
VERIFY_RET_OK(_driver->_SlDrvMsgRead());
@@ -379,7 +365,7 @@
OSI_RET_OK_CHECK(_nonos->sl_LockObjUnlock(&g_pCB->GlobalLockObj, NON_OS_LOCK_OBJ_UNLOCK_VALUE));
return(SL_RET_CODE_OK);
- //return;
+
}
/***************************************************************************
@@ -388,7 +374,6 @@
****************************************************************************/
void _sl_HandleAsync_Stop(void *pVoidBuf)
{
- //printf("_SlDrvNetAppEventHandler\r\n");
_BasicResponse_t *pMsgArgs = (_BasicResponse_t *)_SL_RESP_ARGS_START(pVoidBuf);
VERIFY_SOCKET_CB(NULL != g_pCB->StopCB.pAsyncRsp);
@@ -406,17 +391,16 @@
******************************************************************************/
void _SlDrvDeviceEventHandler(void *pArgs)
{
- //printf("_SlDrvDeviceEventHandler\r\n");
_SlResponseHeader_t *pHdr = (_SlResponseHeader_t *)pArgs;
- //printf("Debug pHdr->GenHeader.Opcode 0x%X\r\n",pHdr->GenHeader.Opcode);
+
switch(pHdr->GenHeader.Opcode) {
case SL_OPCODE_DEVICE_INITCOMPLETE:
_cc3100_->_sl_HandleAsync_InitComplete(pHdr);
- //printf("_SlDrvDeviceEventHandler 2\r\n");
+
break;
case SL_OPCODE_DEVICE_STOP_ASYNC_RESPONSE:
_sl_HandleAsync_Stop(pHdr);
- //printf("_SlDrvDeviceEventHandler 3\r\n");
+
break;
case SL_OPCODE_DEVICE_DEVICEASYNCFATALERROR:
#ifdef sl_GeneralEvtHdlr
@@ -427,7 +411,6 @@
devHandler.EventData.deviceEvent.status = pMsgArgs->status & 0xFF;
devHandler.EventData.deviceEvent.sender = (SlErrorSender_e)((pMsgArgs->status >> 8) & 0xFF);
SimpleLinkGeneralEventHandler(&devHandler);
- //printf("_SlDrvDeviceEventHandler 4\r\n");
}
#endif
break;
@@ -443,7 +426,6 @@
/*****************************************************************************/
void _SlDrvNetAppEventHandler(void *pArgs)
{
- //printf("_SlDrvNetAppEventHandler\r\n");
_SlResponseHeader_t *pHdr = (_SlResponseHeader_t *)pArgs;
#ifdef sl_HttpServerCallback
SlHttpServerEvent_t httpServerEvent;
@@ -542,8 +524,7 @@
#if (defined(sl_WlanEvtHdlr))
void SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent)
{
-
- //printf("Debug SimpleLinkWlanEventHandler\r\n");
+
if(pWlanEvent == NULL)
printf(" [WLAN EVENT] NULL Pointer Error \n\r");
@@ -621,28 +602,18 @@
switch(pNetAppEvent->Event) {
case SL_NETAPP_IPV4_IPACQUIRED_EVENT: {
+ SlIpV4AcquiredAsync_t *pEventData = NULL;
+ _cc3100_->SET_STATUS_BIT(g_Status, STATUS_BIT_IP_ACQUIRED);
+ pEventData = &pNetAppEvent->EventData.ipAcquiredV4;
+ g_GatewayIP = pEventData->gateway;
- //printf("SL_NETAPP_IPV4_IPACQUIRED_EVENT \n\r");
- SlIpV4AcquiredAsync_t *pEventData = NULL;
- //printf("g_Status 2 = 0x%X\r\n",_cc3100_->g_Status);
- _cc3100_->SET_STATUS_BIT(g_Status, STATUS_BIT_IP_ACQUIRED);
- //printf("g_Status 2 = 0x%X\r\n",_cc3100_->g_Status);
-
- pEventData = &pNetAppEvent->EventData.ipAcquiredV4;
-
- g_GatewayIP = pEventData->gateway;
- //printf("g_GatewayIP = = 0x%X\r\n",pEventData->gateway);
- //printf("Debug 4 SL_NETAPP_IPV4_IPACQUIRED_EVENT \n\r");
}
break;
- case SL_NETAPP_IP_LEASED_EVENT: {
- //printf("SL_NETAPP_IP_LEASED_EVENT \n\r");
- g_StationIP = pNetAppEvent->EventData.ipLeased.ip_address;
- //_cc3100_->g_Status = 0;
+ case SL_NETAPP_IP_LEASED_EVENT: {
+ g_StationIP = pNetAppEvent->EventData.ipLeased.ip_address;
_cc3100_->SET_STATUS_BIT(g_Status, STATUS_BIT_IP_LEASED);
- //printf("g_Status 3 = 0x%X\r\n",_cc3100_->g_Status);
-
+
}
break;
--- a/G_functions/fPtr_func.h Tue Feb 10 12:09:29 2015 +0000 +++ b/G_functions/fPtr_func.h Tue Feb 10 12:58:16 2015 +0000 @@ -38,10 +38,7 @@ #define fPtr_func_h #include "cc3100_simplelink.h" -//#include "cc3100_driver.h" -//#include "cc3100_nonos.h" -//#include "cc3100_netapp.h" -//#include "cc3100.h" + /* Note. C function pointers point to the functions below. */ /* C++ member function pointers not used ? */ @@ -218,8 +215,6 @@ _SlReturnVal_t _SlDrvMsgReadSpawnCtx(void *pValue); -//void _SlDrvMsgReadSpawnCtx(void *pValue); - void _SlDrvDeviceEventHandler(void *pArgs); void _SlDrvNetAppEventHandler(void *pArgs);