Skip to content

Commit 2371cb3

Browse files
committed
Adding simple print routine for Pluto structure print
1 parent be92f72 commit 2371cb3

3 files changed

Lines changed: 77 additions & 10 deletions

File tree

Manifest.toml

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
11
# This file is machine-generated - editing it directly is not advised
22

3+
[[ArgTools]]
4+
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
5+
6+
[[Artifacts]]
7+
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
8+
39
[[Base64]]
410
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
511

612
[[Dates]]
713
deps = ["Printf"]
814
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
915

10-
[[Distributed]]
11-
deps = ["Random", "Serialization", "Sockets"]
12-
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
16+
[[Downloads]]
17+
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
18+
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
1319

1420
[[InteractiveUtils]]
1521
deps = ["Markdown"]
1622
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1723

24+
[[LibCURL]]
25+
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
26+
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
27+
28+
[[LibCURL_jll]]
29+
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
30+
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
31+
1832
[[LibGit2]]
19-
deps = ["Printf"]
33+
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
2034
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
2135

36+
[[LibSSH2_jll]]
37+
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
38+
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
39+
2240
[[Libdl]]
2341
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
2442

@@ -29,16 +47,26 @@ uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
2947
deps = ["Base64"]
3048
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
3149

50+
[[MbedTLS_jll]]
51+
deps = ["Artifacts", "Libdl"]
52+
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
53+
54+
[[MozillaCACerts_jll]]
55+
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
56+
57+
[[NetworkOptions]]
58+
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
59+
3260
[[Pkg]]
33-
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
61+
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
3462
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
3563

3664
[[Printf]]
3765
deps = ["Unicode"]
3866
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
3967

4068
[[REPL]]
41-
deps = ["InteractiveUtils", "Markdown", "Sockets"]
69+
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
4270
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
4371

4472
[[Random]]
@@ -59,8 +87,16 @@ uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
5987
[[Sockets]]
6088
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
6189

90+
[[TOML]]
91+
deps = ["Dates"]
92+
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
93+
94+
[[Tar]]
95+
deps = ["ArgTools", "SHA"]
96+
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
97+
6298
[[Test]]
63-
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
99+
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
64100
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
65101

66102
[[UUIDs]]
@@ -69,3 +105,15 @@ uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
69105

70106
[[Unicode]]
71107
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
108+
109+
[[Zlib_jll]]
110+
deps = ["Libdl"]
111+
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
112+
113+
[[nghttp2_jll]]
114+
deps = ["Artifacts", "Libdl"]
115+
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
116+
117+
[[p7zip_jll]]
118+
deps = ["Artifacts", "Libdl"]
119+
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ version = "0.1.3"
55

66
[deps]
77
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
8+
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
89
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
910
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1011

1112
[compat]
12-
julia = "1.5,1,6"
1313
Reexport = "0.2,1.0"
14-
14+
julia = "1.5,1,6"
1515

1616
[extras]
1717
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/AdalmPluto.jl

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
module AdalmPluto
44

5-
using Reexport;
5+
using Reexport
6+
using Printf
67

78
include("libIIO/libIIO.jl");
89
@reexport using .libIIO_jl;
@@ -876,6 +877,24 @@ function refillJuliaBufferRX(pluto::PlutoSDR)
876877
end
877878

878879

880+
"""
881+
print(pluto)
882+
Print the current radio configuration
883+
# Arguments
884+
- `pluto::PlutoSDR` : the radio to receive the samples from, and the structure storing those samples.
885+
886+
# Returns
887+
- A string with the different configuration aspects
888+
"""
889+
function Base.print(pluto::PlutoSDR)
890+
# Print message
891+
strF = @sprintf(" Carrier Frequency: %2.3f MHz\n Sampling Frequency: %2.3f MHz\n",pluto.rx.effectiveCarrierFreq/1e6,pluto.rx.effectiveSamplingRate/1e6);
892+
println("Current Pluto Configuration in Rx mode\n$strF");
893+
strF = @sprintf(" Carrier Frequency: %2.3f MHz\n Sampling Frequency: %2.3f MHz\n",pluto.tx.effectiveCarrierFreq/1e6,pluto.tx.effectiveSamplingRate/1e6);
894+
println("Current Pluto Configuration in Tx mode\n$strF");
895+
896+
end
897+
879898
##
880899
# This function is significantly slower than the one above despite using less arrays and doing stuff manually.
881900
# It is kept here to remind me why the weird interleaving of arrays is still my best solution.

0 commit comments

Comments
 (0)