Microchip® Advanced Software Framework

ble_prov.c File Reference

Handling BT related activity for provision AP.

Copyright (c) 2018-2020 Atmel Corporation. All rights reserved.

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "malloc.h"
#include "btstack_chipset_atwilc3000.h"
#include "btstack_debug.h"
#include "btstack_memory.h"
#include "btstack_run_loop.h"
#include "btstack_run_loop_freertos.h"
#include "classic/btstack_link_key_db.h"
#include "hci.h"
#include "hci_dump.h"
#include "ble_prov.h"
#include "ble_prov_db.h"
#include "btstack.h"
#include "wifi_prov.h"

Functions

static uint16_t att_read_callback (hci_con_handle_t connection_handle, uint16_t att_handle, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)
 This function is called by BT stack during attribute read. More...
 
static int att_write_callback (hci_con_handle_t connection_handle, uint16_t att_handle, uint16_t transaction_mode, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)
 This function is called by BT stack during attribute write. More...
 
static void bt_app_init (int status)
 This function is used for initializing the BT application. More...
 
void bt_task (void *arg)
 This function is called during creation of BT task. More...
 
int btstack_main (void)
 This function is called after initialization of HCI transport. More...
 
void le_prov_adv_start (void)
 This function is called to configure and start the advertisement. More...
 
void le_prov_app_setup (void)
 This function is called for application setup. More...
 
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size)
 This function is called for handling HCI Event. More...
 

Variables

TaskHandle_t btstack_run_loop_task
 
static
btstack_packet_callback_registration_t 
hci_event_callback_registration
 
const uint8_t le_prov_adv_data []
 
const uint8_t le_prov_adv_data_len = sizeof(le_prov_adv_data)
 
static uint16_t le_prov_conn_handle = 0
 
const uint8_t le_prov_scanrsp_data []
 
const uint8_t le_prov_scanrsp_data_len = sizeof(le_prov_scanrsp_data)
 
uint8_t payload_data
 
static bt_state_t state = BT_IDLE
 
static hci_transport_config_uart_t transport_config
 
static btstack_uart_config_t uart_config
 
static const btstack_uart_block_tuart_driver
 

static int att_write_callback ( hci_con_handle_t  connection_handle,
uint16_t  att_handle,
uint16_t  transaction_mode,
uint16_t  offset,
uint8_t *  buffer,
uint16_t  buffer_size 
)
static
static void bt_app_init ( int  status)
static
int btstack_main ( void  )

This function is called after initialization of HCI transport.

References hci_power_control(), HCI_POWER_ON, and le_prov_app_setup().

void le_prov_adv_start ( void  )

TaskHandle_t btstack_run_loop_task
btstack_packet_callback_registration_t hci_event_callback_registration
static
const uint8_t le_prov_adv_data[]
Initial value:
= {
}
#define BLUETOOTH_DATA_TYPE_FLAGS
bluetooth_data_types.h generated from Bluetooth SIG website for BTstack https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile
Definition: bluetooth_data_types.h:9

Referenced by le_prov_adv_start().

const uint8_t le_prov_adv_data_len = sizeof(le_prov_adv_data)

Referenced by le_prov_adv_start().

uint16_t le_prov_conn_handle = 0
static
const uint8_t le_prov_scanrsp_data[]
Initial value:
= {
0x0a, BLUETOOTH_DATA_TYPE_COMPLETE_LOCAL_NAME, 'M', 'C', 'H', 'P', '_', 'W', 'I', 'F', 'I',
}
#define BLUETOOTH_DATA_TYPE_COMPLETE_LOCAL_NAME
Definition: bluetooth_data_types.h:17
#define BLUETOOTH_DATA_TYPE_INCOMPLETE_LIST_OF_128_BIT_SERVICE_CLASS_UUIDS
Definition: bluetooth_data_types.h:14
#define WIFICON_UUID(ID16)
Definition: ble_prov.h:117

Referenced by le_prov_adv_start().

const uint8_t le_prov_scanrsp_data_len = sizeof(le_prov_scanrsp_data)

Referenced by le_prov_adv_start().

uint8_t payload_data
hci_transport_config_uart_t transport_config
static
Initial value:
= {
115200,
0,
1,
}
#define NULL
Definition: src/include/lwip/def.h:47
Definition: hci_transport.h:115
btstack_uart_config_t uart_config
static
const btstack_uart_block_t* uart_driver
static