-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpsk31.h
More file actions
48 lines (39 loc) · 1.23 KB
/
Copy pathpsk31.h
File metadata and controls
48 lines (39 loc) · 1.23 KB
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
#ifndef PSK31_H
#define PSK31_H
// ---------------------------------------------------------------------
// Encoder
// ---------------------------------------------------------------------
/**
* Initializes the encoder with a buffer.
* @param buffer The buffer to store the encoded text.
*/
void encoder_start(unsigned char *buffer);
/**
* Pushes a character to the encoder.
* @param ascii The ASCII character to push.
*/
void encoder_push(char ascii);
/**
* Finalizes the encoding and returns the resulting stream length.
* @return The length of the stream in bytes.
*/
int encoder_done(void);
// ---------------------------------------------------------------------
// Decoder
// ---------------------------------------------------------------------
/**
* Callback function type for decoded ASCII characters.
* @param ascii The decoded ASCII character.
*/
typedef void(*ascii_callback)(char ascii);
/**
* Initializes the decoder with a callback function.
* @param callback The callback function to invoke when characters are decoded.
*/
void decoder_init(ascii_callback callback);
/**
* Pushes a byte to the decoder for processing.
* @param byte The byte to decode.
*/
void decoder_push(unsigned char byte);
#endif // PSK31_H