Craft a HCI_Enhanced_Setup_Synchronous_Connection command to decrease the eSCO call connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ogf = '0x01' # Opcode Group Field | |
ocf = '0x003d' # Opcode Command Field | |
# Change this according to the handle | |
handle = 266 | |
def binary(data) | |
data[2..-1].split("").each_slice(2).map { |i| "#{i.join}" }.reverse | |
end | |
def calculate_handle(handle) | |
hex_handle = handle.to_s(16) | |
diff = 4 - hex_handle.length | |
"0x#{"0" * diff}#{hex_handle}" | |
end | |
args = [ | |
calculate_handle(handle), | |
'0x00001F40', # tx_bandwidth | |
'0x00001F40', # rx_bandwidth | |
'0x0000000005', # tx_coding_format | |
'0x0000000005', # rx_coding_format | |
'0x003C', # tx_codec_frame | |
'0x003C', # rx_codec_frame | |
'0x00007D00', # input_bandwidth | |
'0x00007D00', # output_bandwidth | |
'0x0000000004', # input_coding_format | |
'0x0000000004', # output_coding_format | |
'0x0010', # input_codec_size | |
'0x0010', # output_codec_size | |
'0x02', # input_pcm_format | |
'0x02', # input_pcm_format | |
'0x00', # input_pcm_sample | |
'0x00', # output_pcm_sample | |
'0x01', # input_data_path | |
'0x01', # output_data_path | |
'0x00', # input_transport | |
'0x00', # output_transport | |
'0x000D', # max_latency | |
'0x0308', # packet_type | |
'0x02', # retransmission_effort | |
] | |
data = args.map { |n| binary(n) }.flatten.join(" ") | |
cmd = "hcitool cmd #{ogf} #{ocf} #{data}" | |
puts cmd | |
puts `#{cmd}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment