![Cypress EZ-BT WICED CYBT-343026-01 Скачать руководство пользователя страница 21](http://html1.mh-extra.com/html/cypress/ez-bt-wiced-cybt-343026-01/ez-bt-wiced-cybt-343026-01_getting-started_2705923021.webp)
Getting Started with EZ-BT WICED Modules
Document Number: 002-23400 Rev. **
21
7 . 3 . 4
M o d i f y
‘h ell o _sen so r ’ F il es to Remo ve Du p licat io n an d Al l ow Acce ss f ro m spp . c
1. Open
hello_sensor.h
and add the function shown in Code 6:
Code 6.
hello_sensor.h
: Add hello_sensor Function Declarations
void
hello_sensor_application_init
(
void
);
void
hello_sensor_encryption_changed
(
wiced_result_t
result,
uint8_t
* bd_addr );
2. Open
hello_sensor.c
and make the following changes:
The merged project should have a single APPLICATION_START() function, and should register only one common
Bluetooth event callback function for all BT BR/EDR and BLE events from the stack. To accomplish this
requirement, make the following changes:
▪
Comment out the
hello_sensor_management_cback
function definition:
Code 7.
hello_sensor.c
: Comment
hello_sensor_management_cback
Function Definition
//static wiced_result_t hello_sensor_management_cback( wiced_bt_management_evt_t event,
wiced_bt_management_evt_data_t *p_event_data );
▪
Comment out the
hello_sensor_encryption_changed
function definition. This function was added into the
hello_sensor.h
file in Code 6. This function is commented out here because it is declared as a static function,
which would not be accessible in
spp.c
.
Code 8.
hello_sensor.c
: Comment
hello_sensor_encryption_changed
Function Definition
//static void hello_sensor_encryption_changed( wiced_result_t result, uint8_t* bd_addr );
▪
Comment out the
hello_sensor_application_init
function definition. This function was added into the
hello_sensor.h
file in Code 6. This function is commented here because it is declared as a static function,
which would not be accessible in
spp.c
.
Code 9.
hello_sensor.c
: Comment
hello_sensor_application_init
Function Definition
//static void hello_sensor_application_init( void );
▪
Comment out the complete
APPLICATION_START()
function.
Code 10:
hello_sensor.c
: Comment
application_start()
Function
//APPLICATION_START( )
//{
// wiced_transport_init( &transport_cfg );
//
//#ifdef WICED_BT_TRACE_ENABLE
// // Set the debug uart as WICED_ROUTE_DEBUG_NONE to get rid of prints
// // wiced_set_debug_uart(WICED_ROUTE_DEBUG_NONE);
//
// // Set to PUART to see traces on peripheral uart(puart)
// wiced_set_debug_uart( WICED_ROUTE_DEBUG_TO_PUART );
// wiced_hal_puart_select_uart_pads( WICED_PUART_RXD, WICED_PUART_TXD, 0, 0);
//
// // Set to HCI to see traces on HCI uart - default if no call to wiced_set_debug_uart()
// // wiced_set_debug_uart( WICED_ROUTE_DEBUG_TO_HCI_UART );
//
// // Use WICED_ROUTE_DEBUG_TO_WICED_UART to send formatted debug strings over the WICED
// // HCI debug interface to be parsed by ClientControl/BtSpy.
// // wiced_set_debug_uart(WICED_ROUTE_DEBUG_TO_WICED_UART);
//#endif
//
// WICED_BT_TRACE( "Hello Sensor Start\n" );
//
// // Register call back and configuration with stack
// wiced_bt_stack_init( hello_sensor_management_cback ,
// &wiced_bt_cfg_settings, wiced_bt_cfg_buf_pools );
//}
▪
Go to
hello_sensor_application_init()
and make the following changes:
▪
Comment out
wiced_bt_app_init();