-
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
Logging last 30 seconds of data using file ping pong buffer #13
base: main
Are you sure you want to change the base?
Conversation
… of logging data as well as not overwriting existing data by checking file names. A lot of changes were added as I did a lot of work before commiting.
…dded timespec_diff function to find difference in time between two timespec structs. I am using clock_gettime() to get the current system time to compare to time of the last modification.
…the extraction file. Changed the way flight and extraction log file names are constructed. Fixed some typos in variable names. Added teardown function.
…ve logic in the IDLE state that is also done in the AIRBORNE state. Will remove it if not needed
…ting file descriptor for active storage file before calling fstat on it. Changed some variable names for better readability and commented out some code."
There are a few things left to do or check, indicated by TODOs in the code. I also think error handling could be improved a bit, right now it's mostly just printing if the debug option is defined. |
Can you resolve the merge conflicts and work with @AngusJull to test this on Josh? |
} | ||
} | ||
|
||
int switch_active_log_file(FILE **active_storage_file, FILE **storage_file_1, FILE **storage_file_2, char **flight_filename2) |
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.
I want to guess there's a way to work in a more general way to write this func where you just pass active_storage_file
and alternate_storage_file
(or whatever name you want). Then if the alternate storage file is NULL open it. Then if we ever want to change how the rest of our code works this has a better chance of still working as needed
Looking good! Logger is getting pretty big now so if you see blocks of code with a singular purpose you could potentially make them into functions. Like if we factored things out enough, the high-level overview would kind of be spelled out through the names of the functions we're calling in logger's body. We can give it a try on Josh, but I forget if you had the simulator set up. If not, we could try running the code on that and see if the buffers fill up and overwrites happen as expected. We can even use GDB to check when the ping pong buffers get switched to verify it happens when we expect it to. So far in my testing I've found the simulator to be accurate to NuttX on Josh so if it works on there, we can be confident it'll do the same on the real system. |
Summary
Idle/AirborneState
Landed State
Idle