ScanClient.java revision a2be7670787cc4576386bf4a8baea4b88d35e90b
1/* 2 * Copyright (C) 2013 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.bluetooth.gatt; 18 19import android.bluetooth.le.ScanFilter; 20import android.bluetooth.le.ScanSettings; 21 22import java.util.List; 23import java.util.UUID; 24 25/** 26 * Helper class identifying a client that has requested LE scan results. 27 * 28 * @hide 29 */ 30/* package */class ScanClient { 31 int appIf; 32 boolean isServer; 33 UUID[] uuids; 34 ScanSettings settings; 35 List<ScanFilter> filters; 36 private static final ScanSettings DEFAULT_SCAN_SETTINGS = new ScanSettings.Builder() 37 .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY).build(); 38 39 ScanClient(int appIf, boolean isServer) { 40 this(appIf, isServer, new UUID[0], DEFAULT_SCAN_SETTINGS, null); 41 } 42 43 ScanClient(int appIf, boolean isServer, UUID[] uuids) { 44 this(appIf, isServer, uuids, DEFAULT_SCAN_SETTINGS, null); 45 } 46 47 ScanClient(int appIf, boolean isServer, ScanSettings settings, 48 List<ScanFilter> filters) { 49 this(appIf, isServer, new UUID[0], settings, filters); 50 } 51 52 private ScanClient(int appIf, boolean isServer, UUID[] uuids, ScanSettings settings, 53 List<ScanFilter> filters) { 54 this.appIf = appIf; 55 this.isServer = isServer; 56 this.uuids = uuids; 57 this.settings = settings; 58 this.filters = filters; 59 60 } 61} 62