Microchip® Advanced Software Framework

thirdparty/wireless/ble_sdk/ble_profiles/cscp/cscp.c File Reference

Custom Serial Chat Profile.

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

#include <asf.h>
#include "string.h"
#include "ble_utils.h"
#include "ble_manager.h"
#include "cscp.h"
#include "cscs.h"

Functions

at_ble_status_t csc_notification_confirmation_handler (void *params)
 csc_notification_confirmation_handler called by ble manager to give the status of notification sent More...
 
void csc_prf_buf_init (uint8_t *databuf, uint16_t datalen)
 buffer initialization function More...
 
at_ble_status_t csc_prf_char_changed_handler (void *params)
 characteristic change handler function More...
 
at_ble_status_t csc_prf_characteristic_found_handler (void *params)
 characteristic found handler invoked by ble manager More...
 
at_ble_status_t csc_prf_connected_state_handler (void *params)
 Connection handler invoked by ble manager. More...
 
at_ble_status_t csc_prf_descriptor_found_handler (void *params)
 client descriptor found handler invoked by ble manager More...
 
void csc_prf_dev_adv (void)
 device advertisement handler function More...
 
at_ble_status_t csc_prf_disconnect_event_handler (void *params)
 device disconnected handler function More...
 
at_ble_status_t csc_prf_discovery_complete_handler (void *params)
 Discovery Complete handler invoked by ble manager. More...
 
void csc_prf_init (void *param)
 profile initialization function More...
 
at_ble_status_t csc_prf_notification_handler (void *params)
 invoked by ble manager on receiving notification More...
 
void csc_prf_send_data (uint8_t *databuf, uint16_t datalen)
 profile send data function More...
 
at_ble_status_t csc_prf_service_found_handler (void *params)
 Service found handler invoked by ble manager. More...
 
at_ble_status_t csc_prf_write_notification_handler (void *params)
 invoked by ble manager for setting the notification More...
 
void notify_recv_ntf_handler (recv_ntf_callback_t recv_ntf_fn)
 to user about the new data received More...
 

Variables

app_csc_data_t app_csc_info
 
static const ble_gap_event_cb_t csc_gap_handle
 
static const
ble_gatt_client_event_cb_t 
csc_gatt_client_handle
 
static const
ble_gatt_server_event_cb_t 
csc_gatt_server_handle
 
recv_ntf_callback_t recv_ntf_cb
 

at_ble_status_t csc_notification_confirmation_handler ( void *  params)

csc_notification_confirmation_handler called by ble manager to give the status of notification sent

Notification confirmation handler.

Parameters
[in]at_ble_cmd_complete_event_taddress of the cmd completion

References AT_BLE_SUCCESS, DBG_LOG_DEV, and at_ble_cmd_complete_event_t::status.

void csc_prf_buf_init ( uint8_t *  databuf,
uint16_t  datalen 
)

buffer initialization function

CSC profile buffer initialization.

References app_csc_data::buff_len, and app_csc_data::buff_ptr.

at_ble_status_t csc_prf_char_changed_handler ( void *  params)

characteristic change handler function

Service characteristic change handler function.

References AT_BLE_SUCCESS.

at_ble_status_t csc_prf_characteristic_found_handler ( void *  params)

characteristic found handler invoked by ble manager

Handler for characteristic found.

References AT_BLE_SUCCESS, and app_csc_data::csc_char.

at_ble_status_t csc_prf_descriptor_found_handler ( void *  params)

client descriptor found handler invoked by ble manager

Handler for descriptor found.

References AT_BLE_SUCCESS, and app_csc_data::csc_desc.

at_ble_status_t csc_prf_disconnect_event_handler ( void *  params)

device disconnected handler function

References ALL_UNUSED, AT_BLE_SUCCESS, and app_csc_data::devicedb.

void csc_prf_send_data ( uint8_t *  databuf,
uint16_t  datalen 
)

profile send data function

CSC profile send data function.

References app_csc_data::buff_len, app_csc_data::conn_params, csc_serv_send_data(), and at_ble_connected_t::handle.

at_ble_status_t csc_prf_service_found_handler ( void *  params)

Service found handler invoked by ble manager.

Handler for service found.

References AT_BLE_SUCCESS, app_csc_data::csc_serv, and DBG_LOG_DEV.

at_ble_status_t csc_prf_write_notification_handler ( void *  params)

invoked by ble manager for setting the notification

Handler for configuring the notification for remote device.

References at_ble_characteristic_write(), AT_BLE_FAILURE, AT_BLE_SUCCESS, at_ble_descriptor_found_t::conn_handle, app_csc_data::csc_desc, data, DBG_LOG, at_ble_descriptor_found_t::desc_handle, and UNUSED.

void notify_recv_ntf_handler ( recv_ntf_callback_t  recv_ntf_fn)

to user about the new data received

Function call the user defined callback for sending the receive data.

References recv_ntf_cb.

app_csc_data_t app_csc_info
const ble_gap_event_cb_t csc_gap_handle
static
Initial value:
= {
.encryption_status_changed = csc_prf_write_notification_handler
}
at_ble_status_t csc_prf_disconnect_event_handler(at_ble_disconnected_t *disconnect)
device disconnected handler function
Definition: common/components/wifi/winc3400/ble/ble_profiles/cscp/cscp.c:239
void csc_prf_connected_state_handler(at_ble_connected_t *params)
Connection handler invoked by ble manager.
Definition: common/components/wifi/winc3400/ble/ble_profiles/cscp/cscp.c:127
void csc_prf_write_notification_handler(void *param)
invoked by ble manager for setting the notification
Definition: common/components/wifi/winc3400/ble/ble_profiles/cscp/cscp.c:226
  • Scan response data */
const ble_gatt_client_event_cb_t csc_gatt_client_handle
static
Initial value:
= {
.primary_service_found = csc_prf_service_found_handler,
.characteristic_found = csc_prf_characteristic_found_handler,
.descriptor_found = csc_prf_descriptor_found_handler,
.discovery_complete = csc_prf_discovery_complete_handler,
.notification_recieved = csc_prf_notification_handler
}
void csc_prf_service_found_handler(at_ble_primary_service_found_t *params)
Service found handler invoked by ble manager.
Definition: common/components/wifi/winc3400/ble/ble_profiles/cscp/cscp.c:185
void csc_prf_characteristic_found_handler(at_ble_characteristic_found_t *params)
characteristic found handler invoked by ble manager
Definition: common/components/wifi/winc3400/ble/ble_profiles/cscp/cscp.c:194
void csc_prf_discovery_complete_handler(at_ble_discovery_complete_t *params)
Discovery Complete handler invoked by ble manager.
Definition: common/components/wifi/winc3400/ble/ble_profiles/cscp/cscp.c:146
void csc_prf_descriptor_found_handler(at_ble_descriptor_found_t *params)
client descriptor found handler invoked by ble manager
Definition: common/components/wifi/winc3400/ble/ble_profiles/cscp/cscp.c:203
void csc_prf_notification_handler(at_ble_notification_received_t *params)
invoked by ble manager on receiving notification
Definition: common/components/wifi/winc3400/ble/ble_profiles/cscp/cscp.c:212
const ble_gatt_server_event_cb_t csc_gatt_server_handle
static
Initial value:
= {
.notification_confirmed = csc_notification_confirmation_handler,
.characteristic_changed = csc_prf_char_changed_handler
}
at_ble_status_t csc_prf_char_changed_handler(at_ble_characteristic_changed_t *change_char)
characteristic change handler function
Definition: common/components/wifi/winc3400/ble/ble_profiles/cscp/cscp.c:257
at_ble_status_t csc_notification_confirmation_handler(void *params)
csc_notification_confirmation_handler called by ble manager to give the status of notification sent ...
Definition: thirdparty/wireless/ble_sdk/ble_profiles/cscp/cscp.c:282
recv_ntf_callback_t recv_ntf_cb