Skip to content
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

Merged
merged 4 commits into from
Jun 18, 2024

Conversation

YannLocatelli
Copy link
Member

No description provided.

@YannLocatelli YannLocatelli requested a review from ladislas May 13, 2024 13:02
@YannLocatelli YannLocatelli self-assigned this May 13, 2024
Copy link
Member

@ladislas ladislas left a 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

@YannLocatelli YannLocatelli force-pushed the yann/feature/lekaupdater/update-process-v150 branch from 5e8cb43 to 78be033 Compare May 13, 2024 14:04
@YannLocatelli YannLocatelli force-pushed the yann/feature/lekaupdater/update-process-v150 branch 3 times, most recently from 10dbacb to 1668a82 Compare May 28, 2024 08:30
@YannLocatelli YannLocatelli requested a review from ladislas May 28, 2024 08:37
@YannLocatelli YannLocatelli force-pushed the yann/feature/lekaupdater/update-process-v150 branch 2 times, most recently from 3916845 to b7b3ae6 Compare May 29, 2024 14:43
@YannLocatelli
Copy link
Member Author

YannLocatelli commented Jun 5, 2024

Copy link
Member

@ladislas ladislas left a 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

Comment on lines 242 to 255
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)
Copy link
Member

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() {
	// ...
}

@YannLocatelli YannLocatelli force-pushed the yann/feature/lekaupdater/update-process-v150 branch 2 times, most recently from b297865 to d782cbd Compare June 17, 2024 13:14
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
@YannLocatelli YannLocatelli force-pushed the yann/feature/lekaupdater/update-process-v150 branch from d782cbd to 7d7b7e0 Compare June 17, 2024 13:15
Copy link

Quality Gate Passed Quality Gate passed

Issues
8 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ladislas ladislas merged commit 289afeb into develop Jun 18, 2024
8 checks passed
@ladislas ladislas deleted the yann/feature/lekaupdater/update-process-v150 branch June 18, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants