-
Notifications
You must be signed in to change notification settings - Fork 0
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
Yann/feature/lekaupdater/update process v150 #1191
Yann/feature/lekaupdater/update process v150 #1191
Conversation
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.
LGTM 👍
juste une question sur la taille et l'ajout de la raison du - 3
dans le commentaire
Apps/LekaUpdater/Sources/Libs/UpdateProcess/Version/UpdateProcessV150.swift
Outdated
Show resolved
Hide resolved
5e8cb43
to
78be033
Compare
10dbacb
to
1668a82
Compare
3916845
to
b7b3ae6
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.
LGTM 👍
le code et la logique me va, c'est très cool.
juste une request sur le déplacement de la notion de mtu directement dans RobotKit pour ne pas avoir à dupliquer le code pour obtenir la même valeur dans Leka App par exemple
Robot.shared.connectedPeripheral?.peripheral.readValue(forCharacteristic: BLESpecs.Monitoring.Characteristics.negotiatedMTU, inService: BLESpecs.Monitoring.service) | ||
.receive(on: DispatchQueue.main) | ||
.sink( | ||
receiveCompletion: { _ in | ||
// nothing to do | ||
}, | ||
receiveValue: { data in | ||
if let data { | ||
self.maximumPacketSize = Int(data.map { UInt16($0) }.reduce(0) { $0 << 8 + $1 }) - self.l2capOverhead | ||
self.sendFile() | ||
} | ||
} | ||
) | ||
.store(in: &self.cancellables) |
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.
la logique me va, en revanche l'information du MTU est intéressante à plein d'égard pour d'autres endroits de nos applications, par exemple pour générer les commandes.
il faut donc plutôt remonter l'information du côté de RobotKit en ajoutant cela dans Robot.swift
public var negotiatedMTU: CurrentValueSubject<Int, Never> = CurrentValueSubject(0)
et une fonction de register type
func registerNegotiatedMTUNotificationCallback() {
// ...
}
Apps/LekaUpdater/Sources/Libs/UpdateProcess/Version/UpdateProcessV150.swift
Show resolved
Hide resolved
b297865
to
d782cbd
Compare
Copied from UpdateProcessV130
182 is the max value possible on iOS device, indeed 185 is the max MTU and the header is always 3 bytes long, so each packet has a limit of 182 bytes
d782cbd
to
7d7b7e0
Compare
|
No description provided.