hfp_hf.c (d7f6b5cbabc3a85de9ac86d5872ce0915d664389) | hfp_hf.c (42bafa11b1ced812dc30728166c5265b044825b4) |
---|---|
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 --- 170 unchanged lines hidden (view full) --- 179 } 180 hfp_create_sdp_record(service, service_record_handle, BLUETOOTH_SERVICE_CLASS_HANDSFREE, rfcomm_channel_nr, name); 181 182 // Construct SupportedFeatures for SDP bitmap: 183 // 184 // "The values of the “SupportedFeatures” bitmap given in Table 5.4 shall be the same as the values 185 // of the Bits 0 to 4 of the unsolicited result code +BRSF" 186 // | 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 --- 170 unchanged lines hidden (view full) --- 179 } 180 hfp_create_sdp_record(service, service_record_handle, BLUETOOTH_SERVICE_CLASS_HANDSFREE, rfcomm_channel_nr, name); 181 182 // Construct SupportedFeatures for SDP bitmap: 183 // 184 // "The values of the “SupportedFeatures” bitmap given in Table 5.4 shall be the same as the values 185 // of the Bits 0 to 4 of the unsolicited result code +BRSF" 186 // |
187 // Wide band speech (bit 5) requires Codec negotiation 188 // |
|
187 uint16_t sdp_features = supported_features & 0x1f; | 189 uint16_t sdp_features = supported_features & 0x1f; |
188 if (supported_features & wide_band_speech){ 189 sdp_features |= 1 << 5; // Wide band speech bit | 190 if (wide_band_speech && (supported_features & (1 << HFP_HFSF_CODEC_NEGOTIATION))){ 191 sdp_features |= 1 << 5; |
190 } 191 de_add_number(service, DE_UINT, DE_SIZE_16, 0x0311); // Hands-Free Profile - SupportedFeatures 192 de_add_number(service, DE_UINT, DE_SIZE_16, sdp_features); 193} 194 195 196static inline int hfp_hf_send_cmd(uint16_t cid, const char * cmd){ 197 char buffer[20]; --- 1492 unchanged lines hidden --- | 192 } 193 de_add_number(service, DE_UINT, DE_SIZE_16, 0x0311); // Hands-Free Profile - SupportedFeatures 194 de_add_number(service, DE_UINT, DE_SIZE_16, sdp_features); 195} 196 197 198static inline int hfp_hf_send_cmd(uint16_t cid, const char * cmd){ 199 char buffer[20]; --- 1492 unchanged lines hidden --- |