当前位置: 首页>>代码示例>>C++>>正文


C++ SET_STATUS_BIT函数代码示例

本文整理汇总了C++中SET_STATUS_BIT函数的典型用法代码示例。如果您正苦于以下问题:C++ SET_STATUS_BIT函数的具体用法?C++ SET_STATUS_BIT怎么用?C++ SET_STATUS_BIT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SET_STATUS_BIT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SimpleLinkNetAppEventHandler

/*!
    \brief This function handles events for IP address acquisition via DHCP
           indication

    \param[in]      pNetAppEvent is the event passed to the handler
*/
void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *pNetAppEvent) {
    if(pNetAppEvent == NULL) {

        CLI_Write((_u8 *)"[NETAPP EVENT] NULL Pointer Error \n");
        return;
    }

    switch(pNetAppEvent->Event) {

        case SL_NETAPP_IPV4_IPACQUIRED_EVENT:
        {
            SlIpV4AcquiredAsync_t *pEventData = NULL;

            SET_STATUS_BIT(_status, STATUS_BIT_IP_ACQUIRED);

            pEventData = &pNetAppEvent->EventData.ipAcquiredV4;
            _gatewayIP = pEventData->gateway;
        }
        break;

        case SL_NETAPP_IP_LEASED_EVENT:
        {
            _stationIP = pNetAppEvent->EventData.ipLeased.ip_address;
            SET_STATUS_BIT(_status, STATUS_BIT_IP_LEASED);
        }
        break;

        default:
        {
            CLI_Write((_u8 *)"[NETAPP EVENT] Unexpected event \n");
        }
        break;
    }
}
开发者ID:drazul,项目名称:Wifi_Functions_Simplelink_CC3100,代码行数:40,代码来源:WifiFunctions.c

示例2: SimpleLinkNetAppEventHandler

//*****************************************************************************
//
//! \brief This function handles network events such as IP acquisition, IP
//!           leased, IP released etc.
//!
//! \param[in]  pNetAppEvent - Pointer to NetApp Event Info 
//!
//! \return None
//!
//*****************************************************************************
void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *pNetAppEvent)
{
    switch(pNetAppEvent->Event)
    {
        case SL_NETAPP_IPV4_ACQUIRED:
        case SL_NETAPP_IPV6_ACQUIRED:
        {
            SET_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_AQUIRED);
        }
        break;
        
        case SL_NETAPP_IP_LEASED:
        {
            SET_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_LEASED);
        
            g_ulStaIp = (pNetAppEvent)->EventData.ipLeased.ip_address;
            
            UART_PRINT("[NETAPP EVENT] IP Leased to Client: IP=%d.%d.%d.%d , ",
                        SL_IPV4_BYTE(g_ulStaIp,3), SL_IPV4_BYTE(g_ulStaIp,2),
                        SL_IPV4_BYTE(g_ulStaIp,1), SL_IPV4_BYTE(g_ulStaIp,0));
        }
        break;
        
        default:
        {
            UART_PRINT("[NETAPP EVENT] Unexpected event [0x%x] \n\r",
                       pNetAppEvent->Event);
        }
        break;
    }
}
开发者ID:Balu1991,项目名称:Wifly_Light,代码行数:41,代码来源:main.c

示例3: do_catchup

/*
 * do_catchup
 * Function sends init & start event to a subsystem.
 */
STATIC CpaStatus do_catchup(icp_accel_dev_t *accel_dev,
                   subservice_registation_handle_t* subsystem_hdl)
{
    CpaStatus status = CPA_STATUS_FAIL;
    CpaStatus ret_status = CPA_STATUS_FAIL;
    ICP_CHECK_FOR_NULL_PARAM(accel_dev);
    ICP_CHECK_FOR_NULL_PARAM(subsystem_hdl);

    ADF_DEBUG("Sending event %d to %s\n", ICP_ADF_EVENT_INIT,
                                    subsystem_hdl->subsystem_name);

    status = subsystem_hdl->subserviceEventHandler(accel_dev,
                                             ICP_ADF_EVENT_INIT,
                                             NULL);

    if( CPA_STATUS_SUCCESS == status )
    {
        SET_STATUS_BIT(subsystem_hdl->subsystemStatus
                       [accel_dev->accelId].subsystemInitBit, 0);

        ADF_DEBUG("Sending event %d to %s\n", ICP_ADF_EVENT_START,
                                         subsystem_hdl->subsystem_name);

        status = subsystem_hdl->subserviceEventHandler(accel_dev,
                                                 ICP_ADF_EVENT_START,
                                                 NULL);
        /* Check if start was successful */
        if( CPA_STATUS_SUCCESS == status )
        {
            SET_STATUS_BIT(subsystem_hdl->subsystemStatus
                       [accel_dev->accelId].subsystemStartBit, 0);
        }
        else
        {
            ADF_ERROR("Failed to start Subservice %s\n",
                               subsystem_hdl->subsystem_name);

            ADF_DEBUG("Sending event %d to %s\n", ICP_ADF_EVENT_SHUTDOWN,
                                               subsystem_hdl->subsystem_name);

            /* Send shutdown the subsystem if start failed */
            ret_status = subsystem_hdl->subserviceEventHandler(accel_dev,
                                             ICP_ADF_EVENT_SHUTDOWN,
                                             NULL);
            if( CPA_STATUS_SUCCESS == ret_status )
            {
                CLEAR_STATUS_BIT(subsystem_hdl->subsystemStatus
                       [accel_dev->accelId].subsystemInitBit, 0);
            }
        }
    }
    else
    {
        ADF_ERROR("Failed to initialise Subservice %s\n",
                   subsystem_hdl->subsystem_name);
    }
    return status;
}
开发者ID:lecoq,项目名称:qat_c2xxx,代码行数:62,代码来源:adf_init.c

示例4: SimpleLinkWlanEventHandler

/*!
    \brief This function handles WLAN events

    \param[in]      pWlanEvent is the event passed to the handler
*/
void SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent) {
    if(pWlanEvent == NULL) {

        CLI_Write((_u8 *)"[WLAN EVENT] NULL Pointer Error \n");
        return;
    }

    switch(pWlanEvent->Event) {
        case SL_WLAN_CONNECT_EVENT:
        {
            SET_STATUS_BIT(_status, STATUS_BIT_CONNECTION);
        }
        break;

        case SL_WLAN_DISCONNECT_EVENT:
        {
            slWlanConnectAsyncResponse_t*  pEventData = NULL;

            CLR_STATUS_BIT(_status, STATUS_BIT_CONNECTION);
            CLR_STATUS_BIT(_status, STATUS_BIT_IP_ACQUIRED);

            pEventData = &pWlanEvent->EventData.STAandP2PModeDisconnected;

            if(SL_USER_INITIATED_DISCONNECTION == pEventData->reason_code)
                CLI_Write((_u8 *)"Device disconnected from the AP on application's request \n");

            else
                CLI_Write((_u8 *)"Device disconnected from the AP on an ERROR..!! \n");

        }
        break;

        case SL_WLAN_STA_CONNECTED_EVENT:
        {
            SET_STATUS_BIT(_status, STATUS_BIT_STA_CONNECTED);
        }
        break;

        case SL_WLAN_STA_DISCONNECTED_EVENT:
        {
            CLR_STATUS_BIT(_status, STATUS_BIT_STA_CONNECTED);
            CLR_STATUS_BIT(_status, STATUS_BIT_IP_LEASED);
        }
        break;

        default:
        {
            CLI_Write((_u8 *)"[WLAN EVENT] Unexpected event \n");
        }
        break;
    }
}
开发者ID:drazul,项目名称:Wifi_Functions_Simplelink_CC3100,代码行数:57,代码来源:WifiFunctions.c

示例5: SimpleLinkNetAppEventHandler

//*****************************************************************************
//
//! \brief This function handles network events such as IP acquisition, IP
//!           leased, IP released etc.
//!
//! \param[in]  pNetAppEvent - Pointer to NetApp Event Info
//!
//! \return None
//!
//*****************************************************************************
void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *pNetAppEvent) {
    if(!pNetAppEvent) {
        return;
    }

    switch(pNetAppEvent->Event)
    {
        case SL_NETAPP_IPV4_IPACQUIRED_EVENT:
        {
            SlIpV4AcquiredAsync_t *pEventData = NULL;

            SET_STATUS_BIT(wlan_obj.status, STATUS_BIT_IP_ACQUIRED);

            // Ip Acquired Event Data
            pEventData = &pNetAppEvent->EventData.ipAcquiredV4;

            // Get the ip
            wlan_obj.ip      = pEventData->ip;
        }
            break;
        case SL_NETAPP_IPV6_IPACQUIRED_EVENT:
            break;
        case SL_NETAPP_IP_LEASED_EVENT:
            break;
        case SL_NETAPP_IP_RELEASED_EVENT:
            break;
        default:
            break;
    }
}
开发者ID:insane-adding-machines,项目名称:micropython,代码行数:40,代码来源:modwlan.c

示例6: SimpleLinkNetAppEventHandler

void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *pNetAppEvent) {
    switch (pNetAppEvent->Event) {
        case SL_NETAPP_IPV4_IPACQUIRED_EVENT:
        {
            UART_PRINT("[QuickStart] IP address                : %d.%d.%d.%d\r\n",
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.ip, 3),
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.ip, 2),
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.ip, 1),
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.ip, 0));
            UART_PRINT("[QuickStart] Gateway                   : %d.%d.%d.%d\r\n",
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.gateway, 3),
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.gateway, 2),
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.gateway, 1),
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.gateway, 0));
            UART_PRINT("[QuickStart] DNS server                : %d.%d.%d.%d\r\n",
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.dns, 3),
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.dns, 2),
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.dns, 1),
                    SL_IPV4_BYTE(pNetAppEvent->EventData.ipAcquiredV4.dns, 0));

            SET_STATUS_BIT(g_Status, STATUS_BIT_IP_AQUIRED);
        }
            break;

        default:
            break;
    }
}
开发者ID:DatzZDeVesh,项目名称:parse-embedded-sdks,代码行数:28,代码来源:main.c

示例7: SimpleLinkNetAppEventHandler

/*!
    \brief This function handles events for IP address acquisition via DHCP
           indication

    \param[in]      pNetAppEvent is the event passed to the handler

    \return         None

    \note

    \warning
*/
void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *pNetAppEvent)
{
    if(pNetAppEvent == NULL)
        CLI_Write(" [NETAPP EVENT] NULL Pointer Error \n\r");

    if(pNetAppEvent == NULL)
        CLI_Write(" [NETAPP EVENT] NULL Pointer Error \n\r");

    switch(pNetAppEvent->Event)
    {
    case SL_NETAPP_IPV4_IPACQUIRED_EVENT:
    {
        SET_STATUS_BIT(g_Status, STATUS_BIT_IP_ACQUIRED);

        /*
         * Information about the connection (like IP, gateway address etc)
         * will be available in 'SlIpV4AcquiredAsync_t'
         * Applications can use it if required
         *
         * SlIpV4AcquiredAsync_t *pEventData = NULL;
         * pEventData = &pNetAppEvent->EventData.ipAcquiredV4;
         *
         */
    }
    break;

    default:
    {
        CLI_Write(" [NETAPP EVENT] Unexpected event \n\r");
    }
    break;
    }
}
开发者ID:bmxrt,项目名称:CC3100,代码行数:45,代码来源:main.c

示例8: SimpleLinkNetAppEventHandler

//*****************************************************************************
//
//! \brief This function handles network events such as IP acquisition, IP
//!           leased, IP released etc.
//!
//! \param[in]  pNetAppEvent - Pointer to NetApp Event Info
//!
//! \return None
//!
//*****************************************************************************
void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *pNetAppEvent)
{
	if(!pNetAppEvent)
	{
		return;
	}

    switch(pNetAppEvent->Event)
    {
        case SL_NETAPP_IPV4_IPACQUIRED_EVENT:
        {
            SlIpV4AcquiredAsync_t *pEventData = NULL;

            SET_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_AQUIRED);

            //Ip Acquired Event Data
            pEventData = &pNetAppEvent->EventData.ipAcquiredV4;

            g_ulIpAddr = pEventData->ip;

            //Gateway IP address
            g_ulGatewayIP = pEventData->gateway;
        }
        break;

    }
}
开发者ID:CaptFrank,项目名称:CC3200-Linux-SDK,代码行数:37,代码来源:net.c

示例9: SimpleLinkWlanEventHandler

void SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent)
{
    UART_PRINT("SimpleLinkWlanEventHandler\r\n");
    switch(pWlanEvent->Event)
    {
        case SL_WLAN_CONNECT_EVENT:
        {
            SET_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION);

            //
            // Information about the connected AP (like name, MAC etc) will be
            // available in 'slWlanConnectAsyncResponse_t'-Applications
            // can use it if required
            //
            //  slWlanConnectAsyncResponse_t *pEventData = NULL;
            // pEventData = &pWlanEvent->EventData.STAandP2PModeWlanConnected;
            //

            UART_PRINT("[WLAN EVENT] STA Connected to the AP: %s\n\r",
                       pWlanEvent->EventData.STAandP2PModeWlanConnected.ssid_name);
        }
        break;

        case SL_WLAN_DISCONNECT_EVENT:
        {
            slWlanConnectAsyncResponse_t*  pEventData = NULL;

            CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION);
            CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_AQUIRED);

            pEventData = &pWlanEvent->EventData.STAandP2PModeDisconnected;

            // If the user has initiated 'Disconnect' request,
            //'reason_code' is SL_USER_INITIATED_DISCONNECTION
            if(SL_USER_INITIATED_DISCONNECTION == pEventData->reason_code)
            {
                UART_PRINT("[WLAN EVENT]Device disconnected from the AP: %s\r\n",
                           pWlanEvent->EventData.STAandP2PModeWlanConnected.ssid_name);
            }
            else
            {
                UART_PRINT("[WLAN ERROR]Device disconnected from the AP AP: %s\r\n",
                           pWlanEvent->EventData.STAandP2PModeWlanConnected.ssid_name);
            }
        }
        break;

        default:
        {
            UART_PRINT("[WLAN EVENT] Unexpected event [0x%x]\n\r",
                       pWlanEvent->Event);
        }
        break;
    }
}
开发者ID:BillTheBest,项目名称:sample-apps,代码行数:55,代码来源:cc32xx_support.c

示例10: SimpleLinkWlanEventHandler

/*!
    \brief This function handles WLAN events

    \param[in]      pWlanEvent is the event passed to the handler

    \return         None

    \note

    \warning
*/
void SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent)
{
    if(pWlanEvent == NULL)
    {
        CLI_Write((_u8 *)" [WLAN EVENT] NULL Pointer Error \n\r");
        return;
    }
    
    switch(pWlanEvent->Event)
    {
        case SL_WLAN_CONNECT_EVENT:
        {
            SET_STATUS_BIT(g_Status, STATUS_BIT_CONNECTION);

            /*
             * Information about the connected AP (like name, MAC etc) will be
             * available in 'slWlanConnectAsyncResponse_t' - Applications
             * can use it if required
             *
             * slWlanConnectAsyncResponse_t *pEventData = NULL;
             * pEventData = &pWlanEvent->EventData.STAandP2PModeWlanConnected;
             *
             */
        }
        break;

        case SL_WLAN_DISCONNECT_EVENT:
        {
            slWlanConnectAsyncResponse_t*  pEventData = NULL;

            CLR_STATUS_BIT(g_Status, STATUS_BIT_CONNECTION);
            CLR_STATUS_BIT(g_Status, STATUS_BIT_IP_ACQUIRED);

            pEventData = &pWlanEvent->EventData.STAandP2PModeDisconnected;

            /* If the user has initiated 'Disconnect' request, 'reason_code' is SL_USER_INITIATED_DISCONNECTION */
            if(SL_USER_INITIATED_DISCONNECTION == pEventData->reason_code)
            {
                CLI_Write((_u8 *)" Device disconnected from the AP on application's request \n\r");
            }
            else
            {
                CLI_Write((_u8 *)" Device disconnected from the AP on an ERROR..!! \n\r");
            }
        }
        break;

        default:
        {
            CLI_Write((_u8 *)" [WLAN EVENT] Unexpected event \n\r");
        }
        break;
    }
}
开发者ID:callalilychen,项目名称:TIOT,代码行数:65,代码来源:main.c

示例11: SimpleLinkPingReport

/*!
    \brief This function handles ping report events

    \param[in]      pPingReport holds the ping report statistics

    \return         None

    \note

    \warning
*/
static void SimpleLinkPingReport(SlPingReport_t *pPingReport)
{
    SET_STATUS_BIT(g_Status, STATUS_BIT_PING_DONE);

    if(pPingReport == NULL)
    {
        CLI_Write((_u8 *)" [PING REPORT] NULL Pointer Error\r\n");
        return;
    }

    g_PingPacketsRecv = pPingReport->PacketsReceived;
}
开发者ID:callalilychen,项目名称:TIOT,代码行数:23,代码来源:main.c

示例12: SimpleLinkWlanEventHandler

void SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent) {
    switch (pWlanEvent->Event) {
        case SL_WLAN_CONNECT_EVENT:
        {
            slWlanConnectAsyncResponse_t* pEventData = &pWlanEvent->EventData.STAandP2PModeWlanConnected;

            memset(g_ConnectionSSID, 0, sizeof(g_ConnectionSSID));
            memset(g_ConnectionBSSID, 0, sizeof(g_ConnectionBSSID));
            memcpy(g_ConnectionSSID, pEventData->ssid_name, pEventData->ssid_len);
            memcpy(g_ConnectionBSSID, pEventData->bssid, SL_BSSID_LENGTH);
            UART_PRINT("[QuickStart] Connected to              : %s (%x:%x:%x:%x:%x:%x)\r\n",
                    g_ConnectionSSID,
                    g_ConnectionBSSID[0], g_ConnectionBSSID[1],
                    g_ConnectionBSSID[2], g_ConnectionBSSID[3],
                    g_ConnectionBSSID[4], g_ConnectionBSSID[5]);

            SET_STATUS_BIT(g_Status, STATUS_BIT_CONNECTION);
        }
            break;

        case SL_WLAN_DISCONNECT_EVENT:
        {
            CLR_STATUS_BIT(g_Status, STATUS_BIT_CONNECTION);
            CLR_STATUS_BIT(g_Status, STATUS_BIT_IP_AQUIRED);

            slWlanConnectAsyncResponse_t* pEventData = &pWlanEvent->EventData.STAandP2PModeDisconnected;

            UART_PRINT("[QuickStart] Disconnected from         : %s (%x:%x:%x:%x:%x:%x)\r\n",
                    g_ConnectionSSID,
                    g_ConnectionBSSID[0], g_ConnectionBSSID[1],
                    g_ConnectionBSSID[2], g_ConnectionBSSID[3],
                    g_ConnectionBSSID[4], g_ConnectionBSSID[5]);
            if (SL_USER_INITIATED_DISCONNECTION == pEventData->reason_code) {
                UART_PRINT("        Reason                    : user request\r\n");
            } else {
                UART_PRINT("        Error                     : %d\r\n", pEventData->reason_code);
            }
            memset(g_ConnectionSSID, 0, sizeof(g_ConnectionSSID));
            memset(g_ConnectionBSSID, 0, sizeof(g_ConnectionBSSID));
        }
            break;

        default:
            break;
    }
}
开发者ID:DatzZDeVesh,项目名称:parse-embedded-sdks,代码行数:46,代码来源:main.c

示例13: SimpleLinkWlanEventHandler

//*****************************************************************************
//
//! \brief The Function Handles WLAN Events
//!
//! \param[in]  pWlanEvent - Pointer to WLAN Event Info
//!
//! \return None
//!
//*****************************************************************************
void SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent)
{
	if(!pWlanEvent)
	{
		return;
	}

    switch(pWlanEvent->Event)
    {
        case SL_WLAN_CONNECT_EVENT:
        {
            SET_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION);

            //
            // Information about the connected AP (like name, MAC etc) will be
            // available in 'slWlanConnectAsyncResponse_t'-Applications
            // can use it if required
            //
            //  slWlanConnectAsyncResponse_t *pEventData = NULL;
            // pEventData = &pWlanEvent->EventData.STAandP2PModeWlanConnected;
            //

            // Copy new connection SSID and BSSID to global parameters
            memcpy(g_ucConnectionSSID,pWlanEvent->EventData.
                   STAandP2PModeWlanConnected.ssid_name,
                   pWlanEvent->EventData.STAandP2PModeWlanConnected.ssid_len);
            memcpy(g_ucConnectionBSSID,
                   pWlanEvent->EventData.STAandP2PModeWlanConnected.bssid,
                   SL_BSSID_LENGTH);
        }
        break;

        case SL_WLAN_DISCONNECT_EVENT:
        {
            CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION);
            CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_AQUIRED);

            memset(g_ucConnectionSSID,0,sizeof(g_ucConnectionSSID));
            memset(g_ucConnectionBSSID,0,sizeof(g_ucConnectionBSSID));
        }
        break;
    }
}
开发者ID:CaptFrank,项目名称:CC3200-Linux-SDK,代码行数:52,代码来源:net.c

示例14: SimpleLinkNetAppEventHandler

//*****************************************************************************
//
//! \brief This function handles network events such as IP acquisition, IP
//!           leased, IP released etc.
//!
//! \param pNetAppEvent - Pointer indicating device acquired IP
//!
//! \return None
//!
//*****************************************************************************
void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *pNetAppEvent)
{

    switch(pNetAppEvent->Event)
    {
        case SL_NETAPP_IPV4_IPACQUIRED_EVENT:
        case SL_NETAPP_IPV6_IPACQUIRED_EVENT:
        {
            SET_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_AQUIRED);

            //
            // Information about the IPv4 & IPv6 details (like IP, gateway,dns 
            // etc) will be available in 'SlIpV4AcquiredAsync_t / 
            // SlIpV6AcquiredAsync_t' - Applications can use it if required
            //
            // For IPv4:
            //

            SlIpV4AcquiredAsync_t *pEventData = NULL;

            //Ip Acquired Event Data
            pEventData = &pNetAppEvent->EventData.ipAcquiredV4;

            g_ulIpAddr = pEventData->ip;

            //
            // For IPv6:
            //
            // SlIpV4AcquiredAsync_t *pEventData = NULL;
            // pEventData = &pNetAppEvent->EventData.ipAcquiredV6;
            //
        }
        break;

        default:
        {
            UART_PRINT("[NETAPP EVENT] Unexpected event \n\r");
        }
        break;
    }
}
开发者ID:moyanming,项目名称:CC3200SDK_1.2.0,代码行数:51,代码来源:main.c

示例15: SimpleLinkWlanEventHandler

//*****************************************************************************
//
//! \brief The Function Handles WLAN Events
//!
//! \param[in]  pSlWlanEvent - Pointer to WLAN Event Info
//!
//! \return None
//!
//*****************************************************************************
void SimpleLinkWlanEventHandler(SlWlanEvent_t *pSlWlanEvent)
{
     switch(((SlWlanEvent_t*)pSlWlanEvent)->Event)
     {
        case SL_WLAN_CONNECT_EVENT:
        {
            SET_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION);
            
            //
            // Information about the connected AP (like name, MAC etc) will be
            // available in 'slWlanConnectAsyncResponse_t'-Applications
            // can use it if required
            //
            //  slWlanConnectAsyncResponse_t *pEventData = NULL;
            // pEventData = &pSlWlanEvent->EventData.STAandP2PModeWlanConnected;
            //
            
            // Copy new connection SSID and BSSID to global parameters
            memcpy(g_ucConnectionSSID,pSlWlanEvent->EventData.
                   STAandP2PModeWlanConnected.ssid_name,
                   pSlWlanEvent->EventData.STAandP2PModeWlanConnected.ssid_len);
            memcpy(g_ucConnectionBSSID,
                    pSlWlanEvent->EventData.STAandP2PModeWlanConnected.bssid,
                   SL_BSSID_LENGTH);

            UART_PRINT("[WLAN EVENT] STA Connected to the AP: %s , BSSID: "
                        "%x:%x:%x:%x:%x:%x\n\r", g_ucConnectionSSID,
                        g_ucConnectionBSSID[0], g_ucConnectionBSSID[1], 
                        g_ucConnectionBSSID[2], g_ucConnectionBSSID[3],
                        g_ucConnectionBSSID[4], g_ucConnectionBSSID[5]);
        }
        break;

        case SL_WLAN_DISCONNECT_EVENT:
        {
            slWlanConnectAsyncResponse_t*  pEventData = NULL;

            CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION);
            CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_AQUIRED);

            pEventData = &pSlWlanEvent->EventData.STAandP2PModeDisconnected;

            // If the user has initiated 'Disconnect' request, 
            //'reason_code' is SL_WLAN_DISCONNECT_USER_INITIATED_DISCONNECTION 
            if(SL_WLAN_DISCONNECT_USER_INITIATED_DISCONNECTION == pEventData->reason_code)
            {
                UART_PRINT("[WLAN EVENT]Device disconnected from the AP: %s, "
                           "BSSID: %x:%x:%x:%x:%x:%x on application's request "
                           "\n\r", g_ucConnectionSSID,g_ucConnectionBSSID[0],
                           g_ucConnectionBSSID[1],g_ucConnectionBSSID[2],
                           g_ucConnectionBSSID[3],g_ucConnectionBSSID[4],
                           g_ucConnectionBSSID[5]);
            }
            else
            {
                UART_PRINT("[WLAN ERROR]Device disconnected from the AP AP: %s,"
                           " BSSID: %x:%x:%x:%x:%x:%x on an ERROR..!! \n\r",
                           g_ucConnectionSSID,g_ucConnectionBSSID[0],
                           g_ucConnectionBSSID[1],g_ucConnectionBSSID[2],
                           g_ucConnectionBSSID[3],g_ucConnectionBSSID[4],
                           g_ucConnectionBSSID[5]);
            }
            memset(g_ucConnectionSSID,0,sizeof(g_ucConnectionSSID));
            memset(g_ucConnectionBSSID,0,sizeof(g_ucConnectionBSSID));
        }
        break;

        case SL_WLAN_STA_CONNECTED_EVENT:
        {
            // when device is in AP mode and any client connects to device cc3xxx
            SET_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION);
            
            //
            // Information about the connected client (like SSID, MAC etc) will 
            // be available in 'slPeerInfoAsyncResponse_t' - Applications
            // can use it if required
            //
            // slPeerInfoAsyncResponse_t *pEventData = NULL;
            // pEventData = &pSlWlanEvent->EventData.APModeStaConnected;
            //

        }
        break;

        case SL_WLAN_STA_DISCONNECTED_EVENT:
        {
            // when client disconnects from device (AP)
            CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION);
            
            //
            // Information about the connected client (like SSID, MAC etc) will
//.........这里部分代码省略.........
开发者ID:moyanming,项目名称:CC3200SDK_1.2.0,代码行数:101,代码来源:main.c


注:本文中的SET_STATUS_BIT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。