Microchip® Advanced Software Framework

thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c File Reference
#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_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().

at_ble_status_t l2cap_credit_indication ( void *  params)
static at_ble_status_t l2cap_custom_event ( void *  param)
static
at_ble_status_t l2cap_disconnect ( void *  params)
at_ble_status_t l2cap_send_resp ( void *  params)
static void timer_callback_handler ( void  )
static

user_custom_event_t app_timer_event
Initial value:
=
{
.bptr = NULL
}
#define APP_TIMER_EVENT_ID
Definition: thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c:111
#define NULL
Definition: nm_bsp.h:64
const ble_l2cap_event_cb_t at_ble_mgr_l2cap_event_handle
static
Initial value:
= {
.lecb_connected = l2cap_connected,
.lecb_disconnected=l2cap_disconnect,
.lecb_send_resp=l2cap_send_resp,
.lecb_data_recieved=l2cap_data_recv,
.lecb_conn_req=l2cap_conn_req,
.lecb_add_credit_ind=l2cap_credit_indication
}
at_ble_status_t l2cap_credit_indication(void *params)
Definition: thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c:324
at_ble_status_t l2cap_conn_req(void *params)
Definition: thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c:333
at_ble_status_t l2cap_data_recv(void *params)
Definition: thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c:304
at_ble_status_t l2cap_connected(void *parma)
Definition: thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c:285
at_ble_status_t l2cap_disconnect(void *params)
Definition: thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c:343
at_ble_status_t l2cap_send_resp(void *params)
Definition: thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c:297
const ble_gap_event_cb_t ble_mgr_l2cap_gap_handle
static
Initial value:
= {
.scan_info=ble_scan_info,
.connected =ble_l2cap_connected,
.disconnected=ble_l2cap_disconnected
}
at_ble_status_t ble_scan_info(void *params)
Definition: thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c:214
at_ble_status_t ble_l2cap_disconnected(void *params)
Definition: thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c:276
at_ble_status_t ble_l2cap_connected(void *params)
Definition: thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c:257
uint16_t dest_credit = 0
static
at_ble_addr_t device1 = {AT_BLE_ADDRESS_PUBLIC, {0xAB, 0xCD, 0xEF, 0xBA, 0xDC, 0xFE}}
uint32_t gu32NumOfRecv = 0
static

Referenced by l2cap_data_recv(), and main().

const ble_custom_event_cb_t l2cap_custom_event_cb
static
Initial value:
= {
.custom_event = l2cap_custom_event
}
static at_ble_status_t l2cap_custom_event(void *param)
Definition: thirdparty/wireless/ble_sdk/apps/l2cap_central/main.c:169
uint32_t time_count =0
static

Referenced by l2cap_custom_event().

bool volatile timer_cb_done = false