main.c
void WlanStationMode( void *pvParameters )
{

    long lRetVal = -1;
    InitializeAppVariables();

    //
    // Following function configure the device to default state by cleaning
    // the persistent settings stored in NVMEM (viz. connection profiles &
    // policies, power policy etc)
    //
    // Applications may choose to skip this step if the developer is sure
    // that the device is in its default state at start of applicaton
    //
    // Note that all profiles and persistent settings that were done on the
    // device will be lost
    //
    lRetVal = ConfigureSimpleLinkToDefaultState();
    if(lRetVal < 0)
    {
        if (DEVICE_NOT_IN_STATION_MODE == lRetVal)
        {
            UART_PRINT("Failed to configure the device in its default state\n\r");
        }

        LOOP_FOREVER();
    }

    UART_PRINT("Device is configured in default state \n\r");

    //
    // Assumption is that the device is configured in station mode already
    // and it is in its default state
    //
    lRetVal = sl_Start(0, 0, 0);
    if (lRetVal < 0 || ROLE_STA != lRetVal)
    {
        UART_PRINT("Failed to start the device \n\r");
        LOOP_FOREVER();
    }

    UART_PRINT("Device started as STATION \n\r");

    //
    //Connecting to WLAN AP
    //
    lRetVal = WlanConnect();
    if(lRetVal < 0)
    {
        UART_PRINT("Failed to establish connection w/ an AP \n\r");
        LOOP_FOREVER();
    }

    UART_PRINT("Connection established w/ AP and IP is aquired \n\r");

    connect_flag = 1;

    SendThread(NULL);

    //LOOP_FOREVER();
    while(FOREVER)
    {
    	g_temp = CollectTmp(NULL);
    	osi_Sleep(200);
    	g_light = CollectLight(NULL);
    	osi_Sleep(200);
    	g_voice = CollectVoice();

    	sendPacket();
    	osi_Sleep(1500);
    }

}
//****************************************************************************
//
//! \brief Start simplelink, connect to the ap and run the ping test
//!
//! This function starts the simplelink, connect to the ap and start the ping
//! test on the default gateway for the ap
//!
//! \param[in]  pvParameters - Pointer to the list of parameters that
//!             can bepassed to the task while creating it
//!
//! \return  None
//
//****************************************************************************

\brief Start simplelink, connect to the ap and run the ping test
This function starts the simplelink, connect to the ap and start the ping
test on the default gateway for the ap

\param[in]  pvParameters - Pointer to the list of parameters that
can bepassed to the task while creating it

\return  None
\ brief Start simplelink connect to the ap and run the ping test This function starts the simplelink connect to the ap and start the ping test on the default gateway for the ap \ param [ in ] pvParameters - Pointer to the list of parameters that can bepassed to the task while creating it \ return None
void WlanStationMode( void *pvParameters )
{
    long lRetVal = -1;
    InitializeAppVariables();
    lRetVal = ConfigureSimpleLinkToDefaultState();
    if(lRetVal < 0)
    {
        if (DEVICE_NOT_IN_STATION_MODE == lRetVal)
        {
            UART_PRINT("Failed to configure the device in its default state\n\r");
        }
        LOOP_FOREVER();
    }
    UART_PRINT("Device is configured in default state \n\r");
    lRetVal = sl_Start(0, 0, 0);
    if (lRetVal < 0 || ROLE_STA != lRetVal)
    {
        UART_PRINT("Failed to start the device \n\r");
        LOOP_FOREVER();
    }
    UART_PRINT("Device started as STATION \n\r");
    lRetVal = WlanConnect();
    if(lRetVal < 0)
    {
        UART_PRINT("Failed to establish connection w/ an AP \n\r");
        LOOP_FOREVER();
    }
    UART_PRINT("Connection established w/ AP and IP is aquired \n\r");
    connect_flag = 1;
    SendThread(NULL);
    while(FOREVER)
    {
    	g_temp = CollectTmp(NULL);
    	osi_Sleep(200);
    	g_light = CollectLight(NULL);
    	osi_Sleep(200);
    	g_voice = CollectVoice();
    	sendPacket();
    	osi_Sleep(1500);
    }
}
void WlanStationMode ( void * pvParameters ) { long lRetVal = -1 ; InitializeAppVariables ( ) ; lRetVal = ConfigureSimpleLinkToDefaultState ( ) ; if ( lRetVal < 0 ) { if ( DEVICE_NOT_IN_STATION_MODE == lRetVal ) { UART_PRINT ( " \n \r " ) ; } LOOP_FOREVER ( ) ; } UART_PRINT ( " \n \r " ) ; lRetVal = sl_Start ( 0 , 0 , 0 ) ; if ( lRetVal < 0 || ROLE_STA != lRetVal ) { UART_PRINT ( " \n \r " ) ; LOOP_FOREVER ( ) ; } UART_PRINT ( " \n \r " ) ; lRetVal = WlanConnect ( ) ; if ( lRetVal < 0 ) { UART_PRINT ( " \n \r " ) ; LOOP_FOREVER ( ) ; } UART_PRINT ( " \n \r " ) ; connect_flag = 1 ; SendThread ( NULL ) ; while ( FOREVER ) { g_temp = CollectTmp ( NULL ) ; osi_Sleep ( 200 ) ; g_light = CollectLight ( NULL ) ; osi_Sleep ( 200 ) ; g_voice = CollectVoice ( ) ; sendPacket ( ) ; osi_Sleep ( 1500 ) ; } }
\brief Start simplelink, connect to the ap and run the ping test
This function starts the simplelink, connect to the ap and start the ping
test on the default gateway for the ap
\ brief Start simplelink connect to the ap and run the ping test This function starts the simplelink connect to the ap and start the ping test on the default gateway for the ap
//
 // Following function configure the device to default state by cleaning
 // the persistent settings stored in NVMEM (viz. connection profiles &
 // policies, power policy etc)
 //
 // Applications may choose to skip this step if the developer is sure
 // that the device is in its default state at start of applicaton
 //
 // Note that all profiles and persistent settings that were done on the
 // device will be lost
 //
 //
 // Assumption is that the device is configured in station mode already
 // and it is in its default state
 //
 //
 //Connecting to WLAN AP
 //
 //LOOP_FOREVER();
