RemoteRF 0.0.6.3__tar.gz → 0.0.6.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {remoterf-0.0.6.3/src/remoteRF.egg-info → remoterf-0.0.6.5}/PKG-INFO +1 -1
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/setup.py +1 -1
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/drivers/adalm_pluto/pluto_remote.py +61 -38
- remoterf-0.0.6.5/src/remoteRF/drivers/adalm_pluto/pluto_wrapper.py +73 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5/src/remoteRF.egg-info}/PKG-INFO +1 -1
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF.egg-info/SOURCES.txt +2 -1
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/LICENSE +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/MANIFEST.in +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/README.md +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/setup.cfg +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/__init__.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/common/__init__.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/common/grpc/__init__.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/common/grpc/grpc_pb2.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/common/grpc/grpc_pb2_grpc.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/common/utils/__init__.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/common/utils/ansi_codes.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/common/utils/api_token.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/common/utils/list_string.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/common/utils/process_arg.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/__init__.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/acc_login.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/app.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/certs/__init__.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/certs/ca.crt +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/certs/ca.key +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/certs/cert.pem +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/certs/key.pem +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/certs/server.crt +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/certs/server.key +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/grpc_acc.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/core/grpc_client.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/drivers/__init__.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF/drivers/adalm_pluto/__init__.py +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF.egg-info/dependency_links.txt +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF.egg-info/entry_points.txt +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF.egg-info/requires.txt +0 -0
- {remoterf-0.0.6.3 → remoterf-0.0.6.5}/src/remoteRF.egg-info/top_level.txt +0 -0
|
@@ -6,7 +6,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name="remoteRF",
|
|
9
|
-
version="0.0.6.
|
|
9
|
+
version="0.0.6.5",
|
|
10
10
|
author="Ethan Ge",
|
|
11
11
|
author_email="ethoGalaxy@gmail.com",
|
|
12
12
|
description="A python API to remotely access signal centric hardware. Client-side only!",
|
|
@@ -2,20 +2,21 @@ from ...core.grpc_client import rpc_client
|
|
|
2
2
|
from ...common.utils import *
|
|
3
3
|
from ...common.grpc import grpc_pb2
|
|
4
4
|
from ...core.grpc_client import get_tcp_calls
|
|
5
|
+
from .pluto_wrapper import WrapperMeta
|
|
5
6
|
|
|
6
|
-
class rx_def:
|
|
7
|
-
|
|
7
|
+
# class rx_def:
|
|
8
|
+
# pass
|
|
8
9
|
|
|
9
|
-
class tx_def:
|
|
10
|
-
|
|
10
|
+
# class tx_def:
|
|
11
|
+
# pass
|
|
11
12
|
|
|
12
|
-
class rx_tx_def(rx_def, tx_def):
|
|
13
|
-
|
|
13
|
+
# class rx_tx_def(rx_def, tx_def):
|
|
14
|
+
# pass
|
|
14
15
|
|
|
15
|
-
class ad9364(rx_tx_def):
|
|
16
|
-
|
|
16
|
+
# class ad9364(rx_tx_def):
|
|
17
|
+
# pass
|
|
17
18
|
|
|
18
|
-
class Pluto: # client
|
|
19
|
+
class Pluto(metaClass=WrapperMeta): # client
|
|
19
20
|
|
|
20
21
|
def __init__(self, token='', debug=False):
|
|
21
22
|
self.token = token
|
|
@@ -28,7 +29,6 @@ class Pluto: # client
|
|
|
28
29
|
self.token = token
|
|
29
30
|
|
|
30
31
|
def try_get(self, *, function_name):
|
|
31
|
-
self.test_print() # For debugging purposes
|
|
32
32
|
try:
|
|
33
33
|
return rpc_client(function_name=f"Pluto:{function_name}:GET", args={'a':map_arg(self.token)}).results[function_name]
|
|
34
34
|
except Exception as e:
|
|
@@ -36,113 +36,136 @@ class Pluto: # client
|
|
|
36
36
|
return None
|
|
37
37
|
|
|
38
38
|
def try_set(self, *, function_name, value):
|
|
39
|
-
self.test_print() # For debugging purposes
|
|
40
39
|
try:
|
|
41
40
|
rpc_client(function_name=f"Pluto:{function_name}:SET", args={function_name: value, 'a':map_arg(self.token)})
|
|
42
41
|
except Exception as e:
|
|
43
42
|
input(f"Error: {e}\nHit enter to continue...")
|
|
44
43
|
|
|
45
|
-
def test_print(self):
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
# def test_print(self):
|
|
45
|
+
# if self.debug == True and get_tcp_calls() % 50 == 0:
|
|
46
|
+
# print(f'TCP Call Number: {get_tcp_calls()}')
|
|
48
47
|
|
|
49
48
|
#region ad9364
|
|
50
49
|
|
|
51
50
|
@property
|
|
52
51
|
def filter(self):
|
|
53
|
-
|
|
52
|
+
pass
|
|
53
|
+
# return self.try_get(function_name="filter")
|
|
54
54
|
|
|
55
55
|
@filter.setter
|
|
56
56
|
def filter(self, value):
|
|
57
|
-
|
|
57
|
+
pass
|
|
58
|
+
# self.try_set(function_name="filter", value=grpc_pb2.Argument(int64_value=value))
|
|
58
59
|
|
|
59
60
|
@property
|
|
60
61
|
def loopback(self):
|
|
61
|
-
|
|
62
|
+
pass
|
|
63
|
+
# return self.try_get(function_name="loopback")
|
|
62
64
|
|
|
63
65
|
@loopback.setter
|
|
64
66
|
def loopback(self, value):
|
|
65
|
-
|
|
67
|
+
pass
|
|
68
|
+
# self.try_set(function_name="loopback", value=grpc_pb2.Argument(int64_value=value))
|
|
66
69
|
|
|
67
70
|
@property
|
|
68
71
|
def gain_control_mode_chan0(self):
|
|
69
|
-
|
|
72
|
+
pass
|
|
73
|
+
# return self.try_get(function_name="gain_control_mode_chan0")
|
|
70
74
|
|
|
71
75
|
@gain_control_mode_chan0.setter
|
|
72
76
|
def gain_control_mode_chan0(self, value):
|
|
73
|
-
|
|
77
|
+
pass
|
|
78
|
+
# self.try_set(function_name="gain_control_mode_chan0", value=grpc_pb2.Argument(int64_value=value))
|
|
74
79
|
|
|
75
80
|
@property
|
|
76
81
|
def rx_hardwaregain_chan0(self):
|
|
77
|
-
|
|
82
|
+
pass
|
|
83
|
+
# return self.try_get(function_name="rx_hardwaregain_chan0")
|
|
78
84
|
|
|
79
85
|
@rx_hardwaregain_chan0.setter
|
|
80
86
|
def rx_hardwaregain_chan0(self, value):
|
|
81
|
-
|
|
87
|
+
pass
|
|
88
|
+
# self.try_set(function_name="rx_hardwaregain_chan0", value=grpc_pb2.Argument(int64_value=value))
|
|
82
89
|
|
|
83
90
|
@property
|
|
84
91
|
def tx_hardwaregain_chan0(self):
|
|
85
|
-
|
|
92
|
+
pass
|
|
93
|
+
# return self.try_get(function_name="tx_hardwaregain_chan0")
|
|
86
94
|
|
|
87
95
|
@tx_hardwaregain_chan0.setter
|
|
88
96
|
def tx_hardwaregain_chan0(self, value):
|
|
89
|
-
|
|
97
|
+
pass
|
|
98
|
+
# self.try_set(function_name="tx_hardwaregain_chan0", value=grpc_pb2.Argument(int64_value=value))
|
|
90
99
|
|
|
91
100
|
@property
|
|
92
101
|
def rx_rf_bandwidth(self):
|
|
93
|
-
|
|
102
|
+
pass
|
|
103
|
+
# return unmap_arg(self.try_get(function_name="rx_rf_bandwidth"))
|
|
94
104
|
|
|
95
105
|
@rx_rf_bandwidth.setter
|
|
96
106
|
def rx_rf_bandwidth(self, value):
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
pass
|
|
108
|
+
# print("Setting RX RF Bandwidth")
|
|
109
|
+
# self.try_set(function_name="rx_rf_bandwidth", value=grpc_pb2.Argument(int64_value=value))
|
|
99
110
|
|
|
100
111
|
@property
|
|
101
112
|
def tx_rf_bandwidth(self):
|
|
102
|
-
|
|
113
|
+
pass
|
|
114
|
+
# return self.try_get(function_name="tx_rf_bandwidth")
|
|
103
115
|
|
|
104
116
|
@tx_rf_bandwidth.setter
|
|
105
117
|
def tx_rf_bandwidth(self, value):
|
|
106
|
-
|
|
118
|
+
pass
|
|
119
|
+
# self.try_set(function_name="tx_rf_bandwidth", value=grpc_pb2.Argument(int64_value=value))
|
|
107
120
|
|
|
108
121
|
@property
|
|
109
122
|
def sample_rate(self):
|
|
110
|
-
|
|
123
|
+
pass
|
|
124
|
+
# return self.try_get(function_name="sample_rate")
|
|
111
125
|
|
|
112
126
|
@sample_rate.setter
|
|
113
127
|
def sample_rate(self, value):
|
|
114
|
-
|
|
128
|
+
pass
|
|
129
|
+
# self.try_set(function_name="sample_rate", value=grpc_pb2.Argument(int64_value=value))
|
|
115
130
|
|
|
116
131
|
@property
|
|
117
132
|
def rx_lo(self):
|
|
118
|
-
|
|
133
|
+
pass
|
|
134
|
+
# return self.try_get(function_name="rx_lo").int64_value
|
|
119
135
|
|
|
120
136
|
@rx_lo.setter
|
|
121
137
|
def rx_lo(self, value):
|
|
122
|
-
|
|
138
|
+
pass
|
|
139
|
+
# self.try_set(function_name="rx_lo", value=grpc_pb2.Argument(int64_value=value))
|
|
123
140
|
|
|
124
141
|
@property
|
|
125
142
|
def tx_lo(self):
|
|
126
|
-
|
|
143
|
+
pass
|
|
144
|
+
# return self.try_get(function_name="tx_lo").int64_value
|
|
127
145
|
|
|
128
146
|
@tx_lo.setter
|
|
129
147
|
def tx_lo(self, value):
|
|
130
|
-
|
|
148
|
+
pass
|
|
149
|
+
# self.try_set(function_name="tx_lo", value=grpc_pb2.Argument(int64_value=value))
|
|
131
150
|
|
|
132
151
|
#endregion
|
|
133
152
|
|
|
134
153
|
#region rx_def
|
|
135
154
|
|
|
155
|
+
@property
|
|
136
156
|
def rx(self):
|
|
137
|
-
|
|
157
|
+
pass
|
|
158
|
+
# return unmap_arg(self.try_get(function_name="rx"))
|
|
138
159
|
|
|
139
160
|
@property
|
|
140
161
|
def rx_buffer_size(self):
|
|
141
|
-
|
|
162
|
+
pass
|
|
163
|
+
# return self.try_get(function_name="rx_buffer_size").int64_value
|
|
142
164
|
|
|
143
165
|
@rx_buffer_size.setter
|
|
144
166
|
def rx_buffer_size(self, value):
|
|
145
|
-
|
|
167
|
+
pass
|
|
168
|
+
# self.try_set(function_name="rx_buffer_size", value=grpc_pb2.Argument(int64_value=value))
|
|
146
169
|
|
|
147
170
|
#endregion
|
|
148
171
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
from ...core import rpc_client
|
|
2
|
+
from ...common.utils.process_arg import map_arg
|
|
3
|
+
|
|
4
|
+
import inspect
|
|
5
|
+
from functools import wraps
|
|
6
|
+
|
|
7
|
+
# def method_wrapper(method):
|
|
8
|
+
# @wraps(method)
|
|
9
|
+
# def wrapped(self, *args, **kwargs): # No methods are present in Pluto Script
|
|
10
|
+
# # Access instance attributes like self.token
|
|
11
|
+
# # print(f"Method called: {method.__name__} with self.token: {self.token}")
|
|
12
|
+
# # Modify behavior as needed
|
|
13
|
+
# # For example, redirect the call
|
|
14
|
+
# # return self.try_get(function_name=method.__name__)
|
|
15
|
+
# return
|
|
16
|
+
# return wrapped
|
|
17
|
+
|
|
18
|
+
def property_wrapper(prop):
|
|
19
|
+
# Wrap the getter
|
|
20
|
+
if prop.fget:
|
|
21
|
+
@wraps(prop.fget)
|
|
22
|
+
def getter(self):
|
|
23
|
+
print(f"Getting property: {prop.fget.__name__} with self.token: {self.token}")
|
|
24
|
+
# Redirect or modify behavior here
|
|
25
|
+
return self.try_get(function_name=prop.fget.__name__)
|
|
26
|
+
else:
|
|
27
|
+
getter = None
|
|
28
|
+
|
|
29
|
+
# Wrap the setter
|
|
30
|
+
if prop.fset:
|
|
31
|
+
@wraps(prop.fset)
|
|
32
|
+
def setter(self, value):
|
|
33
|
+
print(f"Setting property: {prop.fset.__name__} to {value} with self.token: {self.token}")
|
|
34
|
+
# Redirect or modify behavior here
|
|
35
|
+
self.try_set(function_name=prop.fset.__name__, value=value)
|
|
36
|
+
else:
|
|
37
|
+
setter = None
|
|
38
|
+
|
|
39
|
+
# Wrap the deleter
|
|
40
|
+
if prop.fdel:
|
|
41
|
+
@wraps(prop.fdel)
|
|
42
|
+
def deleter(self):
|
|
43
|
+
print(f"Deleting property: {prop.fdel.__name__}")
|
|
44
|
+
# Redirect or modify behavior here
|
|
45
|
+
prop.fdel(self)
|
|
46
|
+
else:
|
|
47
|
+
deleter = None
|
|
48
|
+
|
|
49
|
+
return property(getter, setter, deleter)
|
|
50
|
+
|
|
51
|
+
class WrapperMeta(type):
|
|
52
|
+
def __new__(cls, name, bases, dct):
|
|
53
|
+
# Create the class object first
|
|
54
|
+
cls_obj = super().__new__(cls, name, bases, dct)
|
|
55
|
+
wrapped_methods = set()
|
|
56
|
+
|
|
57
|
+
# Iterate over the MRO to include inherited methods and properties
|
|
58
|
+
for base in cls_obj.__mro__:
|
|
59
|
+
for attr_name, attr_value in base.__dict__.items():
|
|
60
|
+
if attr_name in wrapped_methods or attr_name.startswith('__') and attr_name.endswith('__'):
|
|
61
|
+
continue
|
|
62
|
+
|
|
63
|
+
# if callable(attr_value):
|
|
64
|
+
# # Wrap methods
|
|
65
|
+
# setattr(cls_obj, attr_name, method_wrapper(attr_value))
|
|
66
|
+
# wrapped_methods.add(attr_name)
|
|
67
|
+
|
|
68
|
+
if isinstance(attr_value, property):
|
|
69
|
+
# Wrap properties
|
|
70
|
+
setattr(cls_obj, attr_name, property_wrapper(attr_value))
|
|
71
|
+
wrapped_methods.add(attr_name)
|
|
72
|
+
|
|
73
|
+
return cls_obj
|
|
@@ -32,4 +32,5 @@ src/remoteRF/core/certs/server.crt
|
|
|
32
32
|
src/remoteRF/core/certs/server.key
|
|
33
33
|
src/remoteRF/drivers/__init__.py
|
|
34
34
|
src/remoteRF/drivers/adalm_pluto/__init__.py
|
|
35
|
-
src/remoteRF/drivers/adalm_pluto/pluto_remote.py
|
|
35
|
+
src/remoteRF/drivers/adalm_pluto/pluto_remote.py
|
|
36
|
+
src/remoteRF/drivers/adalm_pluto/pluto_wrapper.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|