Getting Started with EZ-BT WICED Modules
Document Number: 002-23400 Rev. **
116
int
bytes_to_send = app_send_ SPP_MAX_PAYLOAD < APP_TOTAL_DATA_TO_SEND ? SPP_MAX_PAYLOAD :
APP_TOTAL_DATA_TO_SEND - app_send_offset;
for
(i = 0; i < bytes_to_send; i++)
{
// app_send_buffer[i] = app_send_ i;
app_send_buffer[i] = 65 + increment;
in+;
if
(increment == 26)
{
increment = 0;
}
}
wiced_bt_spp_send_session_data(spp_handle, app_send_buffer, bytes_to_send);
app_send_= bytes_to_send;
}
// Check if we were able to send everything
if
(app_send_offset < APP_TOTAL_DATA_TO_SEND)
{
wiced_start_timer(&app_tx_timer, 100);
}
else
{
app_send_offset = 0;
}
}
/*
* Test function which start sending data.
*/
void
app_interrupt_handler
(
void
*data,
uint8_t
port_pin)
{
int
i;
WICED_BT_TRACE(
"gpio_interrupt_handler pin:%d send_offset:%d\n"
, port_pin, app_send_offset);
/* Get the status of interrupt on P# */
if
(wiced_hal_gpio_get_pin_interrupt_status(BUTTON_GPIO))
{
/* Clear the GPIO interrupt */
wiced_hal_gpio_clear_pin_interrupt_status(BUTTON_GPIO);
}
// If we are already sending data, do nothing
if
(app_send_offset != 0)
return
;
app_send_data();
}
/*
* The timeout function is periodically called while we are sending big amount of data
*/
void
app_tx_ack_timeout
(
uint32_t
param)
{
app_send_data();
}
#endif
#ifdef
HCI_TRACE_OVER_TRANSPORT
/*
* Pass protocol traces up over the transport
*/
void
app_trace_callback
(
wiced_bt_hci_trace_type_t
type,
uint16_t
length,
uint8_t
* p_data)
{
wiced_transport_send_hci_trace(host_trans_pool, type, length, p_data);
}
#endif