new devices PowerBox "MBattery" and "A Series" - #250
Conversation
|
Sadly I can't Build the app for iOS at the moment. |
It's little bit complicated. IOS build was part of intended legacy branding in I can think about having some branch that might allow to create Test Flight build. It will take some time. In general Test Flight is not problem, but there is the branch which is circa 20 commits behind the default branch. |
There was a problem hiding this comment.
Pull request overview
Adds support for new PowerBox Bluetooth-advertising devices (MBattery and A Series) by introducing a PowerBox vendor, device implementations, protocol constants, platform-specific RF payload generation, and UI channel selection updates.
Changes:
- Added PowerBox vendor + device implementations for MBattery (1 channel) and A Series (4 channels), including shared base classes.
- Registered PowerBox platform services for Android/iOS/WinUI and added protocol constants used by CryptTools payload generation.
- Updated UI to display PowerBox channel selectors and added DI tests validating vendor registration.
Reviewed changes
Copilot reviewed 20 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Lists the new PowerBox devices as supported. |
| BrickController2/BrickController2/UI/Controls/DeviceChannelSelector.xaml.cs | Wires up channel-selection commands and section visibility for PowerBox devices. |
| BrickController2/BrickController2/UI/Controls/DeviceChannelSelector.xaml | Adds PowerBox-specific channel selector UI sections and images. |
| BrickController2/BrickController2/UI/Controls/DeviceChannelLabel.cs | Adds channel letter mapping for PowerBox devices. |
| BrickController2/BrickController2/Protocols/PowerBoxProtocol.cs | Introduces PowerBox protocol constants for RF payload generation. |
| BrickController2/BrickController2/DeviceManagement/PowerBox/PowerBoxMBattery.cs | Implements MBattery device behavior and output encoding. |
| BrickController2/BrickController2/DeviceManagement/PowerBox/PowerBoxASeries.cs | Implements A Series device behavior and output encoding. |
| BrickController2/BrickController2/DeviceManagement/PowerBox/PowerBox.cs | Registers the PowerBox vendor, device manager, and devices in DI. |
| BrickController2/BrickController2/DeviceManagement/PowerBox/PowerBoxDeviceManager.cs | Provides app-identifier bytes used in telegram encoding. |
| BrickController2/BrickController2/DeviceManagement/PowerBox/PowerBoxBaseNibble.cs | Base class for nibble-per-channel PowerBox devices. |
| BrickController2/BrickController2/DeviceManagement/PowerBox/PowerBoxBaseByte.cs | Base class for byte-per-channel PowerBox devices. |
| BrickController2/BrickController2/DeviceManagement/PowerBox/IPowerBoxPlatformService.cs | Defines the platform service API for generating RF payloads. |
| BrickController2/BrickController2/DeviceManagement/DeviceType.cs | Adds new DeviceType enum values for PowerBox devices. |
| BrickController2/BrickController2.WinUI/PlatformServices/DI/PlatformServicesModule.cs | Registers the WinUI PowerBox platform service. |
| BrickController2/BrickController2.WinUI/PlatformServices/DeviceManagement/PowerBox/PowerBoxPlatformService.cs | Implements WinUI RF payload generation for PowerBox. |
| BrickController2/BrickController2.iOS/PlatformServices/DI/PlatformServicesModule.cs | Registers the iOS PowerBox platform service. |
| BrickController2/BrickController2.iOS/PlatformServices/DeviceManagement/PowerBox/PowerBoxPlatformService.cs | Implements iOS RF payload generation for PowerBox. |
| BrickController2/BrickController2.Android/PlatformServices/DI/PlatformServicesModule.cs | Registers the Android PowerBox platform service. |
| BrickController2/BrickController2.Android/PlatformServices/DeviceManagement/PowerBox/PowerBoxPlatformService.cs | Implements Android RF payload generation for PowerBox. |
| BrickController2/BrickController2.Tests/DeviceManagement/DI/PowerBoxVendorTests.cs | Adds DI tests ensuring PowerBox devices resolve via DeviceFactory. |
Comments suppressed due to low confidence (1)
BrickController2/BrickController2/DeviceManagement/PowerBox/PowerBoxBaseByte.cs:110
- The XML doc comment for setValue_byte is malformed (missing the closing tag), which can trigger CS1570 warnings.
/// update.</remarks>
/// <param name="byteOffset">The zero-based index of the byte in the telegram buffer to modify.</param>
/// <param name="setValue_byte">The value to set.param>
/// <returns><see langword="true"/> if the byte in the telegram buffer was modified; otherwise, <see langword="false"/> if
/// the value remained unchanged.</returns>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
I think there is another way: sideloadly for Win If you could manage to get your GH Action "Build BC2 iOS" working with your provisioning profile and your code-signing certificate I could try to download the resulting IPA artifact und push it to my iPad using sideloadly... Beside that I'm trying to get my Build running... |
|
BTW: trying to get my GH Action working I had steps inside the GH Action script to replace the BundleIdentifier and AppIdentifier to be able to sign the Artifact and be able to build the repo's "standard code". |
Added "PowerBox MBattery" and "PowerBox A Series" to the list of supported modules in the README.md file for improved documentation accuracy.
fdfa9da to
c7d7e4a
Compare
Refactored PowerBoxBaseByte and PowerBoxBaseNibble by moving repeated channel reset logic into a new private method, ResetAllChannelsToZero. Updated InitDevice and DisconnectDevice to use this method, reducing duplication and improving maintainability.
I guess it's not easy as it looks. Your PR does not have IMHO access to repository secrets and therefore IOS workflow fails to build it. |
|
Is your PR buildable? |
Updated logic to compare both bytes at byteOffset and byteOffset + 1 in the _telegram_Base array. The method now returns true if either byte changes, ensuring accurate detection of modifications to duplicated bytes.
Updated <param name="channelNo"> to specify valid values 0..3. Clarified <exception cref="ArgumentException"> to cover any invalid channel number, not just when not 0.
|
Should build now. Sorry |
My issue is that I don’t have a paid Apple Developer Account. Right now, I can only build and sign my app on a local Mac. My plan is to install that locally‑built IPA on my iPad so that it runs with a valid provisioning profile. The next step would be to export the local signing certificate and provisioning profile, store them as GitHub Secrets, and then let GitHub Actions perform the build. The result would be an IPA artifact that I can sideload onto my iPad. But first I have to get the build running on my local Mac-VM. |
Do you still want to havit it built for IOS? This branch? Currently, branch builds are verification ones only, no signing. It§s due to the fact signing secrets are not available outside this repo. It's not easy, I can do that manually, e.g. via Test Flight as well, but it requires me to clone your commits I guess. |
Corrected the <param name="setValue_byte"> tag typo and enhanced the <returns> tag formatting for clarity and consistency in documentation comments.
Updated device registration to use "powerboxmbattery_image.png" via .WithImage method. Removed obsolete "powerboxmbattery_image_small.png" from the project.
Simplify PowerBoxAseriesDatagramTests and PowerBoxMBatteryDatagramTests by replacing byte-by-byte payload comparisons with payload.Should().Equal(expectedPayload) assertions for improved readability and maintainability.
Refactored PowerBoxDeviceManagerTests to use a mock of IAppIdentifierService instead of IPreferencesService. Updated the constructor and tests to use AppIdentifier1 and AppIdentifier2 constants, decoupling tests from preferences storage and focusing on integration with IAppIdentifierService.
|
Thank you :) |


This is my next device: MBattery from PowerBox.
It's another Chinese device - this one only with 1 channel with integrated motor.
There is a big brother with 4 channels comparable to the MK4.0 (comming soon).
I've tested the device on Android and Windows - my iOS Build isn't working at the moment