Skip to content

new devices PowerBox "MBattery" and "A Series" - #250

Merged
vicocz merged 14 commits into
vicocz:defaultfrom
J0EK3R:merge/vicocz/PowerBox
Aug 4, 2026
Merged

new devices PowerBox "MBattery" and "A Series"#250
vicocz merged 14 commits into
vicocz:defaultfrom
J0EK3R:merge/vicocz/PowerBox

Conversation

@J0EK3R

@J0EK3R J0EK3R commented Jul 23, 2026

Copy link
Copy Markdown

This is my next device: MBattery from PowerBox.

It's another Chinese device - this one only with 1 channel with integrated motor.

grafik

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

@J0EK3R
J0EK3R marked this pull request as ready for review July 26, 2026 11:05
@J0EK3R

J0EK3R commented Jul 26, 2026

Copy link
Copy Markdown
Author

This is the "big brother" called "PowerBox A Series"
powerboxaseries_image_small

powerboxaseries_image

@J0EK3R J0EK3R changed the title new device PowerBox MBattery new devices PowerBox "MBattery" and "A Series" Jul 26, 2026
@J0EK3R

J0EK3R commented Jul 26, 2026

Copy link
Copy Markdown
Author

Sadly I can't Build the app for iOS at the moment.
Can you give me a TestFlight?

@vicocz
vicocz self-requested a review July 27, 2026 18:09
@vicocz

vicocz commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Sadly I can't Build the app for iOS at the moment. Can you give me a TestFlight?

It's little bit complicated. IOS build was part of intended legacy branding in release/legacy, but I made it obsolete as the reason for that was my try to publish the app to Apple. I gave up my tries here at the moment. Working on different plan to do so, including some branding.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread BrickController2/BrickController2/DeviceManagement/PowerBox/PowerBoxMBattery.cs Outdated
@J0EK3R

J0EK3R commented Jul 28, 2026

Copy link
Copy Markdown
Author

I can think about having some branch that might allow to create Test Flight build. It will take some time.

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...

@J0EK3R

J0EK3R commented Jul 28, 2026

Copy link
Copy Markdown
Author

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".

J0EK3R added 4 commits August 1, 2026 13:54
Added "PowerBox MBattery" and "PowerBox A Series" to the list of supported modules in the README.md file for improved documentation accuracy.
@J0EK3R
J0EK3R force-pushed the merge/vicocz/PowerBox branch from fdfa9da to c7d7e4a Compare August 1, 2026 11:55
J0EK3R added 2 commits August 1, 2026 13:57
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.
@vicocz

vicocz commented Aug 2, 2026

Copy link
Copy Markdown
Owner

I can think about having some branch that might allow to create Test Flight build. It will take some time.

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...

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.
Will think about some workaround, at least to let you somehow run your branch.

@vicocz

vicocz commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Is your PR buildable?

Error: D:\a\brickcontroller2\brickcontroller2\BrickController2\BrickController2\DeviceManagement\PowerBox\PowerBoxASeries.cs(33,15): error CS1002: ; expected [D:\a\brickcontroller2\brickcontroller2\BrickController2\BrickController2\BrickController2.csproj]

J0EK3R added 3 commits August 2, 2026 12:59
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.
@J0EK3R

J0EK3R commented Aug 2, 2026

Copy link
Copy Markdown
Author

Should build now. Sorry

@J0EK3R

J0EK3R commented Aug 2, 2026

Copy link
Copy Markdown
Author

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.
Will think about some workaround, at least to let you somehow run your branch.

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.

@vicocz

vicocz commented Aug 3, 2026

Copy link
Copy Markdown
Owner

I can think about having some branch that might allow to create Test Flight build. It will take some time.

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...

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.

J0EK3R added 5 commits August 4, 2026 05:30
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.

@vicocz vicocz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now

@vicocz vicocz added the enhancement New feature or request label Aug 4, 2026
@vicocz vicocz added this to the 2026.2 milestone Aug 4, 2026
@vicocz
vicocz merged commit 99d3ca8 into vicocz:default Aug 4, 2026
4 checks passed
@J0EK3R

J0EK3R commented Aug 4, 2026

Copy link
Copy Markdown
Author

Thank you :)

@J0EK3R
J0EK3R deleted the merge/vicocz/PowerBox branch August 4, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants