안녕하세요.
MAUI에서 Bluetooth 기능을 구현하는 것이 목표입니다.
Targetframeworks로는 net6.0-ios, net6.0-android, net6.0-windows, net6.0-macos입니다.
우선 C# library 프로젝트를 생성하고 (Nuget 패키지) Plugin.BLE
를 활용하여 Bluetooth 기능을 구현합니다. 이 것을 다시 Nuget 패키지로 만들어서 MAUI에서 사용하는 방향으로 진행하고 있습니다. 그리고 여기에 테스트 코드를 작성하고 XUnit으로 코드 검증을하고 있습니다. 테스트 코드를 작성하려는데 많은 에러가 발생하네요. Nuget 패키지와 테스트 코드 등 관련된 지식이 없어서 어떻게 해야될지 감이 잘 안잡힙니다.
테스트 코드에서 Bluetooth 기능이 구현된 클래스를 인스턴스 할 때 오류가 뜹니다.
=> Error : System.NotImplementedException : This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation`
[Bluetooth 기능 구현 .cs]
public class BluetoothLowEnergyManager : IDisposable
{
private readonly IBluetoothLE BluetoothLowEnergy
public BluetoothLowEnergyManager()
{
BluetoothLowEnergy = CrossBluetoothLE.Current; // 테스트 코드 디버깅 시 에러 발생
}
}
[Test Code]
[Fact]
public void InstanceBluetoothLowEnergyManager
{
BluetoothLowEnergyManager bluetoothLowEnergyManager = new();
}
(또 다른오류)
Bluetooth 기능을 구현하기 위해 어떤 학습을 진행하면 될까요?
많은 오류가 나서 해당 프로젝트를 진행하기엔 많이 부족하다고 느껴집니다. 지금 당장 문제를 해결하기 보다는 무엇을 학습해야 프로젝트를 끝 마칠 수 있을까 생각이 듭니다.