|
@@ -64,7 +64,6 @@ static void profile_callback(void *p)
|
|
|
if (p_param->msg_type == BSAL_CALLBACK_TYPE_READ_CHAR_VALUE)
|
|
if (p_param->msg_type == BSAL_CALLBACK_TYPE_READ_CHAR_VALUE)
|
|
|
{
|
|
{
|
|
|
//NO DEAL had not finished
|
|
//NO DEAL had not finished
|
|
|
-// rt_kprintf("read_index = %d\n", p_param->off_handle);
|
|
|
|
|
is_app_cb = true;
|
|
is_app_cb = true;
|
|
|
}
|
|
}
|
|
|
else if (p_param->msg_type == BSAL_CALLBACK_TYPE_WRITE_CHAR_VALUE)
|
|
else if (p_param->msg_type == BSAL_CALLBACK_TYPE_WRITE_CHAR_VALUE)
|
|
@@ -78,12 +77,10 @@ static void profile_callback(void *p)
|
|
|
}
|
|
}
|
|
|
else if (p_param->msg_type == BSAL_CALLBACK_TYPE_INDIFICATION_NOTIFICATION)
|
|
else if (p_param->msg_type == BSAL_CALLBACK_TYPE_INDIFICATION_NOTIFICATION)
|
|
|
{
|
|
{
|
|
|
-// rt_kprintf("CCCD off_handle = %d\n", p_param->off_handle);
|
|
|
|
|
if (GATT_SVC_NUS_CHAR_CCCD_INDEX == p_param->off_handle)
|
|
if (GATT_SVC_NUS_CHAR_CCCD_INDEX == p_param->off_handle)
|
|
|
{
|
|
{
|
|
|
if (p_param->length == 2)
|
|
if (p_param->length == 2)
|
|
|
{
|
|
{
|
|
|
- //uint16_t ccdbit = (uint16_t)p_param->data;
|
|
|
|
|
is_app_cb = true;
|
|
is_app_cb = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -206,7 +203,6 @@ void bsal_bleuart_uart_proc(void *stack_ptr, uint16_t conn_id)
|
|
|
bsal_uuid_any_t uuid_srv;
|
|
bsal_uuid_any_t uuid_srv;
|
|
|
uuid_srv.u_type = BSAL_UUID_TYPE_128BIT;
|
|
uuid_srv.u_type = BSAL_UUID_TYPE_128BIT;
|
|
|
rt_memcpy(uuid_srv.u128.value, gatt_svr_chr_uart_read_uuid.value, 16);
|
|
rt_memcpy(uuid_srv.u128.value, gatt_svr_chr_uart_read_uuid.value, 16);
|
|
|
-// uuid_srv.u128.value = ;
|
|
|
|
|
uint16_t start_handle = bsal_srv_get_start_handle(stack_ptr, uuid_srv);
|
|
uint16_t start_handle = bsal_srv_get_start_handle(stack_ptr, uuid_srv);
|
|
|
|
|
|
|
|
rt_kprintf("======== Welcome to enter bluetooth uart mode ========\n");
|
|
rt_kprintf("======== Welcome to enter bluetooth uart mode ========\n");
|
|
@@ -236,16 +232,8 @@ void bsal_bleuart_uart_proc(void *stack_ptr, uint16_t conn_id)
|
|
|
|
|
|
|
|
console_buf[off] = '\0';
|
|
console_buf[off] = '\0';
|
|
|
rt_kprintf("\n");
|
|
rt_kprintf("\n");
|
|
|
-// rt_kprintf("send connid = %d\n", conn_id);
|
|
|
|
|
-// rt_kprintf("send start_handle = %d\n", start_handle);
|
|
|
|
|
-// bsal_srv_write_data(p_param->stack_ptr, p_param->start_handle, p_param->off_handle, sizeof(console_buf), console_buf);
|
|
|
|
|
bsal_srv_send_notify_data(stack_ptr, conn_id, start_handle, GATT_SVC_NUS_READ_INDEX, sizeof(console_buf), console_buf);
|
|
bsal_srv_send_notify_data(stack_ptr, conn_id, start_handle, GATT_SVC_NUS_READ_INDEX, sizeof(console_buf), console_buf);
|
|
|
-// om = ble_hs_mbuf_from_flat(console_buf, off);
|
|
|
|
|
-// if (!om) {
|
|
|
|
|
-// return;
|
|
|
|
|
-// }
|
|
|
|
|
-// ble_gattc_notify_custom(g_console_conn_handle,
|
|
|
|
|
-// g_bleuart_attr_read_handle, om);
|
|
|
|
|
|
|
+
|
|
|
off = 0;
|
|
off = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|