XDK API  3.6.0
Documentation
Files | Macros | Functions | Variables
WlanNetworkManagement

Wlan Network Management demonstrates how to use the XDK WLAN Abstraction to scan for networks, join networks, set a static IP address or dynamically obtain an IP address via DHCP. More...

+ Collaboration diagram for WlanNetworkManagement:

Files

file  AppController.c
 

Macros

#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_APP_CONTROLLER
 
#define DELAY_15_SEC   UINT16_C(15000)
 
#define DELAY_500_MSEC   UINT16_C(500)
 
#define MINUS_ONE   UINT8_C(-1)
 
#define ONE   UINT8_C(1)
 
#define THREE   UINT8_C(3)
 
#define TWO   UINT8_C(2)
 
#define WLANNETWORK_EVENT_TIMEOUT   UINT32_C(200000)
 
#define ZERO   UINT8_C(0)
 

Functions

void AppController_Init (void *cmdProcessorHandle, uint32_t param2)
 Gives control to the Application controller. More...
 
static void AppControllerEnable (void *param1, uint32_t param2)
 To enable the necessary modules for the application. More...
 
static void AppControllerFire (void *pvParameters)
 Responsible for controlling the Wlan network management control flow. More...
 
static void AppControllerSetup (void *param1, uint32_t param2)
 To setup the necessary modules for the application. More...
 
void myDhcpIpCallbackFunc (WlanNetworkConfig_IpStatus_T returnStatus)
 NCI DHCP Callback function. This function is called by the device when an IP was acquired using DHCP. More...
 
static void ScanNetwork (void)
 Local function for scanning networks. This function also calls the SetAndGetIp function in order to set/get IP settings and connect/disconnect from a network. More...
 
static void SetAndGetIp (void)
 This function does the following : More...
 
static void WlanConnectStatusCallback (WlanNetworkConnect_Status_T status)
 

Variables

static CmdProcessor_TAppCmdProcessor
 
static xTaskHandle AppControllerHandle = NULL
 
static uint8_t dhcpFlag_mdu8
 
static SemaphoreHandle_t NetworkConfigSemaphore = NULL
 
static SemaphoreHandle_t WlanEventSemaphore = NULL
 
static WLAN_Setup_T WLANSetupInfo
 

Detailed Description

This application does the following:

This cycle repeats over and over until the OS timer expires.

Macro Definition Documentation

#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_APP_CONTROLLER
#define DELAY_15_SEC   UINT16_C(15000)

Macro used for delay function for 15 seconds

#define DELAY_500_MSEC   UINT16_C(500)

Macro used for delay function for 0,5 seconds

#define MINUS_ONE   UINT8_C(-1)

Macro for defining -1

#define ONE   UINT8_C(1)

Macro for defining 1

#define THREE   UINT8_C(3)

Macro for defining 3

#define TWO   UINT8_C(2)

Macro for defining 2

#define WLANNETWORK_EVENT_TIMEOUT   UINT32_C(200000)

Macro for wlan event timeout for simplelink

#define ZERO   UINT8_C(0)

Macro for defining 0

Function Documentation

void AppController_Init ( void *  cmdProcessorHandle,
uint32_t  param2 
)

This is a template function where the user can write his custom application.

Refer interface header for description

+ Here is the call graph for this function:

static void AppControllerEnable ( void *  param1,
uint32_t  param2 
)
static
  • LED
  • WLAN
Parameters
[in]param1Unused
[in]param2Unused

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void AppControllerFire ( void *  pvParameters)
static
  • Scan for available networks
  • Set IP, Connect, Get IP and Disconnect from network
Parameters
[in]pvParametersUnused

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void AppControllerSetup ( void *  param1,
uint32_t  param2 
)
static
  • LED
  • WLAN
Parameters
[in]param1Unused
[in]param2Unused

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void myDhcpIpCallbackFunc ( WlanNetworkConfig_IpStatus_T  returnStatus)
Parameters
[in]returnStatusEnumeration element containing the IP return status.
Returns
none.

+ Here is the caller graph for this function:

static void ScanNetwork ( void  )
static
Parameters
none.
Returns
none.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void SetAndGetIp ( void  )
static
  • disconnects from a network if connected
  • sets an IP (either static or DHCP),
  • connects to a known network
  • get the IP setting
  • disconnects from WLAN network
Parameters
none.
Returns
none.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void WlanConnectStatusCallback ( WlanNetworkConnect_Status_T  status)
static

+ Here is the caller graph for this function:

Variable Documentation

CmdProcessor_T* AppCmdProcessor
static

Handle to store the main Command processor handle to be reused by ServalPAL thread

xTaskHandle AppControllerHandle = NULL
static

OS thread handle for Application controller

uint8_t dhcpFlag_mdu8
static

callback flag for DHCP; let user know that the DHCP IP was acquired

SemaphoreHandle_t NetworkConfigSemaphore = NULL
static
SemaphoreHandle_t WlanEventSemaphore = NULL
static
WLAN_Setup_T WLANSetupInfo
static
Initial value:
=
{
.IsEnterprise = false,
.IsHostPgmEnabled = false,
.SSID = WLAN_SSID,
.Username = WLAN_PSK,
.Password = WLAN_PSK,
.IsStatic = WLAN_STATIC_IP,
.IpAddr = WLAN_IP_ADDR,
.GwAddr = WLAN_GW_ADDR,
.DnsAddr = WLAN_DNS_ADDR,
.Mask = WLAN_MASK,
}
#define WLAN_DNS_ADDR
Definition: AppController.h:101
#define WLAN_PSK
Definition: AppController.h:75
#define WLAN_GW_ADDR
Definition: AppController.h:94
#define WLAN_IP_ADDR
Definition: AppController.h:87
#define WLAN_SSID
Definition: AppController.h:69
#define WLAN_STATIC_IP
Definition: AppController.h:80
#define WLAN_MASK
Definition: AppController.h:108

WLAN setup parameters


All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:55 by doxygen 1.8.8