4 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
6 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * $Id: link_control.c,v 1.4 2003/08/18 19:19:54 max Exp $
34 #define L2CAP_SOCKET_CHECKED
35 #include <bluetooth.h>
39 #include "hccontrol.h"
41 static void hci_inquiry_response (int n, uint8_t **b);
43 /* Send Inquiry command to the unit */
45 hci_inquiry(int s, int argc, char **argv)
50 ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b;
56 cp.inquiry_length = 5;
59 /* parse command parameters */
62 /* number of responses, range 0x00 - 0xff */
63 if (sscanf(argv[2], "%d", &n0) != 1 || n0 < 0 || n0 > 0xff)
66 cp.num_responses = (n0 & 0xff);
69 /* inquiry length (N * 1.28) sec, range 0x01 - 0x30 */
70 if (sscanf(argv[1], "%d", &n0) != 1 || n0 < 0x1 || n0 > 0x30)
73 cp.inquiry_length = (n0 & 0xff);
77 if (sscanf(argv[0], "%x:%x:%x", &n2, &n1, &n0) != 3)
80 cp.lap[0] = (n0 & 0xff);
81 cp.lap[1] = (n1 & 0xff);
82 cp.lap[2] = (n2 & 0xff);
92 /* send request and expect status back */
94 if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LINK_CONTROL,
95 NG_HCI_OCF_INQUIRY), (char const *) &cp, sizeof(cp),
103 timeout = cp.inquiry_length * 1.28 + 1;
106 /* wait for inquiry events */
108 if (hci_recv(s, b, &n0) == ERROR) {
113 if (n0 < sizeof(*e)) {
120 case NG_HCI_EVENT_INQUIRY_RESULT: {
121 ng_hci_inquiry_result_ep *ir =
122 (ng_hci_inquiry_result_ep *)(e + 1);
123 uint8_t *r = (uint8_t *)(ir + 1);
125 fprintf(stdout, "Inquiry result, num_responses=%d\n",
128 for (n0 = 0; n0 < ir->num_responses; n0++)
129 hci_inquiry_response(n0, &r);
134 case NG_HCI_EVENT_INQUIRY_COMPL:
135 fprintf(stdout, "Inquiry complete. Status: %s [%#02x]\n",
136 hci_status2str(*(b + sizeof(*e))), *(b + sizeof(*e)));
148 /* Print Inquiry_Result event */
150 hci_inquiry_response(int n, uint8_t **b)
152 ng_hci_inquiry_response *ir = (ng_hci_inquiry_response *)(*b);
154 fprintf(stdout, "Inquiry result #%d\n", n);
155 fprintf(stdout, "\tBD_ADDR: %s\n", hci_bdaddr2str(&ir->bdaddr));
156 fprintf(stdout, "\tPage Scan Rep. Mode: %#02x\n",
157 ir->page_scan_rep_mode);
158 fprintf(stdout, "\tPage Scan Period Mode: %#02x\n",
159 ir->page_scan_period_mode);
160 fprintf(stdout, "\tPage Scan Mode: %#02x\n",
162 fprintf(stdout, "\tClass: %02x:%02x:%02x\n",
163 ir->uclass[2], ir->uclass[1], ir->uclass[0]);
164 fprintf(stdout, "\tClock offset: %#04x\n",
165 le16toh(ir->clock_offset));
168 } /* hci_inquiry_response */
170 /* Send Create_Connection command to the unit */
172 hci_create_connection(int s, int argc, char **argv)
176 ng_hci_create_con_cp cp;
177 ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b;
180 memset(&cp, 0, sizeof(cp));
181 cp.pkt_type = htole16( NG_HCI_PKT_DM1 | NG_HCI_PKT_DH1 |
182 NG_HCI_PKT_DM3 | NG_HCI_PKT_DH3 |
184 cp.page_scan_rep_mode = NG_HCI_SCAN_REP_MODE0;
185 cp.page_scan_mode = NG_HCI_MANDATORY_PAGE_SCAN_MODE;
187 cp.accept_role_switch = 1;
189 /* parse command parameters */
192 /* accept role switch */
193 if (sscanf(argv[5], "%d", &n0) != 1)
196 cp.accept_role_switch = n0 ? 1 : 0;
200 if (sscanf(argv[4], "%d", &n0) != 1)
203 cp.clock_offset = (n0 & 0xffff);
204 cp.clock_offset = htole16(cp.clock_offset);
208 if (sscanf(argv[3], "%d", &n0) != 1 || n0 < 0 || n0 > 3)
211 cp.page_scan_mode = (n0 & 0xff);
214 /* page scan rep mode */
215 if (sscanf(argv[2], "%d", &n0) != 1 || n0 < 0 || n0 > 2)
218 cp.page_scan_rep_mode = (n0 & 0xff);
222 if (sscanf(argv[1], "%x", &n0) != 1)
225 n0 &= ( NG_HCI_PKT_DM1 | NG_HCI_PKT_DH1 |
226 NG_HCI_PKT_DM3 | NG_HCI_PKT_DH3 |
231 cp.pkt_type = (n0 & 0xffff);
232 cp.pkt_type = htole16(cp.pkt_type);
236 if (!bt_aton(argv[0], &cp.bdaddr)) {
237 struct hostent *he = NULL;
239 if ((he = bt_gethostbyname(argv[0])) == NULL)
242 memcpy(&cp.bdaddr, he->h_addr, sizeof(cp.bdaddr));
250 /* send request and expect status response */
252 if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LINK_CONTROL,
253 NG_HCI_OCF_CREATE_CON),
254 (char const *) &cp, sizeof(cp), b, &n0) == ERROR)
263 if (hci_recv(s, b, &n0) == ERROR)
265 if (n0 < sizeof(*e)) {
270 if (e->event == NG_HCI_EVENT_CON_COMPL) {
271 ng_hci_con_compl_ep *ep = (ng_hci_con_compl_ep *)(e + 1);
273 if (ep->status != 0x00) {
274 fprintf(stdout, "Status: %s [%#02x]\n",
275 hci_status2str(ep->status), ep->status);
279 fprintf(stdout, "BD_ADDR: %s\n", hci_bdaddr2str(&ep->bdaddr));
280 fprintf(stdout, "Connection handle: %d\n",
281 le16toh(ep->con_handle));
282 fprintf(stdout, "Encryption mode: %s [%d]\n",
283 hci_encrypt2str(ep->encryption_mode, 0),
284 ep->encryption_mode);
289 } /* hci_create_connection */
291 /* Send Disconnect command to the unit */
293 hci_disconnect(int s, int argc, char **argv)
298 ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b;
301 memset(&cp, 0, sizeof(cp));
304 /* parse command parameters */
308 if (sscanf(argv[1], "%d", &n) != 1 || n <= 0x00 || n > 0xff)
311 cp.reason = (uint8_t) (n & 0xff);
314 /* connection handle */
315 if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
318 cp.con_handle = (uint16_t) (n & 0x0fff);
319 cp.con_handle = htole16(cp.con_handle);
326 /* send request and expect status response */
328 if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LINK_CONTROL,
330 (char const *) &cp, sizeof(cp), b, &n) == ERROR)
339 if (hci_recv(s, b, &n) == ERROR)
341 if (n < sizeof(*e)) {
346 if (e->event == NG_HCI_EVENT_DISCON_COMPL) {
347 ng_hci_discon_compl_ep *ep = (ng_hci_discon_compl_ep *)(e + 1);
349 if (ep->status != 0x00) {
350 fprintf(stdout, "Status: %s [%#02x]\n",
351 hci_status2str(ep->status), ep->status);
355 fprintf(stdout, "Connection handle: %d\n",
356 le16toh(ep->con_handle));
357 fprintf(stdout, "Reason: %s [%#02x]\n",
358 hci_status2str(ep->reason), ep->reason);
363 } /* hci_disconnect */
365 /* Send Add_SCO_Connection command to the unit */
367 hci_add_sco_connection(int s, int argc, char **argv)
371 ng_hci_add_sco_con_cp cp;
372 ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b;
375 memset(&cp, 0, sizeof(cp));
376 cp.pkt_type = htole16(NG_HCI_PKT_HV1 | NG_HCI_PKT_HV2 | NG_HCI_PKT_HV3);
378 /* parse command parameters */
382 if (sscanf(argv[1], "%x", &n) != 1)
385 n &= (NG_HCI_PKT_HV1 | NG_HCI_PKT_HV2 | NG_HCI_PKT_HV3);
389 cp.pkt_type = (uint16_t) (n & 0x0fff);
390 cp.pkt_type = htole16(cp.pkt_type);
393 /* acl connection handle */
394 if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
397 cp.con_handle = (uint16_t) (n & 0x0fff);
398 cp.con_handle = htole16(cp.con_handle);
405 /* send request and expect status response */
407 if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LINK_CONTROL,
408 NG_HCI_OCF_ADD_SCO_CON),
409 (char const *) &cp, sizeof(cp), b, &n) == ERROR)
418 if (hci_recv(s, b, &n) == ERROR)
420 if (n < sizeof(*e)) {
425 if (e->event == NG_HCI_EVENT_CON_COMPL) {
426 ng_hci_con_compl_ep *ep = (ng_hci_con_compl_ep *)(e + 1);
428 if (ep->status != 0x00) {
429 fprintf(stdout, "Status: %s [%#02x]\n",
430 hci_status2str(ep->status), ep->status);
434 fprintf(stdout, "BD_ADDR: %s\n", hci_bdaddr2str(&ep->bdaddr));
435 fprintf(stdout, "Connection handle: %d\n",
436 le16toh(ep->con_handle));
437 fprintf(stdout, "Encryption mode: %s [%d]\n",
438 hci_encrypt2str(ep->encryption_mode, 0),
439 ep->encryption_mode);
444 } /* Add_SCO_Connection */
446 /* Send Change_Connection_Packet_Type command to the unit */
448 hci_change_connection_packet_type(int s, int argc, char **argv)
452 ng_hci_change_con_pkt_type_cp cp;
453 ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b;
457 /* connection handle */
458 if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
461 cp.con_handle = (uint16_t) (n & 0x0fff);
462 cp.con_handle = htole16(cp.con_handle);
465 if (sscanf(argv[1], "%x", &n) != 1)
468 cp.pkt_type = (uint16_t) (n & 0xffff);
469 cp.pkt_type = htole16(cp.pkt_type);
476 /* send request and expect status response */
478 if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LINK_CONTROL,
479 NG_HCI_OCF_CHANGE_CON_PKT_TYPE),
480 (char const *) &cp, sizeof(cp), b, &n) == ERROR)
489 if (hci_recv(s, b, &n) == ERROR)
491 if (n < sizeof(*e)) {
496 if (e->event == NG_HCI_EVENT_CON_PKT_TYPE_CHANGED) {
497 ng_hci_con_pkt_type_changed_ep *ep =
498 (ng_hci_con_pkt_type_changed_ep *)(e + 1);
500 if (ep->status != 0x00) {
501 fprintf(stdout, "Status: %s [%#02x]\n",
502 hci_status2str(ep->status), ep->status);
506 fprintf(stdout, "Connection handle: %d\n",
507 le16toh(ep->con_handle));
508 fprintf(stdout, "Packet type: %#04x\n",
509 le16toh(ep->pkt_type));
514 } /* hci_change_connection_packet_type */
516 /* Send Remote_Name_Request command to the unit */
518 hci_remote_name_request(int s, int argc, char **argv)
522 ng_hci_remote_name_req_cp cp;
523 ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b;
525 memset(&cp, 0, sizeof(cp));
526 cp.page_scan_rep_mode = NG_HCI_SCAN_REP_MODE0;
527 cp.page_scan_mode = NG_HCI_MANDATORY_PAGE_SCAN_MODE;
529 /* parse command parameters */
533 if (sscanf(argv[3], "%x", &n0) != 1)
536 cp.clock_offset = (n0 & 0xffff);
537 cp.clock_offset = htole16(cp.clock_offset);
541 if (sscanf(argv[2], "%d", &n0) != 1 || n0 < 0x00 || n0 > 0x03)
544 cp.page_scan_mode = (n0 & 0xff);
547 /* page_scan_rep_mode */
548 if (sscanf(argv[1], "%d", &n0) != 1 || n0 < 0x00 || n0 > 0x02)
551 cp.page_scan_rep_mode = (n0 & 0xff);
555 if (!bt_aton(argv[0], &cp.bdaddr)) {
556 struct hostent *he = NULL;
558 if ((he = bt_gethostbyname(argv[0])) == NULL)
561 memcpy(&cp.bdaddr, he->h_addr, sizeof(cp.bdaddr));
569 /* send request and expect status response */
571 if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LINK_CONTROL,
572 NG_HCI_OCF_REMOTE_NAME_REQ),
573 (char const *) &cp, sizeof(cp), b, &n0) == ERROR)
582 if (hci_recv(s, b, &n0) == ERROR)
584 if (n0 < sizeof(*e)) {
589 if (e->event == NG_HCI_EVENT_REMOTE_NAME_REQ_COMPL) {
590 ng_hci_remote_name_req_compl_ep *ep =
591 (ng_hci_remote_name_req_compl_ep *)(e + 1);
593 if (ep->status != 0x00) {
594 fprintf(stdout, "Status: %s [%#02x]\n",
595 hci_status2str(ep->status), ep->status);
599 fprintf(stdout, "BD_ADDR: %s\n", hci_bdaddr2str(&ep->bdaddr));
600 fprintf(stdout, "Name: %s\n", ep->name);
605 } /* hci_remote_name_request */
607 /* Send Read_Remote_Supported_Features command to the unit */
609 hci_read_remote_supported_features(int s, int argc, char **argv)
613 ng_hci_read_remote_features_cp cp;
614 ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b;
617 /* parse command parameters */
620 /* connecton handle */
621 if (sscanf(argv[0], "%d", &n) != 1 || n < 0 || n > 0x0eff)
624 cp.con_handle = (n & 0x0fff);
625 cp.con_handle = htole16(cp.con_handle);
632 /* send request and expect status response */
634 if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LINK_CONTROL,
635 NG_HCI_OCF_READ_REMOTE_FEATURES),
636 (char const *) &cp, sizeof(cp), b, &n) == ERROR)
645 if (hci_recv(s, b, &n) == ERROR)
648 if (n < sizeof(*e)) {
653 if (e->event == NG_HCI_EVENT_READ_REMOTE_FEATURES_COMPL) {
654 ng_hci_read_remote_features_compl_ep *ep =
655 (ng_hci_read_remote_features_compl_ep *)(e + 1);
657 if (ep->status != 0x00) {
658 fprintf(stdout, "Status: %s [%#02x]\n",
659 hci_status2str(ep->status), ep->status);
663 fprintf(stdout, "Connection handle: %d\n",
664 le16toh(ep->con_handle));
665 fprintf(stdout, "Features: ");
666 for (n = 0; n < sizeof(ep->features); n++)
667 fprintf(stdout, "%#02x ", ep->features[n]);
668 fprintf(stdout, "\n%s\n", hci_features2str(ep->features,
669 buffer, sizeof(buffer)));
674 } /* hci_read_remote_supported_features */
676 /* Send Read_Remote_Version_Information command to the unit */
678 hci_read_remote_version_information(int s, int argc, char **argv)
682 ng_hci_read_remote_ver_info_cp cp;
683 ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b;
685 /* parse command parameters */
688 /* connecton handle */
689 if (sscanf(argv[0], "%d", &n) != 1 || n < 0 || n > 0x0eff)
692 cp.con_handle = (n & 0x0fff);
693 cp.con_handle = htole16(cp.con_handle);
700 /* send request and expect status response */
702 if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LINK_CONTROL,
703 NG_HCI_OCF_READ_REMOTE_VER_INFO),
704 (char const *) &cp, sizeof(cp), b, &n) == ERROR)
713 if (hci_recv(s, b, &n) == ERROR)
716 if (n < sizeof(*e)) {
721 if (e->event == NG_HCI_EVENT_READ_REMOTE_VER_INFO_COMPL) {
722 ng_hci_read_remote_ver_info_compl_ep *ep =
723 (ng_hci_read_remote_ver_info_compl_ep *)(e + 1);
725 if (ep->status != 0x00) {
726 fprintf(stdout, "Status: %s [%#02x]\n",
727 hci_status2str(ep->status), ep->status);
731 ep->manufacturer = le16toh(ep->manufacturer);
733 fprintf(stdout, "Connection handle: %d\n",
734 le16toh(ep->con_handle));
735 fprintf(stdout, "LMP version: %s [%#02x]\n",
736 hci_lmpver2str(ep->lmp_version), ep->lmp_version);
737 fprintf(stdout, "LMP sub-version: %#04x\n",
738 le16toh(ep->lmp_subversion));
739 fprintf(stdout, "Manufacturer: %s [%#04x]\n",
740 hci_manufacturer2str(ep->manufacturer),
746 } /* hci_read_remote_version_information */
748 /* Send Read_Clock_Offset command to the unit */
750 hci_read_clock_offset(int s, int argc, char **argv)
754 ng_hci_read_clock_offset_cp cp;
755 ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b;
757 /* parse command parameters */
760 /* connecton handle */
761 if (sscanf(argv[0], "%d", &n) != 1 || n < 0 || n > 0x0eff)
764 cp.con_handle = (n & 0x0fff);
765 cp.con_handle = htole16(cp.con_handle);
772 /* send request and expect status response */
774 if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LINK_CONTROL,
775 NG_HCI_OCF_READ_CLOCK_OFFSET),
776 (char const *) &cp, sizeof(cp), b, &n) == ERROR)
785 if (hci_recv(s, b, &n) == ERROR)
788 if (n < sizeof(*e)) {
793 if (e->event == NG_HCI_EVENT_READ_CLOCK_OFFSET_COMPL) {
794 ng_hci_read_clock_offset_compl_ep *ep =
795 (ng_hci_read_clock_offset_compl_ep *)(e + 1);
797 if (ep->status != 0x00) {
798 fprintf(stdout, "Status: %s [%#02x]\n",
799 hci_status2str(ep->status), ep->status);
803 fprintf(stdout, "Connection handle: %d\n",
804 le16toh(ep->con_handle));
805 fprintf(stdout, "Clock offset: %#04x\n",
806 le16toh(ep->clock_offset));
811 } /* hci_read_clock_offset */
813 struct hci_command link_control_commands[] = {
815 "inquiry <LAP> <inquiry_length> <num_reponses>",
816 "\nThis command will cause the Bluetooth unit to enter Inquiry Mode.\n" \
817 "Inquiry Mode is used to discover other nearby Bluetooth units. The LAP\n" \
818 "input parameter contains the LAP from which the inquiry access code shall\n" \
819 "be derived when the inquiry procedure is made. The Inquiry_Length parameter\n"\
820 "specifies the total duration of the Inquiry Mode and, when this time\n" \
821 "expires, Inquiry will be halted. The Num_Responses parameter specifies the\n" \
822 "number of responses that can be received before the Inquiry is halted.\n\n" \
823 "\t<LAP> - xx:xx:xx; 9e:8b:33 (GIAC), 93:8b:00 (LDIAC)\n" \
824 "\t<inquiry_length> - dd; total length == dd * 1.28 sec\n" \
825 "\t<num_responses> - dd",
829 "create_connection <BD_ADDR> <pkt> <rep_mode> <ps_mode> <clck_off> <role_sw>",
831 "\t<BD_ADDR> - xx:xx:xx:xx:xx:xx BD_ADDR or name\n\n" \
832 "\t<pkt> - xxxx; packet type\n" \
834 "\t\tACL packets\n" \
835 "\t\t-----------\n" \
841 "\t\t0x8000 DH5\n\n" \
843 "\trep_mode - d; page scan repetition mode\n" \
845 "\t\tPage scan repetition modes\n" \
846 "\t\t--------------------------\n" \
847 "\t\t0 Page scan repetition mode 0\n" \
848 "\t\t1 Page scan repetition mode 1\n" \
849 "\t\t2 Page scan repetition mode 2\n" \
851 "\tps_mode - d; Page scan mode\n" \
853 "\t\tPage scan modes\n" \
854 "\t\t---------------\n" \
855 "\t\t0 Mandatory page scan mode\n" \
856 "\t\t1 Optional page scan mode1\n" \
857 "\t\t2 Optional page scan mode2\n" \
858 "\t\t3 Optional page scan mode3\n" \
860 "\tclck_off - dddd; clock offset. Use 0 if unknown\n\n" \
861 "\trole_sw - d; allow (1) or deny role switch\n",
862 &hci_create_connection
865 "disconnect <connection_handle> <reason>",
866 "\nThe Disconnection command is used to terminate an existing connection.\n" \
867 "The connection handle command parameter indicates which connection is to\n" \
868 "be disconnected. The Reason command parameter indicates the reason for\n" \
869 "ending the connection.\n\n" \
870 "\t<connection_handle> - dddd; connection handle\n" \
871 "\t<reason> - dd; reason; usually 19 (0x13) - user ended;\n" \
872 "\t also 0x05, 0x13-0x15, 0x1A, 0x29",
876 "add_sco_connection <acl connection handle> <packet type>",
877 "This command will cause the link manager to create a SCO connection using\n" \
878 "the ACL connection specified by the connection handle command parameter.\n" \
879 "The Link Manager will determine how the new connection is established. This\n"\
880 "connection is determined by the current state of the device, its piconet,\n" \
881 "and the state of the device to be connected. The packet type command parameter\n" \
882 "specifies which packet types the Link Manager should use for the connection.\n"\
883 "The Link Manager must only use the packet type(s) specified by the packet\n" \
884 "type command parameter for sending HCI SCO data packets. Multiple packet\n" \
885 "types may be specified for the packet type command parameter by performing\n" \
886 "a bitwise OR operation of the different packet types. Note: An SCO connection\n" \
887 "can only be created when an ACL connection already exists and when it is\n" \
888 "not put in park mode.\n\n" \
889 "\t<connection_handle> - dddd; ACL connection handle\n" \
890 "\t<packet_type> - xxxx; packet type\n" \
892 "\t\tSCO packets\n" \
893 "\t\t-----------\n" \
897 &hci_add_sco_connection
900 "change_connection_packet_type <connection_hande> <packet_type>",
901 "The Change_Connection_Packet_Type command is used to change which packet\n" \
902 "types can be used for a connection that is currently established. This\n" \
903 "allows current connections to be dynamically modified to support different\n" \
904 "types of user data. The Packet_Type command parameter specifies which\n" \
905 "packet types the Link Manager can use for the connection. Multiple packet\n" \
906 "types may be specified for the Packet_Type command parameter by bitwise OR\n" \
907 "operation of the different packet types.\n\n" \
908 "\t<connection_handle> - dddd; connection handle\n" \
909 "\t<packet_type> - xxxx; packet type mask\n" \
911 "\t\tACL packets\n" \
912 "\t\t-----------\n" \
918 "\t\t0x8000 DH5\n\n" \
920 "\t\tSCO packets\n" \
921 "\t\t-----------\n" \
926 &hci_change_connection_packet_type
929 "remote_name_request <BD_ADDR> <ps_rep_mode> <ps_mode> <clock_offset>",
930 "\nThe Remote_Name_Request command is used to obtain the user-friendly\n" \
931 "name of another Bluetooth unit.\n\n" \
932 "\t<BD_ADDR> - xx:xx:xx:xx:xx:xx BD_ADDR or name\n" \
933 "\t<ps_rep_mode> - dd; page scan repetition mode [0-2]\n" \
934 "\t<ps_mode> - dd; page scan mode [0-3]\n" \
935 "\t<clock_offset> - xxxx; clock offset [0 - 0xffff]",
936 &hci_remote_name_request
939 "read_remote_supported_features <connection_handle>",
940 "\nThis command requests a list of the supported features for the remote\n" \
941 "unit identified by the connection handle parameter. The connection handle\n" \
942 "must be a connection handle for an ACL connection.\n\n" \
943 "\t<connection_handle> - dddd; connection handle",
944 &hci_read_remote_supported_features
947 "read_remote_version_information <connection_handle>",
948 "\nThis command will obtain the values for the version information for the\n" \
949 "remote Bluetooth unit identified by the connection handle parameter. The\n" \
950 "connection handle must be a connection handle for an ACL connection.\n\n" \
951 "\t<connection_handle> - dddd; connection handle",
952 &hci_read_remote_version_information
955 "read_clock_offset <connection_handle>",
956 "\nThis command allows the Host to read the clock offset from the remote unit.\n" \
957 "\t<connection_handle> - dddd; connection handle",
958 &hci_read_clock_offset