def read_inquiry_mode(sock):
<EOL>old_filter = sock.getsockopt( bluez.SOL_HCI, bluez.HCI_FILTER, <NUM_LIT>)<EOL>flt = bluez.hci_filter_new()<EOL>opcode = bluez.cmd_opcode_pack(bluez.OGF_HOST_CTL, <EOL>bluez.OCF_READ_INQUIRY_MODE)<EOL>bluez.hci_filter_set_ptype(flt, bluez.HCI_EVENT_PKT)<EOL>bluez.hci_filter_set_event(flt, bluez.EVT_CMD_COMPLETE);<EOL>bluez.hci_filter_set_opcode(flt, opcode)<EOL>sock.setsockopt( bluez.SOL_HCI, bluez.HCI_FILTER, flt )<EOL>bluez.hci_send_cmd(sock, bluez.OGF_HOST_CTL, <EOL>bluez.OCF_READ_INQUIRY_MODE )<EOL>pkt = sock.recv(<NUM_LIT:255>)<EOL>status,mode = struct.unpack("<STR_LIT>", pkt)<EOL>if status != <NUM_LIT:0>: mode = -<NUM_LIT:1><EOL>sock.setsockopt( bluez.SOL_HCI, bluez.HCI_FILTER, old_filter )<EOL>return mode<EOL>
returns the current mode, or -1 on failure