-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ef21bb
commit 159c840
Showing
12 changed files
with
304 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using GalaxyBudsClient.Message; | ||
using GalaxyBudsClient.Message.Decoder; | ||
using GalaxyBudsClient.Model.Constants; | ||
|
||
namespace GalaxyBudsClient.Tests.Buds; | ||
|
||
[TestFixture, Description("Test ExtendedStatusUpdate parser for the 1st-gen Buds"), TestOf(typeof(ExtendedStatusUpdateDecoder))] | ||
public class ExtendedStatusUpdateTests : MessageTests<ExtendedStatusUpdateDecoder> | ||
{ | ||
protected override string TestDataGroup => "ExtendedStatusUpdate"; | ||
|
||
[Test, TestCaseSource(nameof(_testCases)), Description("Decode ExtendedStatusUpdate messages")] | ||
public void Decode(TestCase testCase) => DecodeAndVerify(testCase); | ||
|
||
private static object[] _testCases = | ||
[ | ||
new TestCase { Revision = 3, Model = Models.Buds, ExpectedResult = new ExtendedStatusUpdateDecoder | ||
{ | ||
TargetModel = Models.Buds, | ||
|
||
Revision = 3, | ||
EarType = 0, | ||
BatteryL = 70, | ||
BatteryR = 95, | ||
IsCoupled = true, | ||
MainConnection = DevicesInverted.R, | ||
WearState = LegacyWearStates.None, | ||
PlacementL = PlacementStates.Idle, | ||
PlacementR = PlacementStates.Idle, | ||
EqualizerMode = 7, | ||
TouchpadLock = false, | ||
TouchpadOptionL = TouchOptions.Volume, | ||
TouchpadOptionR = TouchOptions.Volume, | ||
SeamlessConnectionEnabled = false, | ||
AmbientSoundEnabled = false, | ||
AmbientSoundVolume = 2, | ||
AmbientSoundMode = AmbientTypes.Default, | ||
EqualizerEnabled = true | ||
}} | ||
]; | ||
} |
59 changes: 4 additions & 55 deletions
59
...Client.Tests/ExtendedStatusUpdateTests.cs → ...sts/Buds2Pro/ExtendedStatusUpdateTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
GalaxyBudsClient.Tests/BudsFe/ExtendedStatusUpdateTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
using GalaxyBudsClient.Message; | ||
using GalaxyBudsClient.Message.Decoder; | ||
using GalaxyBudsClient.Model.Constants; | ||
|
||
namespace GalaxyBudsClient.Tests.BudsFe; | ||
|
||
[TestFixture, Description("Test ExtendedStatusUpdate parser for the Buds FE"), TestOf(typeof(ExtendedStatusUpdateDecoder))] | ||
public class ExtendedStatusUpdateTests : MessageTests<ExtendedStatusUpdateDecoder> | ||
{ | ||
protected override string TestDataGroup => "ExtendedStatusUpdate"; | ||
|
||
[Test, TestCaseSource(nameof(_testCases)), Description("Decode ExtendedStatusUpdate messages")] | ||
public void Decode(TestCase testCase) => DecodeAndVerify(testCase); | ||
|
||
private static object[] _testCases = | ||
[ | ||
new TestCase { Revision = 2, Model = Models.BudsFe, ExpectedResult = new ExtendedStatusUpdateDecoder | ||
{ | ||
TargetModel = Models.BudsFe, | ||
|
||
Revision = 2, | ||
EarType = 6, | ||
BatteryL = 58, | ||
BatteryR = 89, | ||
IsCoupled = true, | ||
MainConnection = DevicesInverted.R, | ||
WearState = LegacyWearStates.Both, | ||
EqualizerMode = 0, | ||
TouchpadLock = false, | ||
TouchpadOptionL = TouchOptions.Volume, | ||
TouchpadOptionR = TouchOptions.Volume, | ||
SeamlessConnectionEnabled = true, | ||
AmbientSoundVolume = 1, | ||
PlacementL = PlacementStates.Wearing, | ||
PlacementR = PlacementStates.Wearing, | ||
BatteryCase = 0, | ||
OutsideDoubleTap = false, | ||
ColorL = DeviceIds.BudsFeGraphite, | ||
ColorR = DeviceIds.BudsFeGraphite, | ||
AdjustSoundSync = false, | ||
SideToneEnabled = false, | ||
ExtraHighAmbientEnabled = false, | ||
VoiceWakeUp = false, | ||
VoiceWakeUpLang = 3, | ||
FmmRevision = 4, | ||
NoiseControlMode = NoiseControlModes.Off, | ||
NoiseControlTouchOff = true, | ||
NoiseControlTouchAnc = true, | ||
NoiseControlTouchAmbient = false, | ||
NoiseControlTouchLeftOff = false, | ||
NoiseControlTouchLeftAnc = true, | ||
NoiseControlTouchLeftAmbient = true, | ||
SpeakSeamlessly = false, | ||
NoiseReductionLevel = 0, | ||
AutoSwitchAudioOutput = false, | ||
DetectConversations = false, | ||
DetectConversationsDuration = 0, | ||
SpatialAudio = false, | ||
HearingEnhancements = 16, | ||
SingleTapOn = true, | ||
DoubleTapOn = true, | ||
TripleTapOn = true, | ||
TouchHoldOn = true, | ||
DoubleTapForCallOn = false, | ||
TouchHoldOnForCallOn = false, | ||
TouchType = 0, | ||
NoiseControlsWithOneEarbud = true, | ||
AmbientCustomVolumeOn = true, | ||
AmbientCustomVolumeLeft = 1, | ||
AmbientCustomVolumeRight = 1, | ||
AmbientCustomSoundTone = 3, | ||
CallPathControl = true, | ||
IsLeftCharging = false, | ||
IsRightCharging = false, | ||
IsCaseCharging = false, | ||
HearingTestValue = 157, | ||
BixbyKeyword = 0, | ||
NeckStretchCalibration = false, | ||
CustomizeNoiseReductionLevel = 3, // unused value; doesn't seem right | ||
CustomizeConversationBoost = true, // unused | ||
ExtraClearCallSound = false, | ||
SpatialAudioHeadTracking = true, | ||
AutoAdjustSound = true | ||
}} | ||
]; | ||
} |
50 changes: 50 additions & 0 deletions
50
GalaxyBudsClient.Tests/BudsLive/ExtendedStatusUpdateTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using GalaxyBudsClient.Message.Decoder; | ||
using GalaxyBudsClient.Model.Constants; | ||
|
||
namespace GalaxyBudsClient.Tests.BudsLive; | ||
|
||
[TestFixture, Description("Test ExtendedStatusUpdate parser for the Buds Live"), TestOf(typeof(ExtendedStatusUpdateDecoder))] | ||
public class ExtendedStatusUpdateTests : MessageTests<ExtendedStatusUpdateDecoder> | ||
{ | ||
protected override string TestDataGroup => "ExtendedStatusUpdate"; | ||
|
||
[Test, TestCaseSource(nameof(_testCases)), Description("Decode ExtendedStatusUpdate messages")] | ||
public void Decode(TestCase testCase) => DecodeAndVerify(testCase); | ||
|
||
private static object[] _testCases = | ||
[ | ||
new TestCase { Revision = 9, Model = Models.BudsLive, ExpectedResult = new ExtendedStatusUpdateDecoder | ||
{ | ||
TargetModel = Models.BudsLive, | ||
|
||
Revision = 9, | ||
EarType = 1, | ||
BatteryL = 15, | ||
BatteryR = 97, | ||
IsCoupled = true, | ||
MainConnection = DevicesInverted.R, | ||
WearState = LegacyWearStates.Both, | ||
EqualizerMode = 0, | ||
TouchpadLock = false, | ||
TouchpadOptionL = TouchOptions.Anc, | ||
TouchpadOptionR = TouchOptions.Anc, | ||
SeamlessConnectionEnabled = true, | ||
AmbientSoundVolume = 0, | ||
PlacementL = PlacementStates.Wearing, | ||
PlacementR = PlacementStates.Wearing, | ||
BatteryCase = 100, | ||
OutsideDoubleTap = false, | ||
ColorL = DeviceIds.BudsLiveWhite, | ||
ColorR = DeviceIds.BudsLiveWhite, | ||
AdjustSoundSync = false, | ||
SideToneEnabled = false, | ||
ExtraHighAmbientEnabled = false, | ||
VoiceWakeUp = false, | ||
VoiceWakeUpLang = 0, | ||
FmmRevision = 3, | ||
NoiseCancelling = true, | ||
HearingEnhancements = 0x10, | ||
CallPathControl = true | ||
}} | ||
]; | ||
} |
46 changes: 46 additions & 0 deletions
46
GalaxyBudsClient.Tests/BudsPlus/ExtendedStatusUpdateTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using GalaxyBudsClient.Message.Decoder; | ||
using GalaxyBudsClient.Model.Constants; | ||
|
||
namespace GalaxyBudsClient.Tests.BudsPlus; | ||
|
||
[TestFixture, Description("Test ExtendedStatusUpdate parser for the Buds+"), TestOf(typeof(ExtendedStatusUpdateDecoder))] | ||
public class ExtendedStatusUpdateTests : MessageTests<ExtendedStatusUpdateDecoder> | ||
{ | ||
protected override string TestDataGroup => "ExtendedStatusUpdate"; | ||
|
||
[Test, TestCaseSource(nameof(_testCases)), Description("Decode ExtendedStatusUpdate messages")] | ||
public void Decode(TestCase testCase) => DecodeAndVerify(testCase); | ||
|
||
private static object[] _testCases = | ||
[ | ||
new TestCase { Revision = 13, Model = Models.BudsPlus, ExpectedResult = new ExtendedStatusUpdateDecoder | ||
{ | ||
TargetModel = Models.BudsPlus, | ||
|
||
Revision = 13, | ||
EarType = 0, | ||
BatteryL = 87, | ||
BatteryR = 84, | ||
IsCoupled = true, | ||
MainConnection = DevicesInverted.R, | ||
WearState = LegacyWearStates.Both, | ||
EqualizerMode = 3, | ||
TouchpadLock = false, | ||
TouchpadOptionL = TouchOptions.AmbientSound, | ||
TouchpadOptionR = TouchOptions.AmbientSound, | ||
SeamlessConnectionEnabled = true, | ||
AmbientSoundVolume = 0, | ||
PlacementL = PlacementStates.Wearing, | ||
PlacementR = PlacementStates.Wearing, | ||
BatteryCase = 101, | ||
OutsideDoubleTap = true, | ||
ColorL = DeviceIds.BudsPlusBlack, | ||
ColorR = DeviceIds.BudsPlusBlack, | ||
AdjustSoundSync = false, | ||
SideToneEnabled = false, | ||
ExtraHighAmbientEnabled = false, | ||
FmmRevision = 3, | ||
CallPathControl = true | ||
}} | ||
]; | ||
} |
67 changes: 67 additions & 0 deletions
67
GalaxyBudsClient.Tests/BudsPro/ExtendedStatusUpdateTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using GalaxyBudsClient.Message.Decoder; | ||
using GalaxyBudsClient.Model.Constants; | ||
|
||
namespace GalaxyBudsClient.Tests.BudsPro; | ||
|
||
[TestFixture, Description("Test ExtendedStatusUpdate parser for the Buds Pro"), TestOf(typeof(ExtendedStatusUpdateDecoder))] | ||
public class ExtendedStatusUpdateTests : MessageTests<ExtendedStatusUpdateDecoder> | ||
{ | ||
protected override string TestDataGroup => "ExtendedStatusUpdate"; | ||
|
||
[Test, TestCaseSource(nameof(_testCases)), Description("Decode ExtendedStatusUpdate messages")] | ||
public void Decode(TestCase testCase) => DecodeAndVerify(testCase); | ||
|
||
private static object[] _testCases = | ||
[ | ||
new TestCase { Revision = 10, Model = Models.BudsPro, ExpectedResult = new ExtendedStatusUpdateDecoder | ||
{ | ||
TargetModel = Models.BudsPro, | ||
|
||
Revision = 10, | ||
EarType = 2, | ||
BatteryL = 89, | ||
BatteryR = 94, | ||
IsCoupled = true, | ||
MainConnection = DevicesInverted.L, | ||
WearState = LegacyWearStates.L, | ||
EqualizerMode = 1, | ||
TouchpadLock = false, | ||
TouchpadOptionL = TouchOptions.NoiseControl, | ||
TouchpadOptionR = TouchOptions.NoiseControl, | ||
SeamlessConnectionEnabled = true, | ||
AmbientSoundVolume = 2, | ||
PlacementL = PlacementStates.Wearing, | ||
PlacementR = PlacementStates.Case, | ||
BatteryCase = 100, | ||
OutsideDoubleTap = true, | ||
ColorL = DeviceIds.BudsProBlack, | ||
ColorR = DeviceIds.BudsProBlack, | ||
AdjustSoundSync = false, | ||
SideToneEnabled = false, | ||
ExtraHighAmbientEnabled = false, | ||
VoiceWakeUp = false, | ||
VoiceWakeUpLang = 1, | ||
FmmRevision = 3, | ||
NoiseControlMode = NoiseControlModes.Off, | ||
NoiseControlTouchOff = true, | ||
NoiseControlTouchAnc = true, | ||
NoiseControlTouchAmbient = false, | ||
NoiseControlTouchLeftOff = true, | ||
NoiseControlTouchLeftAnc = true, | ||
NoiseControlTouchLeftAmbient = false, | ||
SpeakSeamlessly = false, | ||
NoiseReductionLevel = 1, | ||
AutoSwitchAudioOutput = false, | ||
DetectConversations = false, | ||
DetectConversationsDuration = 2, | ||
SpatialAudio = false, | ||
HearingEnhancements = 16, | ||
NoiseControlsWithOneEarbud = false, | ||
AmbientCustomVolumeOn = false, | ||
AmbientCustomVolumeLeft = 2, | ||
AmbientCustomVolumeRight = 2, | ||
AmbientCustomSoundTone = 2, | ||
CallPathControl = true | ||
}} | ||
]; | ||
} |
Binary file added
BIN
+53 Bytes
GalaxyBudsClient.Tests/TestData/ExtendedStatusUpdate/BudsFe_rev2.bin
Binary file not shown.
Binary file added
BIN
+32 Bytes
GalaxyBudsClient.Tests/TestData/ExtendedStatusUpdate/BudsLive_rev9.bin
Binary file not shown.
Binary file added
BIN
+31 Bytes
GalaxyBudsClient.Tests/TestData/ExtendedStatusUpdate/BudsPlus_rev13.bin
Binary file not shown.
Binary file not shown.
Oops, something went wrong.