• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2015 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 
17 package com.android.bluetooth.gatt;
18 
19 import android.annotation.Nullable;
20 
21 /** @hide */
22 public class AdvtFilterOnFoundOnLostInfo {
23     private int mClientIf;
24 
25     private int mAdvPktLen;
26     @Nullable private byte[] mAdvPkt;
27 
28     private int mScanRspLen;
29 
30     @Nullable private byte[] mScanRsp;
31 
32     private int mFiltIndex;
33     private int mAdvState;
34     private int mAdvInfoPresent;
35     private String mAddress;
36 
37     private int mAddrType;
38     private int mTxPower;
39     private int mRssiValue;
40     private int mTimeStamp;
41 
AdvtFilterOnFoundOnLostInfo(int clientIf, int advPktLen, byte[] advPkt, int scanRspLen, byte[] scanRsp, int filtIndex, int advState, int advInfoPresent, String address, int addrType, int txPower, int rssiValue, int timeStamp)42     public AdvtFilterOnFoundOnLostInfo(int clientIf, int advPktLen, byte[] advPkt, int scanRspLen,
43             byte[] scanRsp, int filtIndex, int advState, int advInfoPresent, String address,
44             int addrType, int txPower, int rssiValue, int timeStamp) {
45 
46         mClientIf = clientIf;
47         mAdvPktLen = advPktLen;
48         mAdvPkt = advPkt;
49         mScanRspLen = scanRspLen;
50         mScanRsp = scanRsp;
51         mFiltIndex = filtIndex;
52         mAdvState = advState;
53         mAdvInfoPresent = advInfoPresent;
54         mAddress = address;
55         mAddrType = addrType;
56         mTxPower = txPower;
57         mRssiValue = rssiValue;
58         mTimeStamp = timeStamp;
59     }
60 
getClientIf()61     public int getClientIf() {
62         return mClientIf;
63     }
64 
getFiltIndex()65     public int getFiltIndex() {
66         return mFiltIndex;
67     }
68 
getAdvState()69     public int getAdvState() {
70         return mAdvState;
71     }
72 
getTxPower()73     public int getTxPower() {
74         return mTxPower;
75     }
76 
getTimeStamp()77     public int getTimeStamp() {
78         return mTimeStamp;
79     }
80 
getRSSIValue()81     public int getRSSIValue() {
82         return mRssiValue;
83     }
84 
getAdvInfoPresent()85     public int getAdvInfoPresent() {
86         return mAdvInfoPresent;
87     }
88 
getAddress()89     public String getAddress() {
90         return mAddress;
91     }
92 
getAddressType()93     public int getAddressType() {
94         return mAddrType;
95     }
96 
getAdvPacketData()97     public byte[] getAdvPacketData() {
98         return mAdvPkt;
99     }
100 
getAdvPacketLen()101     public int getAdvPacketLen() {
102         return mAdvPktLen;
103     }
104 
getScanRspData()105     public byte[] getScanRspData() {
106         return mScanRsp;
107     }
108 
getScanRspLen()109     public int getScanRspLen() {
110         return mScanRspLen;
111     }
112 
getResult()113     public byte[] getResult() {
114         int resultLength = mAdvPkt.length + ((mScanRsp != null) ? mScanRsp.length : 0);
115         byte[] result = new byte[resultLength];
116         System.arraycopy(mAdvPkt, 0, result, 0, mAdvPkt.length);
117         if (mScanRsp != null) {
118             System.arraycopy(mScanRsp, 0, result, mAdvPkt.length, mScanRsp.length);
119         }
120         return result;
121     }
122 
123 }
124 
125