diff options
author | Jin Chen <jinjiechen@google.com> | 2022-06-30 17:23:50 +0000 |
---|---|---|
committer | Jin Chen <jinjiechen@google.com> | 2022-06-30 17:23:50 +0000 |
commit | 3d29b25f6e66ec9cdf13aa12cbdd1ed734c3b9b7 (patch) | |
tree | b16b3f5794db4174d6c91a012ee491ba70e42cb3 | |
parent | b3fd7949f4664edc61ffcacff690f907b51ae96c (diff) | |
download | Uwb-3d29b25f6e66ec9cdf13aa12cbdd1ed734c3b9b7.tar.gz |
[uwb] Add sendMessage to TransportServerService
Bug: 197341177
Test: atest ServiceUwbTests
Change-Id: I2be4e97afffccc0e70913a6a6d3f6dae4aaa099f
3 files changed, 15 insertions, 3 deletions
diff --git a/service/java/com/android/server/uwb/discovery/TransportServerService.java b/service/java/com/android/server/uwb/discovery/TransportServerService.java index 8f8093ab..742dc065 100644 --- a/service/java/com/android/server/uwb/discovery/TransportServerService.java +++ b/service/java/com/android/server/uwb/discovery/TransportServerService.java @@ -24,6 +24,7 @@ import androidx.annotation.WorkerThread; import com.android.server.uwb.discovery.TransportServerProvider.TransportServerCallback; import com.android.server.uwb.discovery.ble.GattTransportServerProvider; import com.android.server.uwb.discovery.info.DiscoveryInfo; +import com.android.server.uwb.discovery.info.FiraConnectorMessage; /** This service manages the TransportServerProvider. */ @WorkerThread @@ -78,4 +79,15 @@ public class TransportServerService { } return mTransportServerProvider.stop(); } + + /** + * Send a FiRa connector message to the remote device through the transport server. + * + * @param secid destination SECID on remote device. + * @param message message to be send. + * @return indicates if succeefully started. + */ + public boolean sendMessage(int secid, FiraConnectorMessage message) { + return mTransportServerProvider.sendMessage(secid, message); + } } diff --git a/service/java/com/android/server/uwb/discovery/ble/GattTransportServerProvider.java b/service/java/com/android/server/uwb/discovery/ble/GattTransportServerProvider.java index 050e3010..a0d0b8dc 100644 --- a/service/java/com/android/server/uwb/discovery/ble/GattTransportServerProvider.java +++ b/service/java/com/android/server/uwb/discovery/ble/GattTransportServerProvider.java @@ -450,9 +450,7 @@ public class GattTransportServerProvider extends TransportServerProvider { } /** - * Start processing of the FiRa Connector Data Packets and the FiRa Connector Messages through - * the In/Out control point characterstic when all conditions are meet to start the FiRa GATT - * server. + * Check if processing has started. * * @return indicate if server has started processing. */ diff --git a/service/java/com/android/server/uwb/discovery/ble/UuidConstants.java b/service/java/com/android/server/uwb/discovery/ble/UuidConstants.java index 0bbac7a9..3890bcab 100644 --- a/service/java/com/android/server/uwb/discovery/ble/UuidConstants.java +++ b/service/java/com/android/server/uwb/discovery/ble/UuidConstants.java @@ -43,4 +43,6 @@ public class UuidConstants { /* Client Characteristic Configuration Descriptor UUID defined by Bluetooth specification. */ public static final ParcelUuid CCCD_UUID = BluetoothUuid.parseUuidFrom(new byte[] {0x29, 0x02}); + + private UuidConstants() {} } |