-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated proto file: - Created new 'ProtoImage' model with hash, data, slot and image fields - Added 'hash' to single image update arguments. Updated Swift code: - added extension for ImageManager.Image struct to create it with Proto model - fixed code after upgrade to v1.6 Flutter and Android pard are still broken
- Loading branch information
1 parent
3db45b3
commit 07f64c6
Showing
10 changed files
with
234 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// Image+Proto.swift | ||
// mcumgr_flutter | ||
// | ||
// Created by Nick Kibysh on 18/03/2024. | ||
// | ||
|
||
import Foundation | ||
import iOSMcuManagerLibrary | ||
|
||
extension ImageManager.Image { | ||
init(proto: ProtoImage) { | ||
let image = Int(proto.image) | ||
let slot = Int(proto.slot) | ||
let hash = proto.hash | ||
let data = proto.data | ||
|
||
if proto.hasSlot { | ||
self.init(image: image, slot: slot, hash: hash, data: data) | ||
} else { | ||
self.init(image: image, hash: hash, data: data) | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'dart:typed_data'; | ||
|
||
class Image { | ||
int image; | ||
int slot; | ||
Uint8List hash; | ||
Uint8List data; | ||
|
||
Image({ | ||
required this.image, | ||
required this.slot, | ||
required this.hash, | ||
required this.data, | ||
}); | ||
} |
Oops, something went wrong.