![Cypress EZ-BT WICED CYBT-343026-01 Скачать руководство пользователя страница 22](http://html1.mh-extra.com/html/cypress/ez-bt-wiced-cybt-343026-01/ez-bt-wiced-cybt-343026-01_getting-started_2705923022.webp)
Getting Started with EZ-BT WICED Modules
Document Number: 002-23400 Rev. **
22
Code 11.
hello_sensor.c
: Comment
wiced_bt_app_init
Function
// wiced_bt_app_init();
▪
Comment the GPIO configuration shown in Code 12. CYBT-343026-EVAL has one user button,
and it is configured in
spp.c
for a specific functionality. If there is a need for an additional button
to execute other functionality, you should configure another available GPIO and verify the
functionality by manually toggling the state of the GPIO using a blue wire.
Code 12.
hello_sensor.c
: Comment GPIO Functions Related to Button Activation
// wiced_hal_gpio_configure_pin( WICED_GPIO_BUTTON, WICED_GPIO_BUTTON_SETTINGS(
GPIO_EN_INT_RISING_EDGE ), WICED_GPIO_BUTTON_DEFAULT_STATE );
// wiced_hal_gpio_register_pin_for_interrupt( WICED_GPIO_BUTTON, hello_sensor_interrupt_handler,
NULL );
▪
Comment
out
the
complete
hello_sensor_management_cback()
function.
spp.c
has
an
app_manangement_callback()
registered during the initialization for all BT BR/EDR and BLE events;
therefore, there is no need for
hello_sensor_management_cback()
hello_sensor_management_cback
function.
Code 13.
hello_sensor.c
: Comment
hello_sensor_management_cback
Function
//wiced_result_t hello_sensor_management_cback( wiced_bt_management_evt_t event, wiced_bt_management_evt_data_t *p_event_data
)
//{
// wiced_result_t result = WICED_BT_SUCCESS;
// wiced_bt_dev_encryption_status_t *p_status;
// wiced_bt_dev_ble_pairing_info_t *p_info;
// wiced_bt_ble_advert_mode_t *p_mode;
// uint8_t *p_keys;
//
// WICED_BT_TRACE("hello_sensor_management_cback: %x\n", event );
//
// switch( event )
// {
// /* Bluetooth stack enabled */
// case BTM_ENABLED_EVT:
// hello_sensor_application_init();
// break;
//
// case BTM_DISABLED_EVT:
// break;
//
// case BTM_USER_CONFIRMATION_REQUEST_EVT:
// WICED_BT_TRACE("numeric_value: %d \n", p_event_data->user_confirmation_request.numeric_value);
// wiced_bt_dev_confirm_req_reply( WICED_BT_SUCCESS , p_event_data->user_confirmation_request.bd_addr);
// break;
//
// case BTM_PASSKEY_NOTIFICATION_EVT:
// WICED_BT_TRACE("PassKey Notification. BDA %B, Key %d \n", p_event_data->user_passkey_notification.bd_addr,
// p_event_data->user_passkey_notification.passkey );
// wiced_bt_dev_confirm_req_reply(WICED_BT_SUCCESS, p_event_data->user_passkey_notification.bd_addr );
// break;
//
// case BTM_PAIRING_IO_CAPABILITIES_BLE_REQUEST_EVT:
// p_event_data->pairing_io_capabilities_ble_request.local_io_cap = BTM_IO_CAPABILITIES_NONE;
// p_event_data->pairing_io_capabilities_ble_request.oob_data = BTM_OOB_NONE;
// p_event_data->pairing_io_capabilities_ble_request.auth_req = BTM_LE_AUTH_REQ_SC_BOND;
// p_event_data->pairing_io_capabilities_ble_request.max_key_size = 0x10;
// p_event_data->pairing_io_capabilities_ble_request.init_keys =
// BTM_LE_KEY_PENC|BTM_LE_KEY_PID|BTM_LE_KEY_PCSRK|BTM_LE_KEY_LENC;
// p_event_data->pairing_io_capabilities_ble_request.resp_keys =
// BTM_LE_KEY_PENC|BTM_LE_KEY_PID|BTM_LE_KEY_PCSRK|BTM_LE_KEY_LENC;
// break;
//
// case BTM_PAIRING_COMPLETE_EVT:
// p_info = &p_event_data->pairing_complete.pairing_complete_info.ble;
// WICED_BT_TRACE( "Pairing Complete: %d",p_info->reason);
// hello_sensor_smp_bond_result( p_info->reason );
// break;
//
// case BTM_PAIRED_DEVICE_LINK_KEYS_UPDATE_EVT:
// /* save keys to NVRAM */
// p_keys = (uint8_t*)&p_event_data->paired_device_link_keys_update;
// wiced_hal_write_nvram ( HELLO_SENSOR_PAIRED_KEYS_VS_ID, sizeof( wiced_bt_device_link_keys_t ), p_keys ,&result
);
// WICED_BT_TRACE("keys save to NVRAM %B result: %d \n", p_keys, result);
// break;
//