ArduSat API
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
SAT_AppStorage.h
Go to the documentation of this file.
1 /*
2 * @file nanosat_message.h
3 * @version 0.1
4 * @name NanoSatisfi Inc.
5 *
6 * @section DESCRIPTION
7 *
8 * Since each experiment node does not have its own SD card, so there is a
9 * simple pub/sub queue for writing data.
10 */
11 
12 #ifndef SAT_APP_STORAGE_H
13 #define SAT_APP_STORAGE_H
14 
15 #include <inttypes.h>
16 #include <stdlib.h>
17 
18 #include <nanosat_message.h>
19 #include <OnboardCommLayer.h>
20 
22 {
23  private:
24  OnboardCommLayer commLayer_;
25  uint8_t nodeAddress_;
26 
27  /*
28  * Takes a fixed size of data to be packed into a Nanosat message struct
29  * then queued in I2C.
30  *
31  * @param data A byte array of data.
32  * @param offset starting offset.
33  * @param length how many bytes to be copied.
34  */
35  void copyAndSend(char data[], unsigned int offset, unsigned int length);
36  public:
37  /*
38  * Constructor
39  */
41 
42  /*
43  * Simple way to enqueue data to be published to disk.
44  *
45  * @note When formatting data, don't forget to add newline or
46  * carriage returns.
47  * @param data A formatted string that needs to be written to disk for
48  * retreival by ground station.
49  */
50  void send(char data[]);
51 
52 };
53 
54 #endif /* SAT_APP_STORAGE_H */