Microchip® Advanced Software Framework

ble_host_sdk/ble_services/ble_mgr/ble_manager.c File Reference
#include "platform_files.h"
#include "bm_mode.h"
#include "event_mem.h"
#include "bm_application_mode.h"
#include "ble_api.h"
#include "platform.h"
#include "ble_manager.h"

Functions

static ble_status_t ble_mgr_adv_report_cb (event_msg_t *msg)
 
ble_status_t ble_mgr_adv_start (const uint8_t *adv_data, uint8_t adv_data_length, const uint8_t *scan_resp_data, uint8_t scan_reap_data_len)
 Set advertisement data, scan response data, advertisement parameters and start advertisement. More...
 
ble_status_t ble_mgr_adv_stop (void)
 Stops ongoing advertisement. More...
 
static ble_status_t ble_mgr_char_descriptor_disc_resp_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_char_disc_resp_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_char_value_received_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_char_value_write_cb (event_msg_t *msg)
 
ble_status_t ble_mgr_characteristic_indicate_set (ble_handle_t conn_handle, uint16_t desc_handle, bool enabled)
 Enable/disable characteristic indication. More...
 
ble_status_t ble_mgr_characteristic_notify_set (ble_handle_t conn_handle, uint16_t desc_handle, bool enabled)
 Enable/disable characteristic notification. More...
 
bool ble_mgr_check_match_param (ble_mgr_adv_report_event_t *adv_report)
 Check against the matching parameter set by the user, it could be BLE address, RSSI threshold or advertisement payload. More...
 
static ble_status_t ble_mgr_cmd_complete_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_config_mode_status_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_conn_param_update_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_connected_cb (event_msg_t *msg)
 
ble_status_t ble_mgr_device_init (void)
 Initialize platform, callback events and BLE interface. More...
 
static ble_status_t ble_mgr_disconnected_cb (event_msg_t *msg)
 
static void ble_mgr_event_manager (event_t *event_param)
 
bool ble_mgr_events_register_callback (ble_mgr_event_t event_type, const void *ble_event_handler)
 Register callback functions for BLE events. More...
 
static ble_status_t ble_mgr_execute_write_repose_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_execute_write_request_cb (event_msg_t *msg)
 
event_status_t ble_mgr_get_event (event_t *event)
 Get BLE events and process them. More...
 
static void ble_mgr_init (void)
 Registers BLE manager event callbacks. More...
 
static ble_status_t ble_mgr_le_end_test_result_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_pairing_complete_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_passkey_confirm_req_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_passkey_entry_req_cb (event_msg_t *msg)
 
void ble_mgr_peripheral_device_match_params (ble_mgr_adv_report_match_param_t *match_param)
 Sets a matching parameter to find and connect with the device. More...
 
static ble_status_t ble_mgr_prepare_write_repose_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_prepare_write_request_cb (event_msg_t *msg)
 
ble_status_t ble_mgr_scan_start (void)
 Sets BLE scan parameters and starts scanning. More...
 
ble_status_t ble_mgr_scan_stop (void)
 Stops the ongoing BLE scan. More...
 
static ble_status_t ble_mgr_service_disc_resp_cb (event_msg_t *msg)
 
ble_status_t ble_mgr_start_connection (ble_addr_t *address)
 Initiate a connection based on remote device address. More...
 
static ble_status_t ble_mgr_status_report_cb (event_msg_t *msg)
 
static ble_status_t ble_mgr_trans_data_received_cb (event_msg_t *msg)
 
ble_status_t ble_mgr_transparent_uart_disable (ble_handle_t conn_handle)
 Disables transparentUART with remote device. More...
 
ble_status_t ble_mgr_transparent_uart_enable (ble_handle_t conn_handle)
 Enables transparentUART with remote device. More...
 
ble_status_t ble_mgr_transparent_uart_send (ble_handle_t conn_handle, const uint8_t *data, uint8_t datalen)
 Sends transparentUART data to remote device. More...
 

Variables

static ble_mgr_adv_report_event_t ble_mgr_adv_report_list = {0}
 
static
ble_mgr_adv_report_match_param_t 
ble_mgr_adv_report_match_param = {0}
 
ble_common_event_cb_tble_mgr_common_event_cb [MAX_COMMON_EVENT_SUBSCRIBERS] = {NULL, }
 
static const ble_common_event_cb_t ble_mgr_common_event_handle
 
ble_gap_event_cb_tble_mgr_gap_event_cb [MAX_GAP_EVENT_SUBSCRIBERS] = {NULL, }
 
static const ble_gap_event_cb_t ble_mgr_gap_event_handle
 
ble_gatt_client_event_cb_tble_mgr_gatt_client_event_cb [MAX_GATT_CLIENT_EVENT_SUBSCRIBERS] = {NULL, }
 
static const
ble_gatt_client_event_cb_t 
ble_mgr_gatt_client_event_handle
 
ble_gatt_server_event_cb_tble_mgr_gatt_server_event_cb [MAX_GATT_SERVER_EVENT_SUBSCRIBERS] = {NULL, }
 
static const
ble_gatt_server_event_cb_t 
ble_mgr_gatt_server_event_handle
 
ble_gatt_transparent_event_cb_tble_mgr_gatt_tp_event_cb [MAX_GATT_TRANSPARENT_SUBSCRIBERS] = {NULL, }
 
ble_pairing_event_cb_tble_mgr_pairing_event_cb [MAX_PAIRING_SUBSCRIBERS] = {NULL, }
 
static const ble_pairing_event_cb_t ble_mgr_pairing_event_handle
 
ble_mgr_state_t ble_mgr_state = BLE_MGR_STATE_INIT
 
static const
ble_gatt_transparent_event_cb_t 
ble_mgr_transparent_event_handle
 
event_t event_mem [MAX_EVENT_SIZE]
 
uint32_t event_payload [MAX_EVENT_PAYLOAD_SIZE/4]
 
platform_init_t pf_cfg
 

ble_status_t ble_mgr_adv_start ( const uint8_t *  adv_data,
uint8_t  adv_data_length,
const uint8_t *  scan_resp_data,
uint8_t  scan_reap_data_len 
)

Set advertisement data, scan response data, advertisement parameters and start advertisement.

Parameters
adv_dataAdvertisement data.
adv_data_lengthAdvertisement data length.
scan_resp_dataScan response data.
scan_reap_data_lenScan response data length.
Precondition
Platform and BLE interface has to be initialized using ble_mgr_device_init.
Returns
ble_status_t Status of setting advertisement data, scan response data, advertisement parameters or start advertisement operation.

References ble_adv_data_set(), ble_adv_param_set(), ble_adv_start(), BLE_INVALID_COMMAND_PARAMETERS, ble_mgr_state, BLE_MGR_STATE_ADVERTISING, ble_scan_resp_data_set(), BLE_SUCCESS, BM_ADV_CONNECTABLE_UNDIRECTED, DBG_LOG, and NULL.

Referenced by app_disconnected_cb(), and main().

ble_status_t ble_mgr_adv_stop ( void  )

Stops ongoing advertisement.

Parameters
None.
Precondition
Advertisement has to be started already.
Returns
ble_status_t Status of stop advertisement operation.

References ble_adv_stop(), BLE_SUCCESS, and DBG_LOG.

Referenced by main().

static ble_status_t ble_mgr_char_descriptor_disc_resp_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t ble_mgr_char_disc_resp_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t ble_mgr_char_value_received_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t ble_mgr_char_value_write_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

ble_status_t ble_mgr_characteristic_indicate_set ( ble_handle_t  conn_handle,
uint16_t  desc_handle,
bool  enabled 
)

Enable/disable characteristic indication.

Parameters
conn_handleConnection handle.
desc_handleClient characteristic config descriptor handle.
enabledEnable/disable the indication.
Precondition
None.
Returns
bool Status of enable/disable indication.

References ble_characteristic_write_with_response(), BLE_GATT_INDICATE, and BLE_GATT_NONE.

ble_status_t ble_mgr_characteristic_notify_set ( ble_handle_t  conn_handle,
uint16_t  desc_handle,
bool  enabled 
)

Enable/disable characteristic notification.

Parameters
conn_handleConnection handle.
desc_handleClient characteristic config descriptor handle.
enabledEnable/disable the notification.
Precondition
None.
Returns
bool Status of enable/disable notification.

References ble_characteristic_write_with_response(), BLE_GATT_NONE, and BLE_GATT_NOTIFY.

Referenced by main().

bool ble_mgr_check_match_param ( ble_mgr_adv_report_event_t adv_report)

Check against the matching parameter set by the user, it could be BLE address, RSSI threshold or advertisement payload.

Parameters
adv_reportAdvertisement report info got from scanning operation.
Precondition
Peripheral matching parameter has to be set using ble_mgr_peripheral_device_match_params.
Returns
bool Status of checking against matching parameter.

References ble_mgr_adv_report_event_t::addr, ble_mgr_adv_report_match_param_t::addr, BLE_MATCHING_PARAM_ADDRESS, BLE_MATCHING_PARAM_PAYLOAD, BLE_MATCHING_PARAM_RSSI, ble_mgr_adv_report_event_t::data, ble_mgr_adv_report_match_param_t::data, ble_mgr_adv_report_match_param_t::data_len, ble_mgr_adv_report_match_param_t::data_start, ble_mgr_adv_report_match_param_t::matching_param, ble_mgr_adv_report_event_t::rssi, and ble_mgr_adv_report_match_param_t::rssi.

Referenced by ble_mgr_adv_report_cb().

static ble_status_t ble_mgr_cmd_complete_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t ble_mgr_config_mode_status_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t ble_mgr_conn_param_update_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

ble_status_t ble_mgr_device_init ( void  )

Initialize platform, callback events and BLE interface.

Parameters
None.
Precondition
None.
Returns
ble_status_t Status of the BLE interface initialization.

References ble_init(), ble_mgr_init(), BLE_SUCCESS, BM_MODE_Init(), DBG_LOG, and platform_init().

Referenced by main().

static ble_status_t ble_mgr_disconnected_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

bool ble_mgr_events_register_callback ( ble_mgr_event_t  event_type,
const void *  ble_event_handler 
)

Register callback functions for BLE events.

Parameters
event_typeType of event, like GAP, GATT-Client, GATT-Server... etc.
ble_event_handlerFunction pointer to group of event handler callbacks.
scan_resp_dataScan response data.
scan_reap_data_lenScan response data length.
Precondition
Platform and BLE interface has to be initialized using ble_mgr_device_init.
Returns
ble_status_t Status of setting advertisement data, scan response data, advertisement parameters or start advertisement operation.

References BLE_COMMON_EVENT_TYPE, BLE_GAP_EVENT_TYPE, BLE_GATT_CLIENT_EVENT_TYPE, BLE_GATT_SERVER_EVENT_TYPE, BLE_GATT_TP_EVENT_TYPE, BLE_PAIRING_EVENT_TYPE, MAX_COMMON_EVENT_SUBSCRIBERS, MAX_GAP_EVENT_SUBSCRIBERS, MAX_GATT_CLIENT_EVENT_SUBSCRIBERS, MAX_GATT_SERVER_EVENT_SUBSCRIBERS, MAX_GATT_TRANSPARENT_SUBSCRIBERS, MAX_PAIRING_SUBSCRIBERS, and NULL.

Referenced by app_init(), and ble_mgr_init().

static ble_status_t ble_mgr_execute_write_repose_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t ble_mgr_execute_write_request_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

event_status_t ble_mgr_get_event ( event_t event)

Get BLE events and process them.

Parameters
eventCarries event ID, parameters and length.
Precondition
Platform and BLE interface has to be initialized using ble_mgr_device_init.
Returns
event_status_t Status of event get operation.

References ble_event_get(), BLE_EVENT_SUCCESS, and ble_mgr_event_manager().

Referenced by main().

static void ble_mgr_init ( void  )
static

Registers BLE manager event callbacks.

Parameters
None.
Precondition
BLE manager event callbacks have to be defined in initialized.
Returns
None.

References BLE_COMMON_EVENT_TYPE, BLE_GAP_EVENT_TYPE, BLE_GATT_CLIENT_EVENT_TYPE, BLE_GATT_SERVER_EVENT_TYPE, BLE_GATT_TP_EVENT_TYPE, ble_mgr_events_register_callback(), and BLE_PAIRING_EVENT_TYPE.

Referenced by ble_mgr_device_init().

static ble_status_t ble_mgr_le_end_test_result_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t ble_mgr_pairing_complete_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t ble_mgr_passkey_confirm_req_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t ble_mgr_passkey_entry_req_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

void ble_mgr_peripheral_device_match_params ( ble_mgr_adv_report_match_param_t match_param)

Sets a matching parameter to find and connect with the device.

Parameters
match_paramMatching parameter, it could be BLE address, RSSI threshold or advertisement payload.
Precondition
None.
Returns
None.

Referenced by main().

static ble_status_t ble_mgr_prepare_write_repose_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t ble_mgr_prepare_write_request_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

ble_status_t ble_mgr_scan_start ( void  )

Sets BLE scan parameters and starts scanning.

Parameters
None.
Precondition
Platform and BLE interface has to be initialized using ble_mgr_device_init.
Returns
ble_status_t Status of the setting scan parameter or scan start operation.

References ble_mgr_state, BLE_MGR_STATE_SCANNING, BLE_SCAN_ACTIVE, BLE_SCAN_DUPLICATE_FILTER_ENABLED, BLE_SCAN_ENABLED, ble_scan_param_set(), ble_scan_start(), BLE_SUCCESS, DBG_LOG, DEFAULT_SCAN_INTERVAL, and DEFAULT_SCAN_WINDOW.

Referenced by app_disconnected_cb(), and main().

ble_status_t ble_mgr_scan_stop ( void  )

Stops the ongoing BLE scan.

Parameters
None.
Precondition
Platform and BLE interface has to be initialized using ble_mgr_device_init.
Returns
ble_status_t Status of the scan stop operation.

References ble_mgr_state, BLE_MGR_STATE_INIT, BLE_SCAN_DISABLED, BLE_SCAN_DUPLICATE_FILTER_ENABLED, ble_scan_start(), BLE_SUCCESS, and DBG_LOG.

Referenced by app_disconnected_cb(), and main().

static ble_status_t ble_mgr_service_disc_resp_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

ble_status_t ble_mgr_start_connection ( ble_addr_t address)

Initiate a connection based on remote device address.

Parameters
addressAddress of remote device.
Precondition
None.
Returns
bool Status of connection request.

References BLE_CONN_WHITELIST_FILTER_DISABLED, ble_create_connection(), BLE_SUCCESS, and DBG_LOG.

static ble_status_t ble_mgr_status_report_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

static ble_status_t ble_mgr_trans_data_received_cb ( event_msg_t msg)
static

References BLE_SUCCESS.

ble_status_t ble_mgr_transparent_uart_disable ( ble_handle_t  conn_handle)

Disables transparentUART with remote device.

Parameters
conn_handleConnection handle of remote device.
Precondition
Connection is established with remote device and transparentUART is enabled.
Returns
ble_status_t Status of transparentUART enable operation.

References BLE_SUCCESS, ble_transparent_uart_enable(), PACKED::conn_handle, and DBG_LOG.

Referenced by app_disconnected_cb().

ble_status_t ble_mgr_transparent_uart_enable ( ble_handle_t  conn_handle)

Enables transparentUART with remote device.

Parameters
conn_handleConnection handle of remote device.
Precondition
Connection is established with remote device.
Returns
ble_status_t Status of transparentUART enable operation.

References BLE_SUCCESS, ble_transparent_uart_enable(), PACKED::conn_handle, and DBG_LOG.

Referenced by app_connected_cb().

ble_status_t ble_mgr_transparent_uart_send ( ble_handle_t  conn_handle,
const uint8_t *  data,
uint8_t  datalen 
)

Sends transparentUART data to remote device.

Parameters
conn_handleConnection handle of remote device.
dataData that needs to be sent to remote device.
datalenLength of data that needs to be sent to remote device.
Precondition
TransparentUART is enabled with remote device using ble_mgr_transparent_uart_enable.
Returns
ble_status_t Status of transparentUART send data operation.

References BLE_SUCCESS, ble_transparent_uart_data_send(), DBG_LOG, and DBG_LOG_CONT.

Referenced by app_send_transparent_uart_data().

ble_mgr_adv_report_event_t ble_mgr_adv_report_list = {0}
static
ble_mgr_adv_report_match_param_t ble_mgr_adv_report_match_param = {0}
static
ble_common_event_cb_t* ble_mgr_common_event_cb[MAX_COMMON_EVENT_SUBSCRIBERS] = {NULL, }
const ble_common_event_cb_t ble_mgr_common_event_handle
static
Initial value:
= {
.cmd_complete = ble_mgr_cmd_complete_cb,
.status_report = ble_mgr_status_report_cb,
.le_end_test_result = ble_mgr_le_end_test_result_cb,
.config_mode_status = ble_mgr_config_mode_status_cb,
}
static ble_status_t ble_mgr_config_mode_status_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:922
static ble_status_t ble_mgr_le_end_test_result_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:917
static ble_status_t ble_mgr_cmd_complete_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:907
static ble_status_t ble_mgr_status_report_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:912
ble_gap_event_cb_t* ble_mgr_gap_event_cb[MAX_GAP_EVENT_SUBSCRIBERS] = {NULL, }
const ble_gap_event_cb_t ble_mgr_gap_event_handle
static
Initial value:
= {
.adv_report = ble_mgr_adv_report_cb,
.connected = ble_mgr_connected_cb,
.disconnected = ble_mgr_disconnected_cb,
.conn_param_update = ble_mgr_conn_param_update_cb,
}
static ble_status_t ble_mgr_connected_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:823
static ble_status_t ble_mgr_adv_report_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:794
static ble_status_t ble_mgr_disconnected_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:852
static ble_status_t ble_mgr_conn_param_update_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:857
const ble_gatt_client_event_cb_t ble_mgr_gatt_client_event_handle
static
Initial value:
= {
.service_disc_resp = ble_mgr_service_disc_resp_cb,
.char_disc_resp = ble_mgr_char_disc_resp_cb,
.char_descriptor_disc_resp = ble_mgr_char_descriptor_disc_resp_cb,
.char_value_received = ble_mgr_char_value_received_cb,
.prepare_write_response = ble_mgr_prepare_write_repose_cb,
.execute_write_response = ble_mgr_execute_write_repose_cb,
}
static ble_status_t ble_mgr_execute_write_repose_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:902
static ble_status_t ble_mgr_char_value_received_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:892
static ble_status_t ble_mgr_prepare_write_repose_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:897
static ble_status_t ble_mgr_char_descriptor_disc_resp_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:887
static ble_status_t ble_mgr_service_disc_resp_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:877
static ble_status_t ble_mgr_char_disc_resp_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:882
const ble_gatt_server_event_cb_t ble_mgr_gatt_server_event_handle
static
Initial value:
= {
.char_value_write = ble_mgr_char_value_write_cb,
.prepare_write_request = ble_mgr_prepare_write_request_cb,
.execute_write_request = ble_mgr_execute_write_request_cb,
}
static ble_status_t ble_mgr_char_value_write_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:862
static ble_status_t ble_mgr_execute_write_request_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:872
static ble_status_t ble_mgr_prepare_write_request_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:867
ble_pairing_event_cb_t* ble_mgr_pairing_event_cb[MAX_PAIRING_SUBSCRIBERS] = {NULL, }
const ble_pairing_event_cb_t ble_mgr_pairing_event_handle
static
Initial value:
= {
.passkey_entry_req = ble_mgr_passkey_entry_req_cb,
.pairing_complete = ble_mgr_pairing_complete_cb,
.passkey_confirm_req = ble_mgr_passkey_confirm_req_cb,
}
static ble_status_t ble_mgr_passkey_confirm_req_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:937
static ble_status_t ble_mgr_pairing_complete_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:932
static ble_status_t ble_mgr_passkey_entry_req_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:927
const ble_gatt_transparent_event_cb_t ble_mgr_transparent_event_handle
static
Initial value:
= {
.trans_data_received = ble_mgr_trans_data_received_cb,
}
static ble_status_t ble_mgr_trans_data_received_cb(event_msg_t *msg)
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:942
event_t event_mem[MAX_EVENT_SIZE]

Referenced by event_fifo_init().

uint32_t event_payload[MAX_EVENT_PAYLOAD_SIZE/4]
Initial value:
= {
.platform_api_list.create_timer = platform_create_timer,
.platform_api_list.delete_timer = platform_delete_timer,
.platform_api_list.start_timer = platform_start_timer,
.platform_api_list.stop_timer = platform_stop_timer,
.platform_api_list.sleep_timer_ms = platform_sleep,
.platform_api_list.gpio_set = platform_gpio_set,
.platform_api_list.mode_set = platform_mode_set,
.platform_api_list.mode_get = platform_mode_get,
.platform_api_list.uart_tx_cb = platform_send_sync,
.platform_api_list.uart_rx_cb = platform_recv_async,
.event_mem.event_mem_pool = event_mem,
.event_mem.event_mem_pool_size = MAX_EVENT_SIZE,
.event_mem.event_payload_mem = event_payload,
.event_mem.event_payload_mem_size = MAX_EVENT_PAYLOAD_SIZE,
}
void platform_delete_timer(void *timer_handle)
Definition: ble_host_sdk/src/platform.c:188
void platform_mode_get(BM_MODE *mode)
Definition: ble_host_sdk/src/platform.c:217
void platform_stop_timer(void *timer_handle)
Definition: ble_host_sdk/src/platform.c:200
void * platform_create_timer(void(*timer_cb)(void *))
Definition: ble_host_sdk/src/platform.c:183
event_t event_mem[MAX_EVENT_SIZE]
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:44
void platform_mode_set(BM_MODE mode)
Definition: ble_host_sdk/src/platform.c:212
void platform_send_sync(uint8_t *data, uint32_t length)
Definition: ble_host_sdk/src/platform.c:82
void platform_gpio_set(gpio_pin_t pin, gpio_status_t status)
Definition: ble_host_sdk/src/platform.c:133
#define MAX_EVENT_PAYLOAD_SIZE
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.h:40
#define MAX_EVENT_SIZE
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.h:39
void platform_recv_async(uart_recv_async_cb_t recv_async_callback)
Definition: ble_host_sdk/src/platform.c:90
uint32_t event_payload[MAX_EVENT_PAYLOAD_SIZE/4]
Definition: ble_host_sdk/ble_services/ble_mgr/ble_manager.c:45
void platform_start_timer(void *timer_handle, uint32_t ms)
Definition: ble_host_sdk/src/platform.c:193
void platform_sleep(uint32_t ms)
Definition: ble_host_sdk/src/platform.c:207