Skip to content

This library provides a set of APIs that are useful to establish and monitor Wi-Fi connections on Cypress platforms that support Wi-Fi connectivity

License

Notifications You must be signed in to change notification settings

Infineon/wifi-connection-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wi-Fi Connection Manager (WCM)

WCM is a library which helps application developers to manage Wi-Fi connectivity. The library provides a set of APIs that can be used to establish and monitor Wi-Fi connections on Infineon platforms that support Wi-Fi connectivity.

The library APIs are thread-safe. The library monitors the Wi-Fi connection and can notifies connection state changes through an event notification mechanism. The library also provides APIs to connect to a Wi-Fi network using Wi-Fi Protected Setup (WPS) methods.

Multi-core architecture and virtual API support

The library supports multi-core architecture by making a subset of APIs available as virtual APIs. The virtualization of the WCM library helps to access the WCM APIs defined in one core from the other core using Inter Process Communication (IPC). The WCM can now be run on two cores simultaneously, with one core containing the full connectivity stack (primary core) and the other core containing the subset of virtual-only APIs (secondary core).

The virtual APIs pipe the API requests over IPC to the primary core where the API is actually executed and the result is passed back to the secondary core. This virtualization abstracts out the implementation details and complexity of IPC, thus making multi-core connectivity application development simple.

For more information on virtualization, see the Virtual Connectivity Manager library.

Features and functionality

The current implementation has the following features and functionality:

  • Supports WPA3 personal network security
  • Supports STA, SoftAP, and Concurrent (simultaneous Soft-AP + STA) modes
  • Support for WPS - Enrollee role
  • Exposes Wi-Fi APIs to scan, join, and leave the Wi-Fi network
  • Connection monitoring: Monitors active connections and link events. Automatically reconnects to the AP if the connection with the AP is lost intermittently. Notifies the connection state change through the event notification registration mechanism.
  • Supports connectivity applications based on either FreeRTOS, lwIP, mbed TLS combination or ThreadX, NetX Duo, NetX Secure combination(Currently only supported on CYW955913EVK-01)
  • Built on top of the abstraction-rtos library that provides the RTOS abstraction API for FreeRTOS and ThreadX
  • Supports multi-core architecture by providing the following APIs as virtual APIs:
    • cy_wcm_is_connected_to_ap
    • cy_wcm_register_event_callback
    • cy_wcm_deregister_event_callback

Supported platforms

This library and its features are supported on the following Infineon platforms:

Note: Virtual APIs are supported on all PSoC 62 devices, but they have only been tested on the CY8CEVAL-062S2-MUR-43439M2 kit.

Dependent libraries

This library depends on the following:

If virtual APIs are to be used, it additionally depends on the Virtual Connectivity Manager.

Quick start

  1. To use wifi-connection-manager library for FreeRTOS, lwIP, mbed TLS combination, the application should pull the wifi-core-freertos-lwip-mbedtls library which will internally pull wifi-connection-manager, FreeRTOS, lwIP, mbed TLS, and other dependent modules.

    To pull wifi-core-freertos-lwip-mbedtls, create the wifi-core-freertos-lwip-mbedtls.mtb file.

  2. To use wifi-connection-manager library for ThreadX, NetX Duo, NetX Secure combination, the application should pull the wifi-core-threadx-cat5 library which will internally pull wifi-connection-manager and other dependent modules.

    To pull wifi-core-threadx-cat5, create the wifi-core-threadx-cat5.mtb file.

  3. For existing Wi-Fi Connection Manager version 2.x users, a porting guide is available to migrate to Wi-Fi Connection Manager version 3.0.

  4. Review the pre-defined configuration files bundled with the wifi-core-freertos-lwip-mbedtls library for FreeRTOS, lwIP, and mbed TLS and make adjustments. See the "Quick start" section in README.md.

  5. Define a set of COMPONENTS in the code example project's Makefile for this library.

    • For FreeRTOS, lwIP, Mbed TLS combination see the "Quick start" section in README.md
    • For ThreadX, NetX Duo, NetX Secure combination see the "Quick start" section in README.md
  6. WPS is disabled by default. WPS uses Mbed TLS security stack. Enable the following components for WPS:

    COMPONENTS+=WPS MBEDTLS
    
  7. The WCM library disables all the debug log messages by default. To enable log messages, the application must perform the following:

    1. Add the ENABLE_WCM_LOGS macro to the DEFINES in the code example's Makefile. The Makefile entry would look like as follows:

      DEFINES+=ENABLE_WCM_LOGS
      
    2. Call the cy_log_init() function provided by the cy-log module. cy-log is part of the connectivity-utilities library. See connectivity-utilities library API documentation.

Virtual API usage

  • To use virtual WCM APIs pull Virtual Connectivity Manager library. Create the following .mtb file to pull the library
    • virtual-connectivity-manager.mtb: https://github.com/Infineon/virtual-connectivity-manager#latest-v1.X#$$ASSET_REPO$$/virtual-connectivity-manager/latest-v1.X

Note: To use WCM APIs in a multi-core environment, applications on both the cores should include WCM and VCM libraries.

  • Define the following compile-time macro in the primary core application's Makefile:

    DEFINES+=ENABLE_MULTICORE_CONN_MW
    
  • Define the following compile-time macros in the secondary core application's Makefile:

    DEFINES+=ENABLE_MULTICORE_CONN_MW USE_VIRTUAL_API
    
  • Call the cy_vcm_init() function provided by the VCM library from the application on both cores, before invoking the virtual WCM APIs.

    See Virtual Connectivity Manager library API documentation.

Notes:

  • To ensure that the VCM initialization is synchronized, the project which boots first(i.e CM0+ project in case of psoc62) must call cy_vcm_init before bringing up the second project(i.e CM4 project in case of psoc62).
  • The first project must initialize VCM, by passing config.hal_resource_opt as CY_VCM_CREATE_HAL_RESOURCE in cy_vcm_init. The second project must pass config.hal_resource_opt as CY_VCM_USE_HAL_RESOURCE.

Additional information

About

This library provides a set of APIs that are useful to establish and monitor Wi-Fi connections on Cypress platforms that support Wi-Fi connectivity

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages