Skip to content

Commit c57579e

Browse files
Prototype creating file
1 parent 38dcffd commit c57579e

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#include "telemetry_fs_utils.h"
2+
3+
#include "obc_reliance_fs.h"
4+
#include "obc_spi_io.h"
5+
#include "obc_sci_io.h"
6+
#include "obc_print.h"
7+
#include "obc_errors.h"
8+
#include "obc_gs_telemetry_data.h"
9+
#include "obc_logging.h"
10+
11+
#include <FreeRTOS.h>
12+
#include <os_task.h>
13+
14+
#include <sys_common.h>
15+
#include <sci.h>
16+
#include <spi.h>
17+
18+
#include <redposix.h>
19+
#include <string.h>
20+
21+
void vTask1(void *pvParameter) {
22+
obc_error_code_t errCode;
23+
24+
// Example Telem IDs:
25+
uint32_t telemBatchId = 0;
26+
uint32_t telemFileId = 0;
27+
uint32_t *p_telemFileId = &telemFileId;
28+
29+
// Example Telem Data:
30+
telemetry_data_t telemData = {0};
31+
telemData.obcTemp = 100;
32+
telemData.id = 67;
33+
telemData.timestamp = 1000;
34+
35+
// Init File System:
36+
RETURN_IF_ERROR_CODE(setupFileSystem());
37+
sciPrint("Initialized File System");
38+
39+
// Creating, Writing, and Reading from example file:
40+
RETURN_IF_ERROR_CODE(createAndOpenTelemetryFileRW(telemBatchId, p_telemFileId));
41+
sciPrint("Successfully created and opened telemetry file!");
42+
43+
RETURN_IF_ERROR_CODE(writeTelemetryToFile((int32_t)telemFileId, telemData));
44+
}
45+
46+
int main(void) {}

0 commit comments

Comments
 (0)