WiFi Provisioning Implementations.
Copyright (c) 2019 Microchip Technology Inc. and its subsidiaries.
#include "provisioning_app.h"
Macros | |
#define | LED_CLEAR (0) |
#define | LED_FLASHING_FAST (60) |
#define | LED_FLASHING_MEDIUM (255) |
#define | LOCAL_STATE_CONNECTED (0x01) |
#define | LOCAL_STATE_IDLE (0x02) |
#define | LOCAL_STATE_NOT_CONNECTED (0x00) |
#define | PROVAPP_PRINTF(...) do{printf("\n\r$ "); printf(__VA_ARGS__);}while(0) |
#define | PROVAPP_PRINTF_CONT(...) do{printf(__VA_ARGS__);}while(0) |
Functions | |
void | ble_app_connected_update (at_ble_handle_t connection_handle) |
void | ble_app_disconnected_update (at_ble_handle_t connection_handle) |
void | ble_app_paired_update (at_ble_handle_t paired_handle) |
void | initialise_provisioning_app (void) |
static void | led_clear (void) |
static void | led_flash (uint32_t interval_ms) |
static void | led_toggle (void) |
void | provision_app_ble_disconnect (void) |
uint8_t | provisioning_app_processing (void) |
uint8_t | retrieve_credentials (credentials *c) |
void | send_scan_result (tstrM2mWifiscanResult *sr, uint8_t remain) |
static void | set_local_state (uint8_t s) |
at_ble_status_t | start_provisioning_app (void) |
at_ble_status_t | wifi_provision_app_credentials_update (credentials *c) |
at_ble_status_t | wifi_provision_app_scanning_handler (void) |
void | wifi_state_update (uint8_t s) |
Variables | |
static uint8_t | led_state |
static uint8_t | local_state |
static credentials | provisioned_credentials |
static wifi_provision_scanlist | scan_list |
#define LED_CLEAR (0) |
Referenced by initialise_provisioning_app(), provisioning_app_processing(), and set_local_state().
#define LED_FLASHING_FAST (60) |
Referenced by provisioning_app_processing(), and set_local_state().
#define LED_FLASHING_MEDIUM (255) |
Referenced by provisioning_app_processing(), and set_local_state().
#define LOCAL_STATE_CONNECTED (0x01) |
Referenced by ble_app_connected_update(), provisioning_app_processing(), set_local_state(), and start_provisioning_app().
#define LOCAL_STATE_IDLE (0x02) |
#define LOCAL_STATE_NOT_CONNECTED (0x00) |
Referenced by provisioning_app_processing(), set_local_state(), and start_provisioning_app().
void ble_app_connected_update | ( | at_ble_handle_t | connection_handle | ) |
References ble_connected(), LOCAL_STATE_CONNECTED, PROVAPP_PRINTF, and set_local_state().
Referenced by initialise_provisioning_app().
void ble_app_disconnected_update | ( | at_ble_handle_t | connection_handle | ) |
References ble_disconnected(), LOCAL_STATE_IDLE, PROVAPP_PRINTF, and set_local_state().
Referenced by initialise_provisioning_app().
void ble_app_paired_update | ( | at_ble_handle_t | paired_handle | ) |
Referenced by initialise_provisioning_app().
void initialise_provisioning_app | ( | void | ) |
References ble_app_connected_update(), ble_app_disconnected_update(), ble_app_paired_update(), LED_CLEAR, led_state, local_state, LOCAL_STATE_IDLE, register_ble_connected_event_cb(), register_ble_disconnected_event_cb(), register_ble_paired_event_cb(), register_wifi_provision_credentials_handler(), register_wifi_provision_scanning_handler(), wifi_provision_app_credentials_update(), and wifi_provision_app_scanning_handler().
Referenced by app_ble_wifi_provisioning().
|
static |
References nm_bsp_stop_timer(), and port_pin_set_output_level().
Referenced by provisioning_app_processing(), and set_local_state().
|
static |
References led_toggle(), nm_bsp_start_timer(), and nm_bsp_stop_timer().
Referenced by provisioning_app_processing(), and set_local_state().
|
static |
References port_pin_toggle_output_level().
Referenced by led_flash().
void provision_app_ble_disconnect | ( | void | ) |
References disconnect_ble(), LOCAL_STATE_IDLE, and set_local_state().
Referenced by app_ble_wifi_provisioning().
uint8_t provisioning_app_processing | ( | void | ) |
References LED_CLEAR, led_clear(), led_flash(), LED_FLASHING_FAST, LED_FLASHING_MEDIUM, led_state, local_state, LOCAL_STATE_CONNECTED, LOCAL_STATE_IDLE, LOCAL_STATE_NOT_CONNECTED, s, and wifi_provision_processing().
Referenced by app_ble_wifi_provisioning().
uint8_t retrieve_credentials | ( | credentials * | c | ) |
References tstrM2mWifiWepParams::au8WepKey, CREDENTIALS_NOT_VALID, CREDENTIALS_VALID, M2M_WIFI_SEC_WEP, M2M_WIFI_WEP_KEY_INDEX_1, credentials::passphrase, credentials::passphrase_length, credentials::sec_type, credentials::ssid, credentials::ssid_length, tstrM2mWifiWepParams::u8KeyIndx, tstrM2mWifiWepParams::u8KeySz, WEP_104_KEY_STRING_SIZE, WEP_40_KEY_STRING_SIZE, WIFI_PROVISION_MAX_PASS_LENGTH, and WIFI_PROVISION_MAX_SSID_LENGTH.
Referenced by app_ble_wifi_provisioning(), and wifi_provision_app_credentials_update().
void send_scan_result | ( | tstrM2mWifiscanResult * | sr, |
uint8_t | remain | ||
) |
References tstrM2mWifiscanResult::au8SSID, wifi_provision_scanlist::num_valid, _scanitem::rssi, tstrM2mWifiscanResult::s8rssi, wifi_provision_scanlist::scandetails, _scanitem::sec_type, _scanitem::ssid, tstrM2mWifiscanResult::u8AuthType, WIFI_PROVISION_MAX_AP_NUM, and wifi_provision_scanlist_receive().
Referenced by app_wifi_handle_event().
|
static |
References LED_CLEAR, led_clear(), led_flash(), LED_FLASHING_FAST, LED_FLASHING_MEDIUM, led_state, local_state, LOCAL_STATE_CONNECTED, LOCAL_STATE_IDLE, and LOCAL_STATE_NOT_CONNECTED.
Referenced by ble_app_connected_update(), ble_app_disconnected_update(), provision_app_ble_disconnect(), start_provisioning_app(), and wifi_provision_app_credentials_update().
at_ble_status_t start_provisioning_app | ( | void | ) |
References ble_is_connected(), LOCAL_STATE_CONNECTED, LOCAL_STATE_NOT_CONNECTED, provision_start(), s, and set_local_state().
Referenced by app_ble_wifi_provisioning().
at_ble_status_t wifi_provision_app_credentials_update | ( | credentials * | c | ) |
References AT_BLE_FAILURE, AT_BLE_SUCCESS, CREDENTIALS_VALID, LOCAL_STATE_IDLE, credentials::passphrase, credentials::passphrase_length, PROVAPP_PRINTF, retrieve_credentials(), s, credentials::sec_type, set_local_state(), credentials::ssid, credentials::ssid_length, WIFI_PROVISION_MAX_PASS_LENGTH, and WIFI_PROVISION_MAX_SSID_LENGTH.
Referenced by initialise_provisioning_app().
at_ble_status_t wifi_provision_app_scanning_handler | ( | void | ) |
References AT_BLE_FAILURE, AT_BLE_SUCCESS, M2M_SUCCESS, M2M_WIFI_CH_ALL, and m2m_wifi_request_scan().
Referenced by initialise_provisioning_app().
void wifi_state_update | ( | uint8_t | s | ) |
References inform_wifi_connection_state().
Referenced by app_ble_wifi_provisioning().
|
static |
Referenced by initialise_provisioning_app(), provisioning_app_processing(), and set_local_state().
|
static |
Referenced by initialise_provisioning_app(), provisioning_app_processing(), and set_local_state().
|
static |
|
static |