Loading android/pandora/mmi2grpc/mmi2grpc/hfp.py +15 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ class HFPProxy(ProfileProxy): self.hfp = HFP(channel) self.host = Host(channel) self.connection = None @assert_description def TSC_delete_pairing_iut(self, pts_addr: bytes, **kwargs): """ Loading @@ -40,6 +42,18 @@ class HFPProxy(ProfileProxy): self.host.DeletePairing(address=pts_addr) return "OK" @assert_description def TSC_iut_enable_slc(self, pts_addr: bytes, **kwargs): """ Click Ok, then initiate a service level connection from the Implementation Under Test (IUT) to the PTS. """ if not self.connection: self.connection = self.host.Connect(address=pts_addr).connection self.hfp.EnableSlc(connection=self.connection) return "OK" @assert_description def TSC_iut_search(self, **kwargs): """ Loading @@ -66,5 +80,5 @@ class HFPProxy(ProfileProxy): Implementation Under Test (IUT). """ self.hfp.DisableSlc(address=pts_addr) self.hfp.DisableSlc(connection=self.connection) return "OK" android/pandora/server/configs/PtsBotTest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -23,5 +23,7 @@ <option name="profile" value="A2DP/SRC" /> <option name="profile" value="AVDTP/SRC" /> <option name="profile" value="HFP/AG/DIS" /> <option name="profile" value="HFP/AG/HFI" /> <option name="profile" value="HFP/AG/SLC" /> </test> </configuration> android/pandora/server/configs/pts_bot_tests_config.json +14 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,12 @@ "AVDTP/SRC/INT/SIG/SMG/BV-28-C", "AVDTP/SRC/INT/SIG/SMG/BV-31-C", "AVDTP/SRC/INT/SIG/SYN/BV-05-C", "AVDTP/SRC/INT/TRA/BTR/BV-01-C" "AVDTP/SRC/INT/TRA/BTR/BV-01-C", "HFP/AG/DIS/BV-01-I", "HFP/AG/HFI/BI-03-I", "HFP/AG/HFI/BV-02-I", "HFP/AG/SLC/BV-09-I", "HFP/AG/SLC/BV-10-I" ], "skip": [ "A2DP/SRC/AS/BV-01-I", Loading @@ -61,7 +66,14 @@ "AVDTP/SRC/INT/SIG/SMG/BV-11-C", "AVDTP/SRC/INT/SIG/SMG/BV-13-C", "AVDTP/SRC/INT/SIG/SMG/BV-23-C", "AVDTP/SRC/INT/SIG/SMG/ESR05/BV-13-C" "AVDTP/SRC/INT/SIG/SMG/ESR05/BV-13-C", "HFP/AG/SLC/BV-01-C", "HFP/AG/SLC/BV-02-C", "HFP/AG/SLC/BV-03-C", "HFP/AG/SLC/BV-04-C", "HFP/AG/SLC/BV-05-I", "HFP/AG/SLC/BV-06-I", "HFP/AG/SLC/BV-07-I" ], "ics": { "TSPC_4.0HCI_1a_2": true, Loading android/pandora/server/proto/pandora/hfp.proto +12 −7 Original line number Diff line number Diff line Loading @@ -5,19 +5,24 @@ option java_outer_classname = "HfpProto"; package pandora; import "pandora/host.proto"; import "google/protobuf/wrappers.proto"; import "google/protobuf/empty.proto"; // Service to trigger HFP (Hands Free Profile) procedures. service HFP { // Enable Service level connection rpc EnableSlc(EnableSlcRequest) returns (google.protobuf.Empty); // Disable Service level connection rpc DisableSlc(DisableSlcRequest) returns (DisableSlcResponse); rpc DisableSlc(DisableSlcRequest) returns (google.protobuf.Empty); } // Request of the `EnableSlc` method. message EnableSlcRequest { // Connection crafted by grpc server Connection connection = 1; } // Request of the `DisableSlc` method. message DisableSlcRequest { // Local Bluetooth Device Address as array of 6 bytes. bytes address = 1; // Connection crafted by grpc server Connection connection = 1; } // Response of the `DisableSlc` method. message DisableSlcResponse {} android/pandora/server/src/com/android/pandora/Hfp.kt +15 −7 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.bluetooth.BluetoothProfile import android.content.Context import android.content.Intent import android.content.IntentFilter import com.google.protobuf.Empty import io.grpc.stub.StreamObserver import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers Loading Loading @@ -56,16 +57,23 @@ class Hfp(val context: Context) : HFPImplBase() { scope.cancel() } override fun disableSlc( request: DisableSlcRequest, responseObserver: StreamObserver<DisableSlcResponse> ) { grpcUnary<DisableSlcResponse>(scope, responseObserver) { val device = request.address.toBluetoothDevice(bluetoothAdapter) override fun enableSlc(request: EnableSlcRequest, responseObserver: StreamObserver<Empty>) { grpcUnary<Empty>(scope, responseObserver) { val device = request.connection.toBluetoothDevice(bluetoothAdapter) bluetoothHfp.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED) Empty.getDefaultInstance() } } override fun disableSlc(request: DisableSlcRequest, responseObserver: StreamObserver<Empty>) { grpcUnary<Empty>(scope, responseObserver) { val device = request.connection.toBluetoothDevice(bluetoothAdapter) bluetoothHfp.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) DisableSlcResponse.getDefaultInstance() Empty.getDefaultInstance() } } } Loading
android/pandora/mmi2grpc/mmi2grpc/hfp.py +15 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ class HFPProxy(ProfileProxy): self.hfp = HFP(channel) self.host = Host(channel) self.connection = None @assert_description def TSC_delete_pairing_iut(self, pts_addr: bytes, **kwargs): """ Loading @@ -40,6 +42,18 @@ class HFPProxy(ProfileProxy): self.host.DeletePairing(address=pts_addr) return "OK" @assert_description def TSC_iut_enable_slc(self, pts_addr: bytes, **kwargs): """ Click Ok, then initiate a service level connection from the Implementation Under Test (IUT) to the PTS. """ if not self.connection: self.connection = self.host.Connect(address=pts_addr).connection self.hfp.EnableSlc(connection=self.connection) return "OK" @assert_description def TSC_iut_search(self, **kwargs): """ Loading @@ -66,5 +80,5 @@ class HFPProxy(ProfileProxy): Implementation Under Test (IUT). """ self.hfp.DisableSlc(address=pts_addr) self.hfp.DisableSlc(connection=self.connection) return "OK"
android/pandora/server/configs/PtsBotTest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -23,5 +23,7 @@ <option name="profile" value="A2DP/SRC" /> <option name="profile" value="AVDTP/SRC" /> <option name="profile" value="HFP/AG/DIS" /> <option name="profile" value="HFP/AG/HFI" /> <option name="profile" value="HFP/AG/SLC" /> </test> </configuration>
android/pandora/server/configs/pts_bot_tests_config.json +14 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,12 @@ "AVDTP/SRC/INT/SIG/SMG/BV-28-C", "AVDTP/SRC/INT/SIG/SMG/BV-31-C", "AVDTP/SRC/INT/SIG/SYN/BV-05-C", "AVDTP/SRC/INT/TRA/BTR/BV-01-C" "AVDTP/SRC/INT/TRA/BTR/BV-01-C", "HFP/AG/DIS/BV-01-I", "HFP/AG/HFI/BI-03-I", "HFP/AG/HFI/BV-02-I", "HFP/AG/SLC/BV-09-I", "HFP/AG/SLC/BV-10-I" ], "skip": [ "A2DP/SRC/AS/BV-01-I", Loading @@ -61,7 +66,14 @@ "AVDTP/SRC/INT/SIG/SMG/BV-11-C", "AVDTP/SRC/INT/SIG/SMG/BV-13-C", "AVDTP/SRC/INT/SIG/SMG/BV-23-C", "AVDTP/SRC/INT/SIG/SMG/ESR05/BV-13-C" "AVDTP/SRC/INT/SIG/SMG/ESR05/BV-13-C", "HFP/AG/SLC/BV-01-C", "HFP/AG/SLC/BV-02-C", "HFP/AG/SLC/BV-03-C", "HFP/AG/SLC/BV-04-C", "HFP/AG/SLC/BV-05-I", "HFP/AG/SLC/BV-06-I", "HFP/AG/SLC/BV-07-I" ], "ics": { "TSPC_4.0HCI_1a_2": true, Loading
android/pandora/server/proto/pandora/hfp.proto +12 −7 Original line number Diff line number Diff line Loading @@ -5,19 +5,24 @@ option java_outer_classname = "HfpProto"; package pandora; import "pandora/host.proto"; import "google/protobuf/wrappers.proto"; import "google/protobuf/empty.proto"; // Service to trigger HFP (Hands Free Profile) procedures. service HFP { // Enable Service level connection rpc EnableSlc(EnableSlcRequest) returns (google.protobuf.Empty); // Disable Service level connection rpc DisableSlc(DisableSlcRequest) returns (DisableSlcResponse); rpc DisableSlc(DisableSlcRequest) returns (google.protobuf.Empty); } // Request of the `EnableSlc` method. message EnableSlcRequest { // Connection crafted by grpc server Connection connection = 1; } // Request of the `DisableSlc` method. message DisableSlcRequest { // Local Bluetooth Device Address as array of 6 bytes. bytes address = 1; // Connection crafted by grpc server Connection connection = 1; } // Response of the `DisableSlc` method. message DisableSlcResponse {}
android/pandora/server/src/com/android/pandora/Hfp.kt +15 −7 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.bluetooth.BluetoothProfile import android.content.Context import android.content.Intent import android.content.IntentFilter import com.google.protobuf.Empty import io.grpc.stub.StreamObserver import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers Loading Loading @@ -56,16 +57,23 @@ class Hfp(val context: Context) : HFPImplBase() { scope.cancel() } override fun disableSlc( request: DisableSlcRequest, responseObserver: StreamObserver<DisableSlcResponse> ) { grpcUnary<DisableSlcResponse>(scope, responseObserver) { val device = request.address.toBluetoothDevice(bluetoothAdapter) override fun enableSlc(request: EnableSlcRequest, responseObserver: StreamObserver<Empty>) { grpcUnary<Empty>(scope, responseObserver) { val device = request.connection.toBluetoothDevice(bluetoothAdapter) bluetoothHfp.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED) Empty.getDefaultInstance() } } override fun disableSlc(request: DisableSlcRequest, responseObserver: StreamObserver<Empty>) { grpcUnary<Empty>(scope, responseObserver) { val device = request.connection.toBluetoothDevice(bluetoothAdapter) bluetoothHfp.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) DisableSlcResponse.getDefaultInstance() Empty.getDefaultInstance() } } }