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

FDP-2551 Firmware update added #41

Merged
merged 12 commits into from
Oct 30, 2024
Merged

FDP-2551 Firmware update added #41

merged 12 commits into from
Oct 30, 2024

Conversation

sanderv
Copy link
Contributor

@sanderv sanderv commented Oct 23, 2024

No description provided.

sanderv and others added 6 commits October 23, 2024 16:59
Signed-off-by: Jasper Kamerling <[email protected]>
Signed-off-by: Sander Verbruggen <[email protected]>
Signed-off-by: Loes Immens <[email protected]>
Signed-off-by: Sander Verbruggen <[email protected]>
Signed-off-by: Loes Immens <[email protected]>
Signed-off-by: Sander Verbruggen <[email protected]>
Signed-off-by: Sander van der Heijden <[email protected]>
Signed-off-by: Sander Verbruggen <[email protected]>
Signed-off-by: Sander Verbruggen <[email protected]>
@sanderv sanderv force-pushed the feature/FDP-2551-firmware branch from 4f6b0ca to de75e04 Compare October 23, 2024 14:59
@sanderv sanderv changed the title FD-2551 Firmware update added FDP-2551 Firmware update added Oct 24, 2024
- messages are no longer read from files, but from DeviceMessage
- Simulator state is kept across messages (but not persisted over restarts)
- Message is updated with this simulator state before sending
- Simulator emulates the capacitor; after 5 messages it takes a break

Signed-off-by: Sander Verbruggen <[email protected]>
Can't predict the order and exact content, simplified to just check for a known property in the message

Signed-off-by: Sander Verbruggen <[email protected]>
@sanderv sanderv force-pushed the feature/FDP-2551-firmware branch from e3f7d37 to 490ea18 Compare October 30, 2024 13:35

import org.gxf.crestdevicesimulator.simulator.message.DeviceMessageDownlink

class SimulatorState(val deviceId: String, var fotaMessageCounter: Int = 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

deviceId is not used

}
}
}

fun createMessage(resource: Resource): JsonNode = mapper.readTree(resource.inputStream)
Copy link
Contributor

Choose a reason for hiding this comment

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

mapper property can be removed

}
pskService.isPendingKeyPresent() -> {
// Use new PSK with the next message, not in a response to the setter-msg TODO
Copy link
Contributor

Choose a reason for hiding this comment

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

remove comment? :)

Signed-off-by: Sander Verbruggen <[email protected]>
import org.eclipse.californium.core.CoapResponse
import org.gxf.crestdevicesimulator.simulator.data.entity.SimulatorState

fun interface CommandHandler {
Copy link

Choose a reason for hiding this comment

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

Maybe overkill, maybe interesting: we might look into a state machine library such as KStateMachine

Signed-off-by: Sander Verbruggen <[email protected]>
Signed-off-by: Sander Verbruggen <[email protected]>
Copy link

@sanderv sanderv merged commit ed24206 into main Oct 30, 2024
3 checks passed
@sanderv sanderv deleted the feature/FDP-2551-firmware branch October 30, 2024 16:46
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.

5 participants