Exemplo n.º 1
0
def _write_flush_timeout(addr, timeout):
    hci_sock = _bt.hci_open_dev()
    # get the ACL connection handle to the remote device
    handle = _get_acl_conn_handle(hci_sock, addr)
    # XXX should this be "<HH"
    pkt = struct.pack("HH", handle, _bt.htobs(timeout))
    response = _bt.hci_send_req(hci_sock, _bt.OGF_HOST_CTL, 0x0028, _bt.EVT_CMD_COMPLETE, 3, pkt)
    status = struct.unpack("B", response[0])[0]
    rhandle = struct.unpack("H", response[1:3])[0]
    assert rhandle == handle
    assert status == 0
def write_flush_timeout( addr, timeout ):
    hci_sock = bt.hci_open_dev()
    # get the ACL connection handle to the remote device
    handle = __get_acl_conn_handle(hci_sock, addr)
    pkt = struct.pack("HH", handle, bt.htobs(timeout))
    response = bt.hci_send_req(hci_sock, bt.OGF_HOST_CTL, 
        0x0028, bt.EVT_CMD_COMPLETE, 3, pkt)
    status = struct.unpack("B", response[0])[0]
    rhandle = struct.unpack("H", response[1:3])[0]
    assert rhandle == handle 
    assert status == 0
Exemplo n.º 3
0
def _read_flush_timeout(addr):
    hci_sock = _bt.hci_open_dev()
    # get the ACL connection handle to the remote device
    handle = _get_acl_conn_handle(hci_sock, addr)
    # XXX should this be "<H"?
    pkt = struct.pack("H", handle)
    response = _bt.hci_send_req(hci_sock, _bt.OGF_HOST_CTL, 0x0027, _bt.EVT_CMD_COMPLETE, 5, pkt)
    status = struct.unpack("B", response[0])[0]
    rhandle = struct.unpack("H", response[1:3])[0]
    assert rhandle == handle
    assert status == 0
    fto = struct.unpack("H", response[3:5])[0]
    return fto
def read_flush_timeout( addr ):
    hci_sock = bt.hci_open_dev()
    # get the ACL connection handle to the remote device
    handle = __get_acl_conn_handle(hci_sock, addr)
    pkt = struct.pack("H", handle)
    response = bt.hci_send_req(hci_sock, bt.OGF_HOST_CTL, 
        0x0027, bt.EVT_CMD_COMPLETE, 5, pkt)
    status = struct.unpack("B", response[0])[0]
    rhandle = struct.unpack("H", response[1:3])[0]
    assert rhandle == handle
    assert status == 0
    fto = struct.unpack("H", response[3:5])[0]
    return fto