diff --git a/BrickController2/BrickController2/DeviceManagement/MouldKing/IMouldKingDeviceManager.cs b/BrickController2/BrickController2/DeviceManagement/MouldKing/IMouldKingDeviceManager.cs
new file mode 100644
index 00000000..d0ac2c48
--- /dev/null
+++ b/BrickController2/BrickController2/DeviceManagement/MouldKing/IMouldKingDeviceManager.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace BrickController2.DeviceManagement.MouldKing;
+
+///
+/// Interface for MouldKingDeviceManager.
+///
+public interface IMouldKingDeviceManager
+{
+ ReadOnlyMemory GetAppId();
+}
diff --git a/BrickController2/BrickController2/DeviceManagement/MouldKing/MK3_8.cs b/BrickController2/BrickController2/DeviceManagement/MouldKing/MK3_8.cs
index 870c7fc7..cdd5dc72 100644
--- a/BrickController2/BrickController2/DeviceManagement/MouldKing/MK3_8.cs
+++ b/BrickController2/BrickController2/DeviceManagement/MouldKing/MK3_8.cs
@@ -33,7 +33,7 @@ internal class MK3_8 : MKBaseNibble, IDeviceType
///
protected override ushort ManufacturerId => MKProtocol.ManufacturerID;
- public MK3_8(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, MouldKingDeviceManager mkDeviceManager)
+ public MK3_8(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, IMouldKingDeviceManager mkDeviceManager)
: base(name, address, deviceData, deviceRepository, bleService, mkPlatformService, mkDeviceManager, 0, Telegram_Connect, Telegram_Base)
{
}
diff --git a/BrickController2/BrickController2/DeviceManagement/MouldKing/MK4.cs b/BrickController2/BrickController2/DeviceManagement/MouldKing/MK4.cs
index 5bedcb7b..fd062dbd 100644
--- a/BrickController2/BrickController2/DeviceManagement/MouldKing/MK4.cs
+++ b/BrickController2/BrickController2/DeviceManagement/MouldKing/MK4.cs
@@ -38,7 +38,7 @@ internal class MK4 : MKBaseNibble, IDeviceType
///
private static BluetoothAdvertisingDeviceHandler? bluetoothAdvertisingDeviceHandler;
- public MK4(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, MouldKingDeviceManager mkDeviceManager)
+ public MK4(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, IMouldKingDeviceManager mkDeviceManager)
: base(name, address, deviceData, deviceRepository, bleService, mkPlatformService, mkDeviceManager, GetInstanceNo(address), Telegram_Connect, Telegram_Base)
{
}
diff --git a/BrickController2/BrickController2/DeviceManagement/MouldKing/MK5.cs b/BrickController2/BrickController2/DeviceManagement/MouldKing/MK5.cs
index 09e78b0c..e2aaf860 100644
--- a/BrickController2/BrickController2/DeviceManagement/MouldKing/MK5.cs
+++ b/BrickController2/BrickController2/DeviceManagement/MouldKing/MK5.cs
@@ -39,7 +39,7 @@ internal class MK5 : MKBaseNibble, IDeviceType
///
private byte _turret_lock_Nibble = TURRET_UNLOCKED_NIBBLE;
- public MK5(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, MouldKingDeviceManager mkDeviceManager)
+ public MK5(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, IMouldKingDeviceManager mkDeviceManager)
: base(name, address, deviceData, deviceRepository, bleService, mkPlatformService, mkDeviceManager, 0, Telegram_Connect, Telegram_Base)
{
}
diff --git a/BrickController2/BrickController2/DeviceManagement/MouldKing/MK6.cs b/BrickController2/BrickController2/DeviceManagement/MouldKing/MK6.cs
index b162c7e0..b3eb8e31 100644
--- a/BrickController2/BrickController2/DeviceManagement/MouldKing/MK6.cs
+++ b/BrickController2/BrickController2/DeviceManagement/MouldKing/MK6.cs
@@ -53,7 +53,7 @@ internal class MK6 : MKBaseByte, IDeviceType
///
protected override int BaseTelegram_ChannelStartOffset => 3;
- public MK6(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, MouldKingDeviceManager mkDeviceManager)
+ public MK6(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, IMouldKingDeviceManager mkDeviceManager)
: base(name, address, deviceData, deviceRepository, bleService, mkPlatformService, mkDeviceManager, 3, MK6.Telegram_Connect, MK6.GetTelegramBase(address))
{
}
diff --git a/BrickController2/BrickController2/DeviceManagement/MouldKing/MKBaseByte.cs b/BrickController2/BrickController2/DeviceManagement/MouldKing/MKBaseByte.cs
index da20feab..ea9c470e 100644
--- a/BrickController2/BrickController2/DeviceManagement/MouldKing/MKBaseByte.cs
+++ b/BrickController2/BrickController2/DeviceManagement/MouldKing/MKBaseByte.cs
@@ -30,7 +30,7 @@ internal abstract class MKBaseByte : BluetoothAdvertisingDevice
protected readonly int _channelStartOffset;
- protected MKBaseByte(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, MouldKingDeviceManager mkDeviceManager,int channelStartOffset, byte[] telegram_Connect, byte[] telegram_Base)
+ protected MKBaseByte(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, IMouldKingDeviceManager mkDeviceManager,int channelStartOffset, byte[] telegram_Connect, byte[] telegram_Base)
: base(name, address, deviceData, deviceRepository, bleService)
{
_channelStartOffset = channelStartOffset;
diff --git a/BrickController2/BrickController2/DeviceManagement/MouldKing/MKBaseNibble.cs b/BrickController2/BrickController2/DeviceManagement/MouldKing/MKBaseNibble.cs
index b90723bb..ed3f91f3 100644
--- a/BrickController2/BrickController2/DeviceManagement/MouldKing/MKBaseNibble.cs
+++ b/BrickController2/BrickController2/DeviceManagement/MouldKing/MKBaseNibble.cs
@@ -44,7 +44,7 @@ internal abstract class MKBaseNibble : BluetoothAdvertisingDevice
///
protected readonly int _instanceNo;
- protected MKBaseNibble(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, MouldKingDeviceManager mkDeviceManager, int instanceNo, byte[] telegram_Connect, byte[] telegram_Base)
+ protected MKBaseNibble(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IBluetoothLEService bleService, IMKPlatformService mkPlatformService, IMouldKingDeviceManager mkDeviceManager, int instanceNo, byte[] telegram_Connect, byte[] telegram_Base)
: base(name, address, deviceData, deviceRepository, bleService)
{
_telegram_Connect = telegram_Connect;
diff --git a/BrickController2/BrickController2/DeviceManagement/MouldKing/MouldKing.cs b/BrickController2/BrickController2/DeviceManagement/MouldKing/MouldKing.cs
index e5c78f34..6fca8aea 100644
--- a/BrickController2/BrickController2/DeviceManagement/MouldKing/MouldKing.cs
+++ b/BrickController2/BrickController2/DeviceManagement/MouldKing/MouldKing.cs
@@ -35,6 +35,7 @@ protected override void Register(VendorBuilder builder)
// device manager
builder.RegisterDeviceManager()
+ .As()
.SingleInstance();
}
}
diff --git a/BrickController2/BrickController2/DeviceManagement/MouldKing/MouldKingDeviceManager.cs b/BrickController2/BrickController2/DeviceManagement/MouldKing/MouldKingDeviceManager.cs
index 6ee506a6..73e56323 100644
--- a/BrickController2/BrickController2/DeviceManagement/MouldKing/MouldKingDeviceManager.cs
+++ b/BrickController2/BrickController2/DeviceManagement/MouldKing/MouldKingDeviceManager.cs
@@ -7,7 +7,8 @@ namespace BrickController2.DeviceManagement.MouldKing;
///
/// Manager for MouldKing devices
///
-public class MouldKingDeviceManager : BluetoothDeviceManagerBase
+public class MouldKingDeviceManager : BluetoothDeviceManagerBase,
+ IMouldKingDeviceManager
{
private const int AppIdentifierLength = 2; // MouldKing protocol defines 2 bytes for the app identifier