OSDN Git Service

1sec and high smpling file record add.
[scilog/scilog.git] / ad_file.h
1 #if     !defined(__AD_FILE_H__)
2 #define __AD_FILE_H__
3
4 #include "ad_ring.h"
5
6 // データ記録用dir 末尾に/付けない
7 #ifdef  DUMMY
8         #define DIR_DATA                "/home/ntaka/dev/arm2011n/data"
9 #else
10         #define DIR_DATA                "/home/data"
11 #endif
12
13 #if 0
14 // NAV-TIMEUTCパケットのファイル記録用データタイプ
15 typedef struct {
16     unsigned long   tow;    // ms GPS Millisecond Time of Week
17     unsigned long   tacc;   // ns Time Accuracy Estimate
18     long   nano;            // ns Nanoseconds of second, range -1e9 .. 1e9 (UTC)
19     unsigned int    year __attribute__((aligned(1)));   // 12 UTC
20     unsigned char   month __attribute__((aligned(1)));  // 16
21     unsigned char   day __attribute__((aligned(1)));
22     unsigned char   hour __attribute__((aligned(1)));
23     unsigned char   min __attribute__((aligned(1)));
24     unsigned char   sec __attribute__((aligned(1)));
25     unsigned char   valid __attribute__((aligned(1)));  // Validity Flags
26                             //  bit0 validTOW 1 = Valid Time of Week
27                             //  bit1 validWKN 1 = Valid Week Number
28                             //  bit2 validUTC 1 = Valid UTC (Leap Seconds already known)
29 } UbloxNavTimeUtcRecType __attribute__((aligned(1)));
30
31 // 高速サンプルデータ記録用データタイプ
32 typedef struct {
33         UbloxNavTimeUtcRecType  gps;                    // GPSタイムスタンプ
34         unsigned char   data[AD_CHNUM][AD_SAMPLE][AD_BYTES];    // AD
35 } HighSampleRecType;
36
37 #define HIGH_WRITE_LEN  szieof(HighSampleRecType)
38 #endif
39
40 #define HIGH_WRITE_LEN  (9 + AD_CHNUM*AD_SAMPLE*AD_BYTES)       // 仮で50Hz 記録周波数で変わるので要変更!!!!!!!!!!!!!!
41
42
43 int sec_file_open(FILE **fp, AdData *D);
44 int sec_file_out(FILE *fp, char *out, int len);
45 int sec_file_close(FILE *fp);
46 int sec_make_rec_data(AdData *ad, char *buf);
47
48 int high_file_open(FILE **fp, AdData *D);
49 int high_file_out(FILE *fp, char *out, int len);
50 int high_file_close(FILE *fp);
51 int high_make_rec_data(AdData *ad, char *buf);
52
53 #endif