-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframe.h
More file actions
53 lines (41 loc) · 873 Bytes
/
frame.h
File metadata and controls
53 lines (41 loc) · 873 Bytes
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
53
#ifndef FRAME_H
#define FRAME_H
#include <alsa/asoundlib.h>
#include <pthread.h>
#include "./M66FSK/M66FSK.h"
struct Transmitter{
snd_pcm_t *pcm;
snd_pcm_status_t* stat;
pthread_t thread;
short* data;
M66FSK_M fskmod;
int bsize;
pthread_mutex_t data_mutex;
unsigned int datad;
int status;
pthread_mutex_t sleep_mutex;
};
struct Receiver{
snd_pcm_t *pcm;
snd_pcm_status_t* stat;
pthread_t thread;
short* data;
M66FSK_D fskdemod;
int bsize;
pthread_mutex_t data_mutex;
int status;
unsigned int datad;
pthread_mutex_t sleep_mutex;
};
struct Transceiver{
Transmitter t;
Receiver r;
};
/*
lock data mutex and put int data and status ready
unlock data_mutex
lock sleep_mutex
worker thread will unlock the sleep mutex
lock and unlock the sleep mutex after in main
*/
#endif