Microchip® Advanced Software Framework

transparent_uart_app.c File Reference

Transparent UART application.

Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.

#include "platform_files.h"
#include "bm_mode.h"
#include "bm_application_mode.h"
#include "bm_utils.h"
#include "event_mem.h"
#include "ble_api.h"
#include "sio2host.h"
#include "platform.h"
#include "ble_manager.h"
#include "transparent_uart_app.h"

Functions

static ble_status_t app_adv_report_cb (event_msg_t *msg)
 
static ble_status_t app_char_descriptor_disc_resp_cb (event_msg_t *msg)
 
static ble_status_t app_char_disc_resp_cb (event_msg_t *msg)
 
static ble_status_t app_char_value_received_cb (event_msg_t *msg)
 
static ble_status_t app_char_value_write_cb (event_msg_t *msg)
 
static ble_status_t app_cmd_complete_cb (event_msg_t *msg)
 
static ble_status_t app_config_mode_status_cb (event_msg_t *msg)
 
static ble_status_t app_conn_param_update_cb (event_msg_t *msg)
 
static ble_status_t app_connected_cb (event_msg_t *msg)
 
static ble_status_t app_disconnected_cb (event_msg_t *msg)
 
static void app_init (void)
 
static ble_status_t app_le_end_test_result_cb (event_msg_t *msg)
 
static ble_status_t app_pairing_complete_cb (event_msg_t *msg)
 
static ble_status_t app_passkey_confirm_req_cb (event_msg_t *msg)
 
static ble_status_t app_passkey_entry_req_cb (event_msg_t *msg)
 
static void app_send_transparent_uart_data (void)
 
static ble_status_t app_service_disc_resp_cb (event_msg_t *msg)
 
static ble_status_t app_status_report_cb (event_msg_t *msg)
 
static ble_status_t app_trans_data_received_cb (event_msg_t *msg)
 
void button_cb (void)
 
int main (void)
 

Variables

static const uint8_t adv_data []
 
static const ble_common_event_cb_t app_common_event_handle
 
static uint8_t app_conn_handle
 
static const ble_gap_event_cb_t app_gap_event_handle
 
static const
ble_gatt_client_event_cb_t 
app_gatt_client_event_handle
 
static const
ble_gatt_server_event_cb_t 
app_gatt_server_event_handle
 
static const ble_pairing_event_cb_t app_pairing_event_handle
 
static const
ble_gatt_transparent_event_cb_t 
app_transparent_event_handle
 
uint8_t event_buf [EVENT_BUFFER_LENGTH]
 
event_t evt_param = {.event_msg.data = event_buf, .event_msg.data_len = 0, .event_id = 0}
 

static ble_status_t app_adv_report_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_char_descriptor_disc_resp_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_char_disc_resp_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_char_value_received_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_char_value_write_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_cmd_complete_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_config_mode_status_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_conn_param_update_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_le_end_test_result_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_pairing_complete_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_passkey_confirm_req_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_passkey_entry_req_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static void app_send_transparent_uart_data ( void  )
static
static ble_status_t app_service_disc_resp_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_status_report_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t app_trans_data_received_cb ( event_msg_t msg)
static
void button_cb ( void  )

const uint8_t adv_data[]
static
Initial value:
= { 0x02,ADV_FLAGS,0x05,
0x14, ADV_COMPLETE_NAME, 'T', 'r', 'a', 'n', 's', 'p', 'a', 'r', 'e', 'n', 't', 'U', 'A', 'R', 'T', 'D', 'e', 'm', 'o',
}
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.h:112
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.h:116
const ble_common_event_cb_t app_common_event_handle
static
Initial value:
= {
.cmd_complete = app_cmd_complete_cb,
.status_report = app_status_report_cb,
.le_end_test_result = app_le_end_test_result_cb,
.config_mode_status = app_config_mode_status_cb,
}
static ble_status_t app_le_end_test_result_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:189
static ble_status_t app_config_mode_status_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:194
static ble_status_t app_cmd_complete_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:179
static ble_status_t app_status_report_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:184
uint8_t app_conn_handle
static
const ble_gap_event_cb_t app_gap_event_handle
static
Initial value:
= {
.adv_report = app_adv_report_cb,
.connected = app_connected_cb,
.disconnected = app_disconnected_cb,
.conn_param_update = app_conn_param_update_cb,
}
static ble_status_t app_disconnected_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:138
static ble_status_t app_adv_report_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:123
static ble_status_t app_connected_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:128
static ble_status_t app_conn_param_update_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:148
const ble_gatt_client_event_cb_t app_gatt_client_event_handle
static
Initial value:
= {
.service_disc_resp = app_service_disc_resp_cb,
.char_disc_resp = app_char_disc_resp_cb,
.char_descriptor_disc_resp = app_char_descriptor_disc_resp_cb,
.char_value_received = app_char_value_received_cb,
}
static ble_status_t app_service_disc_resp_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:158
static ble_status_t app_char_descriptor_disc_resp_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:168
static ble_status_t app_char_disc_resp_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:163
static ble_status_t app_char_value_received_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:174
const ble_gatt_server_event_cb_t app_gatt_server_event_handle
static
Initial value:
= {
.char_value_write = app_char_value_write_cb,
}
static ble_status_t app_char_value_write_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:153
const ble_pairing_event_cb_t app_pairing_event_handle
static
Initial value:
= {
.passkey_entry_req = app_passkey_entry_req_cb,
.pairing_complete = app_pairing_complete_cb,
.passkey_confirm_req = app_passkey_confirm_req_cb,
}
static ble_status_t app_pairing_complete_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:204
static ble_status_t app_passkey_entry_req_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:199
static ble_status_t app_passkey_confirm_req_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:209
const ble_gatt_transparent_event_cb_t app_transparent_event_handle
static
Initial value:
= {
.trans_data_received = app_trans_data_received_cb,
}
static ble_status_t app_trans_data_received_cb(event_msg_t *msg)
Definition: transparent_uart_app.c:214
uint8_t event_buf[EVENT_BUFFER_LENGTH]
event_t evt_param = {.event_msg.data = event_buf, .event_msg.data_len = 0, .event_id = 0}