hsp_hs.c (637244f187cc75ae8efd4a435686c32e96226ec4) | hsp_hs.c (1d882eda6f6f2d40a62ce07de979f1517f11d88e) |
---|---|
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 --- 378 unchanged lines hidden (view full) --- 387 case HSP_RFCOMM_CONNECTION_ESTABLISHED: 388 389 if (hs_microphone_gain >= 0){ 390 if (!rfcomm_can_send_packet_now(rfcomm_cid)) { 391 rfcomm_request_can_send_now_event(rfcomm_cid); 392 return; 393 } 394 char buffer[20]; | 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 --- 378 unchanged lines hidden (view full) --- 387 case HSP_RFCOMM_CONNECTION_ESTABLISHED: 388 389 if (hs_microphone_gain >= 0){ 390 if (!rfcomm_can_send_packet_now(rfcomm_cid)) { 391 rfcomm_request_can_send_now_event(rfcomm_cid); 392 return; 393 } 394 char buffer[20]; |
395 sprintf(buffer, "%s=%d\r\n", HSP_HS_MICROPHONE_GAIN, hs_microphone_gain); | 395 sprintf(buffer, "%s=%d\r", HSP_HS_MICROPHONE_GAIN, hs_microphone_gain); |
396 hsp_hs_send_str_over_rfcomm(rfcomm_cid, buffer); 397 hs_microphone_gain = -1; 398 break; 399 } 400 401 if (hs_speaker_gain >= 0){ 402 if (!rfcomm_can_send_packet_now(rfcomm_cid)) { 403 rfcomm_request_can_send_now_event(rfcomm_cid); 404 return; 405 } 406 char buffer[20]; | 396 hsp_hs_send_str_over_rfcomm(rfcomm_cid, buffer); 397 hs_microphone_gain = -1; 398 break; 399 } 400 401 if (hs_speaker_gain >= 0){ 402 if (!rfcomm_can_send_packet_now(rfcomm_cid)) { 403 rfcomm_request_can_send_now_event(rfcomm_cid); 404 return; 405 } 406 char buffer[20]; |
407 sprintf(buffer, "%s=%d\r\n", HSP_HS_SPEAKER_GAIN, hs_speaker_gain); | 407 sprintf(buffer, "%s=%d\r", HSP_HS_SPEAKER_GAIN, hs_speaker_gain); |
408 hsp_hs_send_str_over_rfcomm(rfcomm_cid, buffer); 409 hs_speaker_gain = -1; 410 break; 411 } 412 break; 413 case HSP_W4_RFCOMM_DISCONNECTED: 414 rfcomm_disconnect(rfcomm_cid); 415 break; --- 273 unchanged lines hidden --- | 408 hsp_hs_send_str_over_rfcomm(rfcomm_cid, buffer); 409 hs_speaker_gain = -1; 410 break; 411 } 412 break; 413 case HSP_W4_RFCOMM_DISCONNECTED: 414 rfcomm_disconnect(rfcomm_cid); 415 break; --- 273 unchanged lines hidden --- |