-
Notifications
You must be signed in to change notification settings - Fork 241
feat: Added next gen profile for streaming feature #1434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
feat: Added next gen profile for streaming feature #1434
Conversation
Reviewer's GuideIntroduces next-gen streaming profile alongside legacy BLE transfer by refactoring write and scan states, extending the data manager and providers for streaming mode, updating UI to offer separate transfer buttons, unifying the BLE state machine, and expanding CI workflows for macOS, Windows, and Debian builds. Sequence diagram for streaming BLE transfer processsequenceDiagram
actor User
participant HomeScreen
participant AnimationBadgeProvider
participant BadgeMessageProvider
participant DataTransferManager
participant BLEStateMachine
participant BLEDevice
User->>HomeScreen: Clicks 'Stream' button
HomeScreen->>AnimationBadgeProvider: handleStreamingTransfer(...)
AnimationBadgeProvider->>BadgeMessageProvider: checkAndTransfer(..., useStreaming=true)
BadgeMessageProvider->>DataTransferManager: DataTransferManager.forStreaming(...)
BadgeMessageProvider->>BLEStateMachine: Start BLE state machine (ScanState)
BLEStateMachine->>BLEDevice: Scan for streaming service
BLEStateMachine->>BLEDevice: Connect
BLEStateMachine->>BLEDevice: Discover streaming service/characteristics
BLEStateMachine->>DataTransferManager: enterStreamingMode()
DataTransferManager->>BLEDevice: Write enter streaming command
BLEStateMachine->>User: Show transfer completion feedback
Class diagram for DataTransferManager and BLE state changesclassDiagram
class DataTransferManager {
+Data? data
+TransferMode mode
+BluetoothDevice? connectedDevice
+BluetoothCharacteristic? legacyWriteCharacteristic
+BluetoothCharacteristic? streamingWriteCharacteristic
+BluetoothCharacteristic? streamingNotifyCharacteristic
+StreamSubscription<List<int>>? notificationSubscription
+bool isStreamingActive
+generateDataChunk()
+clearConnectedDevice()
+handleStreamingErrorCode(int)
+streamBitmap(List<int>)
+enterStreamingMode()
+exitStreamingMode()
+convertBitmapToColumns(List<List<bool>>)
<<factory>> forLegacy(Data)
<<factory>> forStreaming(Data)
}
class TransferMode {
<<enum>>
legacy
streaming
}
DataTransferManager --> TransferMode
class ScanState {
+processState()
+_deviceSupportsRequiredMode(ScanResult, TransferMode)
+_getServicesForMode(TransferMode)
}
class WriteState {
+processState()
+_handleLegacyMode(List<BluetoothService>)
+_handleStreamingMode(List<BluetoothService>)
+_findStreamingService(List<BluetoothService>)
+_setupStreamingService(BluetoothService)
}
class CompletedState {
+bool isSuccess
+String message
+TransferMode? mode
+bool shouldDisconnect
+processState()
}
WriteState --> DataTransferManager
ScanState --> DataTransferManager
CompletedState --> TransferMode
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
c6f2e9f
to
4ffb1a9
Compare
Build StatusBuild successful. APKs to test: https://github.com/fossasia/badgemagic-app/actions/runs/17292146246/artifacts/3872000334. Screenshots |
0319cdb
to
b362f54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @samruddhi-Rahegaonkar, you have reached your weekly rate limit for Sourcery. Please try again later
@mariobehling @hpdang @Jhalakupadhyay according to the next gen profile of the firmware i have added the streaming function to the app for the live stream it should work correctly on the firmware which supports next gen profile. |
9c6f292
to
9a7b4b3
Compare
b42d16d
to
3f5d401
Compare
a7d13d1
to
dabc1ee
Compare
@nope3472 please review this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
Please make the following changes:
- This feature should only be visible for badges that support this feature. In the config section add the option "Enable/Disable Streaming Option"
- Pre-requisite for this feature is to add "config options" as outlined here #1205 (comment)
Testing:
This feature should be tested and demonstrated with an actual badge.
Okay! |
2e4ad7e
to
2e41803
Compare
@hpdang @mariobehling the failing screenshots are because of additional config screen in the navbar. Streaming Mode – Simple Flow :
|
21150f4
to
b391391
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test this with the hardware and document this in a video here.
Screenshots are failing. Please check and fix it. |
b4d3250
to
8a74318
Compare
Thank you, please document this feature with a video showcasing that it works with a badge. |
Fixes #1242
Changes
Screenshots / Recordings
Checklist:
constants.dart
without hard coding any value.Summary by Sourcery
Enable next-generation streaming profile alongside legacy transfer by introducing a new streaming mode throughout the BLE pipeline, updating the UI and data manager to support streaming, and expanding CI to build on macOS, Windows, and Debian.
New Features:
Enhancements:
CI: