This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Serial logger class | ||
|
||
// Standard defines | ||
#include <stdio.h> | ||
#include <iostream> | ||
#include <math.h> | ||
#include <string.h> | ||
|
||
// Ros defines | ||
#include "ros/ros.h" | ||
|
||
using namespace std; | ||
|
||
class Logger { | ||
// function that writes buf to out_file. | ||
// !0 == failure; 0 == success | ||
int append_to_file(uint8_t *buf, char *out_file); | ||
|
||
// returns formatted filename with prefix and current time. | ||
// e.g. g_start_time = 12 Feb 13:01, prefix = "buffer_output", extension = ".txt" | ||
// returns : "buffer_output_12_Feb_13:01.txt" | ||
// Code will figure out if extension has a "." in it | ||
char *file_name_from_time(time_t *current_time, char *prefix, char *extension); | ||
|
||
void log(char *msg, int ros_code); | ||
|
||
char *parse_packet(uint8_t *buf); | ||
}; |