def write_inquiry_scan_activity(sock, interval, window):
<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_WRITE_INQ_ACTIVITY)<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_WRITE_INQ_ACTIVITY, struct.pack("<STR_LIT>", <EOL>interval, window) )<EOL>pkt = sock.recv(<NUM_LIT:255>)<EOL>status = struct.unpack("<STR_LIT>", pkt)[<NUM_LIT:0>]<EOL>sock.setsockopt( bluez.SOL_HCI, bluez.HCI_FILTER, old_filter )<EOL>if status != <NUM_LIT:0>: return -<NUM_LIT:1><EOL>return <NUM_LIT:0><EOL>
returns 0 on success, -1 on failure