Provision AP with BLE example.
Copyright (c) 2021 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include "common/include/nm_common.h"
#include "driver/include/m2m_wifi.h"
#include "driver/include/m2m_periph.h"
#include "main.h"
#include "m2m_ble.h"
#include "at_ble_api.h"
#include "wifi_prov.h"
#include "utils/ble_utils.h"
Macros | |
#define | APP_STATE_COMPLETED 4 |
#define | APP_STATE_IDLE 0 |
#define | APP_STATE_PROVISIONING 2 |
#define | APP_STATE_WAITING_FOR_WIFI_CONNECTION 3 |
#define | APP_STATE_WAITING_FOR_WIFI_DISCONNECTION 1 |
#define | HEX2ASCII(x) (((x)>=10)? (((x)-10)+'A') : ((x)+'0')) |
#define | STRING_HEADER |
Functions | |
static at_ble_event_parameter_t gu8BleParam | __aligned (4) |
static void | app_ble_wifi_provisioning (void) |
static void | app_wifi_handle_event (uint8 u8MsgType, void *pvMsg) |
static void | app_wifi_init (tpfAppWifiCb wifi_cb_func) |
static void | configure_console (void) |
int | main (void) |
static void | timer_cb (void) |
Variables | |
static uint8 | gu8ScanIndex |
static volatile uint8 | gu8WiFiConnectionState = M2M_WIFI_UNDEF |
#define APP_STATE_COMPLETED 4 |
Referenced by app_ble_wifi_provisioning().
#define APP_STATE_IDLE 0 |
Referenced by app_ble_wifi_provisioning().
#define APP_STATE_PROVISIONING 2 |
Referenced by app_ble_wifi_provisioning().
#define APP_STATE_WAITING_FOR_WIFI_CONNECTION 3 |
Referenced by app_ble_wifi_provisioning().
#define APP_STATE_WAITING_FOR_WIFI_DISCONNECTION 1 |
Referenced by app_ble_wifi_provisioning().
#define HEX2ASCII | ( | x | ) | (((x)>=10)? (((x)-10)+'A') : ((x)+'0')) |
Referenced by app_wifi_init().
#define STRING_HEADER |
Referenced by main().
|
static |
|
static |
References APP_STATE_COMPLETED, APP_STATE_IDLE, APP_STATE_PROVISIONING, APP_STATE_WAITING_FOR_WIFI_CONNECTION, APP_STATE_WAITING_FOR_WIFI_DISCONNECTION, AT_BLE_AUTH_NO_MITM_NO_BOND, AT_BLE_SUCCESS, ble_prov_get_credentials(), ble_prov_get_provision_state(), ble_prov_init(), ble_prov_process_event(), ble_prov_start(), BLE_PROV_STATE_FAILED, BLE_PROV_STATE_SUCCESS, ble_prov_stop(), ble_prov_wifi_con_update, CREDENTIALS_VALID, gu8WiFiConnectionState, m2m_ble_event_get(), m2m_ble_init(), M2M_WIFI_CH_ALL, m2m_wifi_connect(), M2M_WIFI_CONNECTED, m2m_wifi_disconnect(), M2M_WIFI_DISCONNECTED, m2m_wifi_req_restrict_ble(), m2m_wifi_req_unrestrict_ble(), M2M_WIFI_UNDEF, nm_bsp_start_timer(), nm_bsp_stop_timer(), credentials::passphrase, credentials::sec_type, credentials::ssid, credentials::ssid_length, timer_cb(), WIFIPROV_CON_STATE_CONNECTED, WIFIPROV_CON_STATE_CONNECTING, and WIFIPROV_CON_STATE_DISCONNECTED.
Referenced by main().
|
static |
References ble_prov_scan_result(), gu8ScanIndex, gu8WiFiConnectionState, M2M_WIFI_CONNECTED, M2M_WIFI_DISCONNECTED, m2m_wifi_get_num_ap_found(), M2M_WIFI_REQ_DHCP_CONF, m2m_wifi_req_scan_result(), M2M_WIFI_RESP_CON_STATE_CHANGED, M2M_WIFI_RESP_SCAN_DONE, M2M_WIFI_RESP_SCAN_RESULT, tstrM2MIPConfig::u32StaticIP, tstrM2mWifiStateChanged::u8CurrState, and tstrM2mScanDone::u8NumofCh.
Referenced by main().
|
static |
References tstrEthInitParam::au8ethRcvBuf, HEX2ASCII, m2m_ble_wifi_init(), M2M_DEVICE_NAME, M2M_ERR, M2M_INFO, M2M_LISTEN_INTERVAL, m2m_memset(), M2M_NO_PS, M2M_PS_DEEP_AUTOMATIC, M2M_PS_MANUAL, m2m_strlen(), M2M_SUCCESS, m2m_wifi_get_mac_address(), m2m_wifi_get_otp_mac_address(), m2m_wifi_set_device_name(), m2m_wifi_set_lsn_int(), m2m_wifi_set_mac_address(), m2m_wifi_set_sleep_mode(), MAC_ADDRESS, tstrEthInitParam::pfAppEthCb, tstrWifiInitParam::pfAppWifiCb, tstrWifiInitParam::strEthInitParam, tstrEthInitParam::u16ethRcvBufSize, and tstrM2mLsnInt::u16LsnInt.
Referenced by main().
|
static |
References uart_rs232_options::baudrate, CONF_UART, CONF_UART_BAUDRATE, CONF_UART_CHAR_LENGTH, CONF_UART_PARITY, CONF_UART_STOP_BITS, CONSOLE_UART_ID, stdio_serial_init(), and sysclk_enable_peripheral_clock().
Referenced by main().
int main | ( | void | ) |
|
static |
Referenced by app_ble_wifi_provisioning().
|
static |
Referenced by app_wifi_handle_event().
|
static |
Referenced by app_ble_wifi_provisioning(), and app_wifi_handle_event().