#include <asf.h>
#include "platform.h"
#include "console_serial.h"
#include "timer_hw.h"
#include "ble_utils.h"
#include "at_ble_api.h"
#include "ble_manager.h"
#include "at_ble_trace.h"
#include "conf_extint.h"
Macros | |
#define | APP_CID 0x40 |
#define | APP_CREDIT 0x7FFF |
#define | APP_DATA_LEN 507 |
#define | APP_PSM 0x80 |
#define | APP_TIMER_EVENT_ID (1) |
#define | AT_BLE_INQ_SCAN_INTV (0x0140) |
#define | AT_BLE_INQ_SCAN_WIND (0x0050) |
#define | CONN_EVENT (2 * CONN_INTERVAL) |
#define | CONN_EVT_1000_5_MS 0x0640 |
#define | CONN_EVT_100_5_MS 0x00A0 |
#define | CONN_EVT_10_5_MS 0x0010 |
#define | CONN_EVT_7_5_MS 0x000C |
#define | CONN_INTERVAL CONN_INTERVAL_7_5_MS |
#define | CONN_INTERVAL_1000_0_MS 0x0320 |
#define | CONN_INTERVAL_100_0_MS 0x0050 |
#define | CONN_INTERVAL_10_0_MS 0x0008 |
#define | CONN_INTERVAL_7_5_MS 0x0006 |
#define | TIMER_INTERVAL (1) |
Functions | |
static at_ble_status_t | app_init (void) |
at_ble_status_t | ble_l2cap_connected (void *params) |
at_ble_status_t | ble_l2cap_disconnected (void *params) |
at_ble_status_t | ble_scan_info (void *params) |
at_ble_status_t | l2cap_conn_req (void *params) |
at_ble_status_t | l2cap_connected (void *parma) |
at_ble_status_t | l2cap_credit_indication (void *params) |
static at_ble_status_t | l2cap_custom_event (void *param) |
at_ble_status_t | l2cap_data_recv (void *params) |
at_ble_status_t | l2cap_disconnect (void *params) |
at_ble_status_t | l2cap_send_resp (void *params) |
int | main (void) |
static void | timer_callback_handler (void) |
Variables | |
user_custom_event_t | app_timer_event |
static const ble_l2cap_event_cb_t | at_ble_mgr_l2cap_event_handle |
static const ble_gap_event_cb_t | ble_mgr_l2cap_gap_handle |
static uint16_t | dest_credit = 0 |
at_ble_addr_t | device1 = {AT_BLE_ADDRESS_PUBLIC, {0xAB, 0xCD, 0xEF, 0xBA, 0xDC, 0xFE}} |
at_ble_handle_t | gstHandle = 0xFFFF |
static uint32_t | gu32NumOfRecv = 0 |
static const ble_custom_event_cb_t | l2cap_custom_event_cb |
static uint32_t | time_count =0 |
bool volatile | timer_cb_done = false |
#define APP_CID 0x40 |
Referenced by ble_l2cap_connected().
#define APP_CREDIT 0x7FFF |
Referenced by ble_l2cap_connected().
#define APP_DATA_LEN 507 |
Referenced by main().
#define APP_PSM 0x80 |
Referenced by ble_l2cap_connected(), ble_l2cap_disconnected(), l2cap_conn_req(), l2cap_data_recv(), and l2cap_disconnect().
#define APP_TIMER_EVENT_ID (1) |
Referenced by l2cap_custom_event().
#define AT_BLE_INQ_SCAN_INTV (0x0140) |
Referenced by app_init(), and ble_l2cap_disconnected().
#define AT_BLE_INQ_SCAN_WIND (0x0050) |
Referenced by app_init(), and ble_l2cap_disconnected().
#define CONN_EVENT (2 * CONN_INTERVAL) |
Referenced by ble_scan_info().
#define CONN_EVT_1000_5_MS 0x0640 |
#define CONN_EVT_100_5_MS 0x00A0 |
#define CONN_EVT_10_5_MS 0x0010 |
#define CONN_EVT_7_5_MS 0x000C |
#define CONN_INTERVAL CONN_INTERVAL_7_5_MS |
Referenced by ble_scan_info().
#define CONN_INTERVAL_1000_0_MS 0x0320 |
#define CONN_INTERVAL_100_0_MS 0x0050 |
#define CONN_INTERVAL_10_0_MS 0x0008 |
#define CONN_INTERVAL_7_5_MS 0x0006 |
#define TIMER_INTERVAL (1) |
Referenced by l2cap_data_recv(), and main().
|
static |
References addr, at_ble_addr_get(), at_ble_addr_set(), AT_BLE_ADDRESS_PUBLIC, AT_BLE_INQ_SCAN_INTV, AT_BLE_INQ_SCAN_WIND, AT_BLE_SCAN_ACTIVE, AT_BLE_SCAN_OBSERVER_MODE, at_ble_scan_start(), AT_BLE_SUCCESS, at_ble_whitelist_add(), and DBG_LOG.
Referenced by main().
at_ble_status_t ble_l2cap_connected | ( | void * | params | ) |
at_ble_status_t ble_l2cap_disconnected | ( | void * | params | ) |
at_ble_status_t ble_scan_info | ( | void * | params | ) |
References at_ble_addr_t::addr, at_ble_connect(), AT_BLE_CONNECTION_DIRECT, at_ble_scan_stop(), at_ble_set_conn_mode(), AT_BLE_SUCCESS, at_ble_connection_params_t::ce_len_max, at_ble_connection_params_t::ce_len_min, at_ble_connection_params_t::con_intv_max, at_ble_connection_params_t::con_intv_min, at_ble_connection_params_t::con_latency, CONN_EVENT, CONN_INTERVAL, DBG_LOG, at_ble_scan_info_t::dev_addr, params, and at_ble_connection_params_t::superv_to.
at_ble_status_t l2cap_conn_req | ( | void * | params | ) |
References APP_PSM, at_ble_lecb_cfm(), AT_BLE_LECB_SUCCESS, DBG_LOG_DEV, dest_credit, at_ble_lecb_conn_req_t::dest_credit, gstHandle, and params.
at_ble_status_t l2cap_connected | ( | void * | parma | ) |
at_ble_status_t l2cap_credit_indication | ( | void * | params | ) |
References AT_BLE_SUCCESS, DBG_LOG, dest_credit, at_ble_lecb_add_credit_ind_t::dest_credit, and params.
|
static |
References APP_TIMER_EVENT_ID, AT_BLE_FAILURE, AT_BLE_SUCCESS, hw_timer_stop(), status, time_count, and timer_cb_done.
at_ble_status_t l2cap_data_recv | ( | void * | params | ) |
at_ble_status_t l2cap_disconnect | ( | void * | params | ) |
References APP_PSM, at_ble_lecb_destroy(), DBG_LOG, gstHandle, params, and at_ble_lecb_disconnected_t::reason.
at_ble_status_t l2cap_send_resp | ( | void * | params | ) |
References AT_BLE_SUCCESS, DBG_LOG, params, and at_ble_lecb_send_rsp_t::status.
int main | ( | void | ) |
References APP_DATA_LEN, app_init(), AT_BLE_SUCCESS, BLE_CUSTOM_EVENT_TYPE, ble_device_init(), ble_event_task(), BLE_GAP_EVENT_TYPE, BLE_L2CAP_EVENT_TYPE, ble_mgr_events_callback_handler(), board_init(), DBG_LOG, delay_init(), gu32NumOfRecv, hw_timer_init(), hw_timer_register_callback(), NULL, REGISTER_CALL_BACK, serial_console_init(), system_init(), timer_callback_handler(), and timer_cb_done.
|
static |
References at_ble_event_user_defined_post().
user_custom_event_t app_timer_event |
|
static |
|
static |
|
static |
Referenced by l2cap_conn_req(), l2cap_connected(), and l2cap_credit_indication().
at_ble_addr_t device1 = {AT_BLE_ADDRESS_PUBLIC, {0xAB, 0xCD, 0xEF, 0xBA, 0xDC, 0xFE}} |
at_ble_handle_t gstHandle = 0xFFFF |
Referenced by at_app_send_lecb(), ble_l2cap_connected(), ble_l2cap_disconnected(), l2cap_conn_req(), l2cap_data_recv(), and l2cap_disconnect().
|
static |
Referenced by l2cap_data_recv(), and main().
|
static |
|
static |
Referenced by l2cap_custom_event().