# Wireless LAN Access Point Management Service

- [API reference](https://docs.qualcomm.com/doc/80-41102-2/topic/_doxygen_rst_file__doxygen_sources_taf_wlanAp_interface_h.html#file-taf-wlanap-interface-h)

The wireless LAN (WLAN) access point (AP) management service provides APIs for applications to create, configure, and manage WLAN APs. This service allows devices to act as wireless hotspots, enabling client devices to connect to and access network resources.

The service supports multiple concurrent APs with different configurations, advanced security modes (including WPA3), client device management, and real-time connection monitoring.

**NOTE:** Before using this service, the WLAN device management service must be initialized and configured with a mode that includes AP functionality.

## IPC interfaces binding

The functions of this service are provided by the **tafWlanSvc** application service.

The following example illustrates how to bind to the WLAN AP service.

bindings:
    {
        clientExe.clientComponent.taf_wlanAp -> tafWlanSvc.taf_wlanAp
    }
    Copy to clipboard

## Set up a basic access point

The following example demonstrates how to set up a basic WLAN AP:

// First, ensure WLAN device is configured for AP mode
    le_result_t result = taf_wlan_TurnOn(NULL);
    if (result != LE_OK) {
        LE_ERROR("Failed to turn on WLAN device");
        return result;
    }
    
    result = taf_wlan_SetMode(NULL, TAF_WLAN_MODE_AP);
    if (result != LE_OK) {
        LE_ERROR("Failed to set AP mode");
        return result;
    }
    
    // Get AP interface information
    taf_wlan_APIntfInfo_t apIntf[TAF_WLAN_MAX_NUM_AP];
    taf_wlan_STAIntfInfo_t staIntf[TAF_WLAN_MAX_NUM_STA];
    size_t apIntfSize = TAF_WLAN_MAX_NUM_AP;
    size_t staIntfSize = TAF_WLAN_MAX_NUM_STA;
    
    result = taf_wlan_GetIntfInfo(NULL, apIntf, &apIntfSize, staIntf, &staIntfSize);
    if (result != LE_OK || apIntfSize == 0) {
        LE_ERROR("No AP interfaces available");
        return LE_FAULT;
    }
    
    // Get AP reference
    taf_wlanAp_WlanAPRef_t apRef = taf_wlanAp_GetWlanAP(apIntf[0].id, apIntf[0].IntfName);
    if (apRef == NULL) {
        LE_ERROR("Failed to get AP reference");
        return LE_FAULT;
    }
    
    LE_INFO("AP reference obtained for interface: %s", apIntf[0].IntfName);
    Copy to clipboard

## Configure an access point

### Basic configuration

Configure the AP with SSID and visibility settings:

// Configure basic AP settings
    taf_wlanAp_WlanAPConfig_t apConfig;
    memset(&apConfig, 0, sizeof(apConfig));
    
    // Set SSID
    strncpy(apConfig.SSID, "MyWiFiHotspot", sizeof(apConfig.SSID) - 1);
    apConfig.bSSIDVisible = true;  // Make SSID visible to clients
    
    result = taf_wlanAp_SetConfig(apRef, &apConfig);
    if (result != LE_OK) {
        LE_ERROR("Failed to set AP configuration: %d", result);
        return result;
    }
    
    LE_INFO("AP configured with SSID: %s", apConfig.SSID);
    Copy to clipboard

### Security configuration

Configure AP security settings:

// Configure AP security
    taf_wlanAp_WlanAPSecurityConfig_t secConfig;
    memset(&secConfig, 0, sizeof(secConfig));
    
    // Set WPA2 with PSK authentication
    secConfig.SecMode = TAF_WLAN_SEC_MODE_WPA2;
    secConfig.SecAuthMethod = TAF_WLAN_SEC_AUTH_METHOD_PSK;
    secConfig.SecEncryptMethod = TAF_WLAN_SEC_ENCRYPT_METHOD_AES;
    strncpy(secConfig.PassPhrase, "MySecurePassword123", sizeof(secConfig.PassPhrase) - 1);
    
    result = taf_wlanAp_SetSecurityConfig(apRef, &secConfig);
    if (result != LE_OK) {
        LE_ERROR("Failed to set security configuration: %d", result);
        return result;
    }
    
    LE_INFO("AP security configured with WPA2-PSK");
    Copy to clipboard

## Manage the access point lifecycle

### Start and stop an access point

// Start the Access Point
    result = taf_wlanAp_Start(apRef);
    if (result != LE_OK) {
        LE_ERROR("Failed to start AP: %d", result);
        return result;
    }
    
    LE_INFO("Access Point started successfully");
    
    // Get AP status to verify it's running
    taf_wlanAp_WlanAPStatus_t apStatus;
    result = taf_wlanAp_GetStatus(apRef, &apStatus);
    if (result == LE_OK) {
        LE_INFO("AP Status:");
        LE_INFO("  Enabled: %s", apStatus.bEnabled ? "Yes" : "No");
        if (apStatus.bEnabled) {
            LE_INFO("  Interface: %s", apStatus.IntfName);
            LE_INFO("  IPv4 Address: %s", apStatus.IPv4Address);
            LE_INFO("  MAC Address: %s", apStatus.MACAddress);
        }
    }
    
    // Later, stop the Access Point when needed
    result = taf_wlanAp_Stop(apRef);
    if (result != LE_OK) {
        LE_ERROR("Failed to stop AP: %d", result);
    } else {
        LE_INFO("Access Point stopped successfully");
    }
    Copy to clipboard

## Manage client devices

### Get connected devices

// Get list of connected devices
    taf_wlanAp_WlanAPConnectedDeviceInfo_t devices[TAF_WLANAP_MAX_CONNECTED_DEVICES];
    uint16_t numDevices = 0;
    size_t deviceInfoSize = TAF_WLANAP_MAX_CONNECTED_DEVICES;
    
    result = taf_wlanAp_GetConnectedDevices(apRef, &numDevices, devices, &deviceInfoSize);
    if (result == LE_OK) {
        LE_INFO("Connected devices: %d", numDevices);
        for (size_t i = 0; i < deviceInfoSize && i < numDevices; i++) {
            LE_INFO("Device %zu:", i + 1);
            LE_INFO("  Name: %s", devices[i].Name);
            LE_INFO("  MAC Address: %s", devices[i].MACAddress);
            LE_INFO("  IPv4 Address: %s", devices[i].IPv4Address);
        }
    } else {
        LE_ERROR("Failed to get connected devices: %d", result);
    }
    Copy to clipboard

### Monitor device connection events

Monitor client device connections and disconnections:

// Device connection event handler
    static void DeviceConnectionEventHandler(
        taf_wlanAp_WlanAPRef_t wlanAPRef,
        taf_wlanAp_DeviceConnectionEvent_t event,
        const char* macAddress,
        void* contextPtr
    )
    {
        switch (event) {
            case TAF_WLANAP_DEVICE_CONNECTED:
                LE_INFO("Device connected: %s", macAddress);
                // Handle new device connection
                break;
            case TAF_WLANAP_DEVICE_DISCONNECTED:
                LE_INFO("Device disconnected: %s", macAddress);
                // Handle device disconnection
                break;
            default:
                LE_ERROR("Unknown connection event: %d", event);
                break;
        }
    }
    
    // Register for device connection events
    taf_wlanAp_DeviceConnectionEventHandlerRef_t eventHandlerRef =
        taf_wlanAp_AddDeviceConnectionEventHandler(apRef, DeviceConnectionEventHandler, NULL);
    
    if (eventHandlerRef == NULL) {
        LE_ERROR("Failed to register connection event handler");
    } else {
        LE_INFO("Device connection event handler registered");
    }
    
    // Later, remove the event handler when no longer needed
    if (eventHandlerRef) {
        taf_wlanAp_RemoveDeviceConnectionEventHandler(eventHandlerRef);
        LE_INFO("Device connection event handler removed");
    }
    Copy to clipboard

## Complete access point setup example

The following example demonstrates a complete AP setup and management workflow:

typedef struct {
        taf_wlanAp_WlanAPRef_t apRef;
        taf_wlanAp_DeviceConnectionEventHandlerRef_t eventHandlerRef;
        le_sem_Ref_t semRef;
    } APContext_t;
    
    static APContext_t apContext = {0};
    
    static void DeviceConnectionHandler(
        taf_wlanAp_WlanAPRef_t wlanAPRef,
        taf_wlanAp_DeviceConnectionEvent_t event,
        const char* macAddress,
        void* contextPtr
    )
    {
        APContext_t* ctx = (APContext_t*)contextPtr;
    
        if (event == TAF_WLANAP_DEVICE_CONNECTED) {
            LE_INFO("New device connected: %s", macAddress);
    
            // Get updated device list
            taf_wlanAp_WlanAPConnectedDeviceInfo_t devices[TAF_WLANAP_MAX_CONNECTED_DEVICES];
            uint16_t numDevices = 0;
            size_t deviceInfoSize = TAF_WLANAP_MAX_CONNECTED_DEVICES;
    
            if (taf_wlanAp_GetConnectedDevices(ctx->apRef, &numDevices, devices,
                                               &deviceInfoSize) == LE_OK) {
                LE_INFO("Total connected devices: %d", numDevices);
            }
        } else if (event == TAF_WLANAP_DEVICE_DISCONNECTED) {
            LE_INFO("Device disconnected: %s", macAddress);
        }
    }
    
    le_result_t SetupAccessPoint(void)
    {
        le_result_t result;
    
        // Initialize WLAN device
        result = taf_wlan_TurnOn(NULL);
        if (result != LE_OK) {
            LE_ERROR("Failed to turn on WLAN device");
            return result;
        }
    
        result = taf_wlan_SetMode(NULL, TAF_WLAN_MODE_AP);
        if (result != LE_OK) {
            LE_ERROR("Failed to set AP mode");
            return result;
        }
    
        // Get AP interface
        taf_wlan_APIntfInfo_t apIntf[TAF_WLAN_MAX_NUM_AP];
        taf_wlan_STAIntfInfo_t staIntf[TAF_WLAN_MAX_NUM_STA];
        size_t apIntfSize = TAF_WLAN_MAX_NUM_AP;
        size_t staIntfSize = TAF_WLAN_MAX_NUM_STA;
    
        result = taf_wlan_GetIntfInfo(NULL, apIntf, &apIntfSize, staIntf, &staIntfSize);
        if (result != LE_OK || apIntfSize == 0) {
            LE_ERROR("No AP interfaces available");
            return LE_FAULT;
        }
    
        // Get AP reference
        apContext.apRef = taf_wlanAp_GetWlanAP(apIntf[0].id, apIntf[0].IntfName);
        if (apContext.apRef == NULL) {
            LE_ERROR("Failed to get AP reference");
            return LE_FAULT;
        }
    
        // Configure AP
        taf_wlanAp_WlanAPConfig_t apConfig = {0};
        strncpy(apConfig.SSID, "MyCompanyWiFi", sizeof(apConfig.SSID) - 1);
        apConfig.bSSIDVisible = true;
    
        result = taf_wlanAp_SetConfig(apContext.apRef, &apConfig);
        if (result != LE_OK) {
            LE_ERROR("Failed to set AP configuration");
            return result;
        }
    
        // Configure security
        taf_wlanAp_WlanAPSecurityConfig_t secConfig = {0};
        secConfig.SecMode = TAF_WLAN_SEC_MODE_WPA2;
        secConfig.SecAuthMethod = TAF_WLAN_SEC_AUTH_METHOD_PSK;
        secConfig.SecEncryptMethod = TAF_WLAN_SEC_ENCRYPT_METHOD_AES;
        strncpy(secConfig.PassPhrase, "SecurePassword123!", sizeof(secConfig.PassPhrase) - 1);
    
        result = taf_wlanAp_SetSecurityConfig(apContext.apRef, &secConfig);
        if (result != LE_OK) {
            LE_ERROR("Failed to set security configuration");
            return result;
        }
    
        // Register for connection events
        apContext.eventHandlerRef = taf_wlanAp_AddDeviceConnectionEventHandler(
            apContext.apRef, DeviceConnectionHandler, &apContext);
    
        if (apContext.eventHandlerRef == NULL) {
            LE_ERROR("Failed to register connection event handler");
            return LE_FAULT;
        }
    
        // Start the Access Point
        result = taf_wlanAp_Start(apContext.apRef);
        if (result != LE_OK) {
            LE_ERROR("Failed to start AP");
            return result;
        }
    
        LE_INFO("Access Point setup completed successfully");
        LE_INFO("SSID: %s", apConfig.SSID);
        LE_INFO("Security: WPA2-PSK with AES encryption");
    
        return LE_OK;
    }
    
    void CleanupAccessPoint(void)
    {
        if (apContext.eventHandlerRef) {
            taf_wlanAp_RemoveDeviceConnectionEventHandler(apContext.eventHandlerRef);
            apContext.eventHandlerRef = NULL;
        }
    
        if (apContext.apRef) {
            taf_wlanAp_Stop(apContext.apRef);
            apContext.apRef = NULL;
        }
    
        taf_wlan_TurnOff(NULL);
    }
    Copy to clipboard

Last Published: Jun 09, 2026

[Previous Topic
Wireless LAN Device Management Service](https://docs.qualcomm.com/bundle/publicresource/80-41102-2/topics/page_c_tafwlan.md) [Next Topic
Wireless LAN Station Management Service](https://docs.qualcomm.com/bundle/publicresource/80-41102-2/topics/page_c_tafwlansta.md)