FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JTEncode/src/main.cpp at main · WsprryPi/JTEncode · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
WsprryPi
/
JTEncode
Public
forked from
etherkit/JTEncode
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JTEncode
/
src
/
main.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
85 lines (75 loc) · 2.26 KB
Breadcrumbs
JTEncode
/
src
/
main.cpp
Copy path
File metadata and controls
85 lines (75 loc) · 2.26 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#
include
"
JTEncode.h
"
#
include
"
rs_common.h
"
#
include
"
int.h
"
#
include
<
cstdio
>
#
include
<
iomanip
>
#
include
<
iostream
>
#
include
<
string.h
>
//
Enumerations
enum
wspr_type
{
TYPE1
=
1
,
TYPE2
,
TYPE3
};
//
Class instantiation
JTEncode jtencode;
int
main
()
{
uint8_t
dbm =
20
;
uint8_t
tx_buffer[
255
];
for
(
int
type =
1
; type <=
3
; ++type)
{
//
Clear out the transmit buffer
memset
(tx_buffer,
0
,
255
);
if
(type ==
1
)
{
char
call[] =
"
AA0NT
"
;
char
loc[] =
"
EM18
"
;
jtencode.
wspr_encode
(call, loc, dbm, tx_buffer);
std::cout <<
"
[Encoding]
"
;
std::cout <<
"
Call:
"
<< call <<
"
,
"
;
std::cout <<
"
Loc:
"
<< loc <<
"
,
"
;
std::cout <<
"
dBm:
"
<<
std::to_string
(dbm) <<
"
.
"
;
std::cout << std::endl;
}
else
if
(type ==
2
)
{
char
call[] =
"
AA0NT/P
"
;
char
loc[] =
"
EM18
"
;
jtencode.
wspr_encode
(call, loc, dbm, tx_buffer);
std::cout <<
"
[Encoding]
"
;
std::cout <<
"
Call:
"
<< call <<
"
,
"
;
std::cout <<
"
Loc:
"
<< loc <<
"
,
"
;
std::cout <<
"
dBm:
"
<<
std::to_string
(dbm) <<
"
.
"
;
std::cout << std::endl;
}
else
if
(type ==
3
)
{
char
call[] =
"
<AA0NT>
"
;
char
loc[] =
"
EM18IG
"
;
jtencode.
wspr_encode
(call, loc, dbm, tx_buffer);
std::cout <<
"
[Encoding]
"
;
std::cout <<
"
Call:
"
<< call <<
"
,
"
;
std::cout <<
"
Loc:
"
<< loc <<
"
,
"
;
std::cout <<
"
dBm:
"
<<
std::to_string
(dbm) <<
"
.
"
;
std::cout << std::endl;
}
else
{
std::cout <<
"
Incorrect mode selected,
"
<< std::endl;
}
//
Iterate through the symbols and print them.
std::cout <<
"
WSPR Block:
"
<< std::endl;
for
(
int
i =
0
; i <
WSPR_SYMBOL_COUNT
; ++i)
{
//
Print each symbol as an integer.
std::cout <<
std::setw
(
3
) <<
static_cast
<
int
>(tx_buffer[i]) <<
"
"
;
//
Optionally, insert a newline every 16 symbols for readability.
if
((i +
1
) %
16
==
0
)
std::cout << std::endl;
}
std::cout << std::endl;
}
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL