-
Notifications
You must be signed in to change notification settings - Fork 1
Development Log
Murat Toğunçhan Düzgün edited this page Sep 27, 2025
·
2 revisions
This page tracks the day-to-day progress of the SecureEdgePlatform / SensorSimulator project.
Each entry documents what was done and what was learned.
- Refactored CMake project structure:
- Introduced
sensor_impllibrary to share code between executables and tests. - Moved
main()out ofEdgeShell.cppinto a newsrc/main_shell.cppfile.
- Introduced
- Fixed critical ownership issue:
- Sensors are now stored once in
sensors_(asstd::unique_ptr<ISensor>). - Scheduler receives only a raw pointer (
ISensor*) to avoid double ownership. - Resolved segmentation fault during real-time simulation (
runcommand).
- Sensors are now stored once in
- Added template helper
getScheduledSensorAs<T>inSensorSchedulerfor safe downcasting. - Implemented case-insensitive handling for sensor IDs (
TEMP,PRES, etc.). - Wrote new Catch2 unit tests (
tests/test_cli.cpp):- Adding TEMP sensor
- Adding PRES sensor
- Rejecting unsupported sensor types
- Case-insensitive ID handling
→ All tests are now passing ✅
- Importance of single ownership with
unique_ptrand raw pointer handover. - How splitting logic into libraries (
sensor_impl) prevents duplicatemain()issues in tests. - Practical usage of
dynamic_castand templates for polymorphic access.
- Implemented
stop()API in EdgeShell withstd::condition_variableandstd::mutexto safely halt the real-time loop. - Updated RunCommand to use
cv_.wait_forfor cooperative waiting. - Simplified StopCommand to directly invoke
EdgeShell::stop(). - Extended CLI output:
stepSensorand tick loop now print sensor IDs alongside values. - Wrote integration tests (
tests/test_cli.cpp) simulating REPL input viastd::istringstreamand redirectedstd::cin/std::coutto validaterun/stopflows without blocking. - Removed deprecated EdgeCLI menu-based interface.
- Added a comprehensive README.md for the SensorSimulator module.
- Cleaned up repo (removed accidental
.DS_Storefrom version control).
- Testing REPL applications requires simulating
std::cin/std::coutstreams; otherwise tests block indefinitely. -
condition_variableis the right way to cooperatively control background threads (run/stop) in a CLI-driven simulation. - Documentation (README) not only improves onboarding but also serves as a checkpoint for architectural clarity.
- Removing obsolete code (EdgeCLI) helps keep the project lean and focused.
(End of entry — new logs will be appended below with dates.)