IBluetoothGatt.aidl 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * Copyright 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. package android.bluetooth;
  17. import android.app.PendingIntent;
  18. import android.bluetooth.BluetoothDevice;
  19. import android.bluetooth.BluetoothGattService;
  20. import android.bluetooth.le.AdvertiseSettings;
  21. import android.bluetooth.le.AdvertiseData;
  22. import android.bluetooth.le.AdvertisingSetParameters;
  23. import android.bluetooth.le.PeriodicAdvertisingParameters;
  24. import android.bluetooth.le.ScanFilter;
  25. import android.bluetooth.le.ScanResult;
  26. import android.bluetooth.le.ScanSettings;
  27. import android.bluetooth.le.ResultStorageDescriptor;
  28. import android.os.ParcelUuid;
  29. import android.os.WorkSource;
  30. import android.bluetooth.IBluetoothGattCallback;
  31. import android.bluetooth.IBluetoothGattServerCallback;
  32. import android.bluetooth.le.IAdvertisingSetCallback;
  33. import android.bluetooth.le.IPeriodicAdvertisingCallback;
  34. import android.bluetooth.le.IScannerCallback;
  35. /**
  36. * API for interacting with BLE / GATT
  37. * @hide
  38. */
  39. interface IBluetoothGatt {
  40. List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
  41. void registerScanner(in IScannerCallback callback, in WorkSource workSource);
  42. void unregisterScanner(in int scannerId);
  43. void startScan(in int scannerId, in ScanSettings settings, in List<ScanFilter> filters,
  44. in List scanStorages, in String callingPackage);
  45. void startScanForIntent(in PendingIntent intent, in ScanSettings settings, in List<ScanFilter> filters,
  46. in String callingPackage);
  47. void stopScanForIntent(in PendingIntent intent, in String callingPackage);
  48. void stopScan(in int scannerId);
  49. void flushPendingBatchResults(in int scannerId);
  50. void startAdvertisingSet(in AdvertisingSetParameters parameters, in AdvertiseData advertiseData,
  51. in AdvertiseData scanResponse, in PeriodicAdvertisingParameters periodicParameters,
  52. in AdvertiseData periodicData, in int duration, in int maxExtAdvEvents,
  53. in IAdvertisingSetCallback callback);
  54. void stopAdvertisingSet(in IAdvertisingSetCallback callback);
  55. void getOwnAddress(in int advertiserId);
  56. void enableAdvertisingSet(in int advertiserId, in boolean enable, in int duration, in int maxExtAdvEvents);
  57. void setAdvertisingData(in int advertiserId, in AdvertiseData data);
  58. void setScanResponseData(in int advertiserId, in AdvertiseData data);
  59. void setAdvertisingParameters(in int advertiserId, in AdvertisingSetParameters parameters);
  60. void setPeriodicAdvertisingParameters(in int advertiserId, in PeriodicAdvertisingParameters parameters);
  61. void setPeriodicAdvertisingData(in int advertiserId, in AdvertiseData data);
  62. void setPeriodicAdvertisingEnable(in int advertiserId, in boolean enable);
  63. void registerSync(in ScanResult scanResult, in int skip, in int timeout, in IPeriodicAdvertisingCallback callback);
  64. void unregisterSync(in IPeriodicAdvertisingCallback callback);
  65. void registerClient(in ParcelUuid appId, in IBluetoothGattCallback callback);
  66. void unregisterClient(in int clientIf);
  67. void clientConnect(in int clientIf, in String address, in boolean isDirect, in int transport, in boolean opportunistic, in int phy);
  68. void clientDisconnect(in int clientIf, in String address);
  69. void clientSetPreferredPhy(in int clientIf, in String address, in int txPhy, in int rxPhy, in int phyOptions);
  70. void clientReadPhy(in int clientIf, in String address);
  71. void refreshDevice(in int clientIf, in String address);
  72. void discoverServices(in int clientIf, in String address);
  73. void discoverServiceByUuid(in int clientIf, in String address, in ParcelUuid uuid);
  74. void readCharacteristic(in int clientIf, in String address, in int handle, in int authReq);
  75. void readUsingCharacteristicUuid(in int clientIf, in String address, in ParcelUuid uuid,
  76. in int startHandle, in int endHandle, in int authReq);
  77. void writeCharacteristic(in int clientIf, in String address, in int handle,
  78. in int writeType, in int authReq, in byte[] value);
  79. void readDescriptor(in int clientIf, in String address, in int handle, in int authReq);
  80. void writeDescriptor(in int clientIf, in String address, in int handle,
  81. in int authReq, in byte[] value);
  82. void registerForNotification(in int clientIf, in String address, in int handle, in boolean enable);
  83. void beginReliableWrite(in int clientIf, in String address);
  84. void endReliableWrite(in int clientIf, in String address, in boolean execute);
  85. void readRemoteRssi(in int clientIf, in String address);
  86. void configureMTU(in int clientIf, in String address, in int mtu);
  87. void connectionParameterUpdate(in int clientIf, in String address, in int connectionPriority);
  88. void leConnectionUpdate(int clientIf, String address, int minInterval,
  89. int maxInterval, int slaveLatency, int supervisionTimeout,
  90. int minConnectionEventLen, int maxConnectionEventLen);
  91. void registerServer(in ParcelUuid appId, in IBluetoothGattServerCallback callback);
  92. void unregisterServer(in int serverIf);
  93. void serverConnect(in int serverIf, in String address, in boolean isDirect, in int transport);
  94. void serverDisconnect(in int serverIf, in String address);
  95. void serverSetPreferredPhy(in int clientIf, in String address, in int txPhy, in int rxPhy, in int phyOptions);
  96. void serverReadPhy(in int clientIf, in String address);
  97. void addService(in int serverIf, in BluetoothGattService service);
  98. void removeService(in int serverIf, in int handle);
  99. void clearServices(in int serverIf);
  100. void sendResponse(in int serverIf, in String address, in int requestId,
  101. in int status, in int offset, in byte[] value);
  102. void sendNotification(in int serverIf, in String address, in int handle,
  103. in boolean confirm, in byte[] value);
  104. void disconnectAll();
  105. void unregAll();
  106. int numHwTrackFiltersAvailable();
  107. }