-
Notifications
You must be signed in to change notification settings - Fork 6
/
parse.h
52 lines (45 loc) · 1.02 KB
/
parse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef _PARSE_H_
#define _PARSE_H_
#include <stdint.h>
typedef struct {
const unsigned char *data;
const unsigned char *data_p;
size_t len;
} DATA_st;
typedef struct {
unsigned char name[4];
int32_t unknownint;
int32_t datatype;
unsigned char unknown4[4];
uint32_t samples_count;
uint32_t samples_file;
uint32_t samples3;
double timediv;
int32_t offsety;
float voltsdiv;
uint32_t attenuation;
float time_mul;
float frequency;
float period;
float volts_mul;
double *data;
} CHANNEL_st;
typedef struct {
uint32_t length;
int32_t unknown1;
int32_t type;
char model[7];
int32_t intsize;
char serial[30];
unsigned char triggerstatus;
unsigned char unknownstatus;
uint32_t unknownvalue1;
unsigned char unknownvalue2;
unsigned char unknown3[8];
size_t channels_count;
CHANNEL_st **channels;
} HEADER_st;
int owon_parse(const char * const buf, size_t len, HEADER_st *header);
int owon_output_csv(HEADER_st *header, FILE *file);
void owon_free_header(HEADER_st *header);
#endif