hfp.c (553a4a561f786fff6050306fb8f8ca8e28d447d4) | hfp.c (a9e632e9130abf3d16ab069ece35e9853dcc0762) |
---|---|
1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 345 unchanged lines hidden (view full) --- 354} 355 356void hfp_emit_voice_recognition_enabled(hfp_connection_t * hfp_connection, uint8_t status){ 357 btstack_assert(hfp_connection != NULL); 358 359 uint8_t event[7]; 360 event[0] = HCI_EVENT_HFP_META; 361 event[1] = sizeof(event) - 2; | 1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 345 unchanged lines hidden (view full) --- 354} 355 356void hfp_emit_voice_recognition_enabled(hfp_connection_t * hfp_connection, uint8_t status){ 357 btstack_assert(hfp_connection != NULL); 358 359 uint8_t event[7]; 360 event[0] = HCI_EVENT_HFP_META; 361 event[1] = sizeof(event) - 2; |
362 event[2] = HFP_SUBEVENT_VOICE_RECOGNITION_ENABLED; | 362 event[2] = HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED; |
363 364 little_endian_store_16(event, 3, hfp_connection->acl_handle); 365 event[5] = status; // 0:success 366 event[6] = hfp_connection->enhanced_voice_recognition_enabled ? 1 : 0; 367 hfp_emit_event_for_context(hfp_connection, event, sizeof(event)); 368} 369 370void hfp_emit_voice_recognition_disabled(hfp_connection_t * hfp_connection, uint8_t status){ 371 btstack_assert(hfp_connection != NULL); 372 373 uint8_t event[6]; 374 event[0] = HCI_EVENT_HFP_META; 375 event[1] = sizeof(event) - 2; | 363 364 little_endian_store_16(event, 3, hfp_connection->acl_handle); 365 event[5] = status; // 0:success 366 event[6] = hfp_connection->enhanced_voice_recognition_enabled ? 1 : 0; 367 hfp_emit_event_for_context(hfp_connection, event, sizeof(event)); 368} 369 370void hfp_emit_voice_recognition_disabled(hfp_connection_t * hfp_connection, uint8_t status){ 371 btstack_assert(hfp_connection != NULL); 372 373 uint8_t event[6]; 374 event[0] = HCI_EVENT_HFP_META; 375 event[1] = sizeof(event) - 2; |
376 event[2] = HFP_SUBEVENT_VOICE_RECOGNITION_DISABLED; | 376 event[2] = HFP_SUBEVENT_VOICE_RECOGNITION_DEACTIVATED; |
377 378 little_endian_store_16(event, 3, hfp_connection->acl_handle); 379 event[5] = status; // 0:success 380 hfp_emit_event_for_context(hfp_connection, event, sizeof(event)); 381} 382 383void hfp_emit_enhanced_voice_recognition_hf_ready_for_audio_event(hfp_connection_t * hfp_connection, uint8_t status){ 384 hci_con_handle_t acl_handle = (hfp_connection != NULL) ? hfp_connection->acl_handle : HCI_CON_HANDLE_INVALID; --- 1313 unchanged lines hidden (view full) --- 1698 case 3: 1699 hfp_connection->ag_msg.text_operation = (hfp_text_operation_t) btstack_atoi((char *)&hfp_connection->line_buffer[0]); 1700 break; 1701 case 4: 1702 hfp_connection->ag_msg.text_type = (hfp_text_type_t) btstack_atoi((char *)&hfp_connection->line_buffer[0]); 1703 break; 1704 case 5: 1705 hfp_connection->ag_vra_msg_length = hfp_connection->line_size; | 377 378 little_endian_store_16(event, 3, hfp_connection->acl_handle); 379 event[5] = status; // 0:success 380 hfp_emit_event_for_context(hfp_connection, event, sizeof(event)); 381} 382 383void hfp_emit_enhanced_voice_recognition_hf_ready_for_audio_event(hfp_connection_t * hfp_connection, uint8_t status){ 384 hci_con_handle_t acl_handle = (hfp_connection != NULL) ? hfp_connection->acl_handle : HCI_CON_HANDLE_INVALID; --- 1313 unchanged lines hidden (view full) --- 1698 case 3: 1699 hfp_connection->ag_msg.text_operation = (hfp_text_operation_t) btstack_atoi((char *)&hfp_connection->line_buffer[0]); 1700 break; 1701 case 4: 1702 hfp_connection->ag_msg.text_type = (hfp_text_type_t) btstack_atoi((char *)&hfp_connection->line_buffer[0]); 1703 break; 1704 case 5: 1705 hfp_connection->ag_vra_msg_length = hfp_connection->line_size; |
1706 log_info("VRA message of length %d", hfp_connection->ag_vra_msg_length); |
|
1706 break; 1707 default: 1708 break; 1709 } 1710 hfp_connection->parser_item_index++; 1711 break; 1712 default: 1713 break; --- 318 unchanged lines hidden --- | 1707 break; 1708 default: 1709 break; 1710 } 1711 hfp_connection->parser_item_index++; 1712 break; 1713 default: 1714 break; --- 318 unchanged lines hidden --- |