Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
distributed oscilloscope
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
distributed oscilloscope
Commits
332fa54b
Commit
332fa54b
authored
Jul 04, 2019
by
Milosz Malczak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asdkjn
parent
5c6c2d94
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
31 deletions
+66
-31
adc_client.py
software/fec/adc_client.py
+2
-3
grpc_server.py
software/general/grpc_server.py
+1
-1
rpc.proto
software/general/rpc.proto
+5
-1
rpc_pb2.py
software/general/rpc_pb2.py
+56
-24
rpc_pb2_grpc.py
software/general/rpc_pb2_grpc.py
+2
-2
No files found.
software/fec/adc_client.py
View file @
332fa54b
...
...
@@ -54,9 +54,8 @@ def main():
else
:
with
grpc
.
insecure_channel
(
'128.141.79.50:50051'
)
as
channel
:
stub
=
rpc_pb2_grpc
.
RPC_reqStub
(
channel
)
response
=
stub
.
register_ADC
(
rpc_pb2
.
Args
(
unique_ADC_name
=
unique_ADC_name
))
print
(
"Greeter client received: "
+
response
.
value
)
stub
.
register_ADC
(
rpc_pb2
.
Args
(
unique_ADC_name
=
unique_ADC_name
))
print
(
"Greeter client received: "
)
serv_expose
.
set_server_address
(
ip_server
[
'addr'
])
data
=
{
'function_name'
:
'register_ADC'
,
...
...
software/general/grpc_server.py
View file @
332fa54b
...
...
@@ -7,7 +7,7 @@ from concurrent import futures
class
RPC_req
(
rpc_pb2_grpc
.
RPC_reqServicer
):
def
register_ADC
(
self
,
request
,
context
):
return
rpc_pb2
.
reply
(
value
=
"bleble"
)
return
rpc_pb2
.
Empty
(
)
import
time
...
...
software/general/rpc.proto
View file @
332fa54b
syntax
=
"proto3"
;
message
Empty
{
}
message
RPC
{
string
function_name
=
1
;
Args
args
=
2
;
...
...
@@ -38,5 +42,5 @@ message Args {
service
RPC_req
{
rpc
register_ADC
(
Args
)
returns
(
repl
y
)
{}
rpc
register_ADC
(
Args
)
returns
(
Empt
y
)
{}
}
software/general/rpc_pb2.py
View file @
332fa54b
...
...
@@ -19,12 +19,36 @@ DESCRIPTOR = _descriptor.FileDescriptor(
package
=
''
,
syntax
=
'proto3'
,
serialized_options
=
None
,
serialized_pb
=
_b
(
'
\n\t
rpc.proto
\"
1
\n\x03
RPC
\x12\x15\n\r
function_name
\x18\x01
\x01
(
\t\x12\x13\n\x04\x61
rgs
\x18\x02
\x01
(
\x0b\x32\x05
.Args
\"\x1e\n\x0c\x63
hannel_data
\x12\x0e\n\x06
values
\x18\x01
\x03
(
\x05\"\x1f\n\r
channel_data2
\x12\x0e\n\x06
values
\x18\x01
\x03
(
\x02\"\x18\n\x07
prepost
\x12\r\n\x05
value
\x18\x01
\x03
(
\x05\"\x16\n\x05
reply
\x12\r\n\x05
value
\x18\x01
\x01
(
\t\"\x83\x04\n\x04\x41
rgs
\x12\x17\n\x0f
unique_ADC_name
\x18\x0b
\x01
(
\t\x12\x0c\n\x04\x61\x64\x64
r
\x18\n
\x01
(
\t\x12\x0c\n\x04
port
\x18\t
\x01
(
\x05\x12\x1a\n\x12
number_of_channels
\x18\x08
\x01
(
\x05\x12\x12\n\n
timestamps
\x18\x07
\x03
(
\x03\x12\x12\n\n
presamples
\x18\x06
\x01
(
\x05\x12\x13\n\x0b
postsamples
\x18\x05
\x01
(
\x05\x12\x1d\n\x04\x64\x61
ta
\x18\x04
\x03
(
\x0b\x32\x0f
.Args.DataEntry
\x12\x1f\n\x05\x64\x61
ta2
\x18\x03
\x03
(
\x0b\x32\x10
.Args.Data2Entry
\x12
$
\n\x08
pre_post
\x18\x02
\x03
(
\x0b\x32\x12
.Args.PrePostEntry
\x12
#
\n\x07
offsets
\x18\x01
\x03
(
\x0b\x32\x12
.Args.OffsetsEntry
\x1a
:
\n\t
DataEntry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\t\x12\x1c\n\x05
value
\x18\x02
\x01
(
\x0b\x32\r
.channel_data:
\x02\x38\x01\x1a
<
\n\n
Data2Entry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\x05\x12\x1d\n\x05
value
\x18\x02
\x01
(
\x0b\x32\x0e
.channel_data2:
\x02\x38\x01\x1a\x38\n\x0c
PrePostEntry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\x05\x12\x17\n\x05
value
\x18\x02
\x01
(
\x0b\x32\x08
.prepost:
\x02\x38\x01\x1a
.
\n\x0c
OffsetsEntry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\x05\x12\r\n\x05
value
\x18\x02
\x01
(
\t
:
\x02\x38\x01\x32
*
\n\x07
RPC_req
\x12\x1f\n\x0c
register_ADC
\x12\x05
.Args
\x1a\x06
.repl
y
\"\x00\x62\x06
proto3'
)
serialized_pb
=
_b
(
'
\n\t
rpc.proto
\"
\x07\n\x05\x45
mpty
\"
1
\n\x03
RPC
\x12\x15\n\r
function_name
\x18\x01
\x01
(
\t\x12\x13\n\x04\x61
rgs
\x18\x02
\x01
(
\x0b\x32\x05
.Args
\"\x1e\n\x0c\x63
hannel_data
\x12\x0e\n\x06
values
\x18\x01
\x03
(
\x05\"\x1f\n\r
channel_data2
\x12\x0e\n\x06
values
\x18\x01
\x03
(
\x02\"\x18\n\x07
prepost
\x12\r\n\x05
value
\x18\x01
\x03
(
\x05\"\x16\n\x05
reply
\x12\r\n\x05
value
\x18\x01
\x01
(
\t\"\x83\x04\n\x04\x41
rgs
\x12\x17\n\x0f
unique_ADC_name
\x18\x0b
\x01
(
\t\x12\x0c\n\x04\x61\x64\x64
r
\x18\n
\x01
(
\t\x12\x0c\n\x04
port
\x18\t
\x01
(
\x05\x12\x1a\n\x12
number_of_channels
\x18\x08
\x01
(
\x05\x12\x12\n\n
timestamps
\x18\x07
\x03
(
\x03\x12\x12\n\n
presamples
\x18\x06
\x01
(
\x05\x12\x13\n\x0b
postsamples
\x18\x05
\x01
(
\x05\x12\x1d\n\x04\x64\x61
ta
\x18\x04
\x03
(
\x0b\x32\x0f
.Args.DataEntry
\x12\x1f\n\x05\x64\x61
ta2
\x18\x03
\x03
(
\x0b\x32\x10
.Args.Data2Entry
\x12
$
\n\x08
pre_post
\x18\x02
\x03
(
\x0b\x32\x12
.Args.PrePostEntry
\x12
#
\n\x07
offsets
\x18\x01
\x03
(
\x0b\x32\x12
.Args.OffsetsEntry
\x1a
:
\n\t
DataEntry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\t\x12\x1c\n\x05
value
\x18\x02
\x01
(
\x0b\x32\r
.channel_data:
\x02\x38\x01\x1a
<
\n\n
Data2Entry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\x05\x12\x1d\n\x05
value
\x18\x02
\x01
(
\x0b\x32\x0e
.channel_data2:
\x02\x38\x01\x1a\x38\n\x0c
PrePostEntry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\x05\x12\x17\n\x05
value
\x18\x02
\x01
(
\x0b\x32\x08
.prepost:
\x02\x38\x01\x1a
.
\n\x0c
OffsetsEntry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\x05\x12\r\n\x05
value
\x18\x02
\x01
(
\t
:
\x02\x38\x01\x32
*
\n\x07
RPC_req
\x12\x1f\n\x0c
register_ADC
\x12\x05
.Args
\x1a\x06
.Empt
y
\"\x00\x62\x06
proto3'
)
)
_EMPTY
=
_descriptor
.
Descriptor
(
name
=
'Empty'
,
full_name
=
'Empty'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
],
extensions
=
[
],
nested_types
=
[],
enum_types
=
[
],
serialized_options
=
None
,
is_extendable
=
False
,
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
13
,
serialized_end
=
20
,
)
_RPC
=
_descriptor
.
Descriptor
(
name
=
'RPC'
,
full_name
=
'RPC'
,
...
...
@@ -58,8 +82,8 @@ _RPC = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
13
,
serialized_end
=
62
,
serialized_start
=
22
,
serialized_end
=
71
,
)
...
...
@@ -89,8 +113,8 @@ _CHANNEL_DATA = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
64
,
serialized_end
=
94
,
serialized_start
=
73
,
serialized_end
=
103
,
)
...
...
@@ -120,8 +144,8 @@ _CHANNEL_DATA2 = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
96
,
serialized_end
=
1
27
,
serialized_start
=
105
,
serialized_end
=
1
36
,
)
...
...
@@ -151,8 +175,8 @@ _PREPOST = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
1
29
,
serialized_end
=
1
53
,
serialized_start
=
1
38
,
serialized_end
=
1
62
,
)
...
...
@@ -182,8 +206,8 @@ _REPLY = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
1
55
,
serialized_end
=
1
77
,
serialized_start
=
1
64
,
serialized_end
=
1
86
,
)
...
...
@@ -220,8 +244,8 @@ _ARGS_DATAENTRY = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
4
69
,
serialized_end
=
5
27
,
serialized_start
=
4
78
,
serialized_end
=
5
36
,
)
_ARGS_DATA2ENTRY
=
_descriptor
.
Descriptor
(
...
...
@@ -257,8 +281,8 @@ _ARGS_DATA2ENTRY = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
5
29
,
serialized_end
=
5
89
,
serialized_start
=
5
38
,
serialized_end
=
5
98
,
)
_ARGS_PREPOSTENTRY
=
_descriptor
.
Descriptor
(
...
...
@@ -294,8 +318,8 @@ _ARGS_PREPOSTENTRY = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
591
,
serialized_end
=
6
47
,
serialized_start
=
600
,
serialized_end
=
6
56
,
)
_ARGS_OFFSETSENTRY
=
_descriptor
.
Descriptor
(
...
...
@@ -331,8 +355,8 @@ _ARGS_OFFSETSENTRY = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
6
49
,
serialized_end
=
695
,
serialized_start
=
6
58
,
serialized_end
=
704
,
)
_ARGS
=
_descriptor
.
Descriptor
(
...
...
@@ -431,8 +455,8 @@ _ARGS = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
18
0
,
serialized_end
=
695
,
serialized_start
=
18
9
,
serialized_end
=
704
,
)
_RPC
.
fields_by_name
[
'args'
]
.
message_type
=
_ARGS
...
...
@@ -447,6 +471,7 @@ _ARGS.fields_by_name['data'].message_type = _ARGS_DATAENTRY
_ARGS
.
fields_by_name
[
'data2'
]
.
message_type
=
_ARGS_DATA2ENTRY
_ARGS
.
fields_by_name
[
'pre_post'
]
.
message_type
=
_ARGS_PREPOSTENTRY
_ARGS
.
fields_by_name
[
'offsets'
]
.
message_type
=
_ARGS_OFFSETSENTRY
DESCRIPTOR
.
message_types_by_name
[
'Empty'
]
=
_EMPTY
DESCRIPTOR
.
message_types_by_name
[
'RPC'
]
=
_RPC
DESCRIPTOR
.
message_types_by_name
[
'channel_data'
]
=
_CHANNEL_DATA
DESCRIPTOR
.
message_types_by_name
[
'channel_data2'
]
=
_CHANNEL_DATA2
...
...
@@ -455,6 +480,13 @@ DESCRIPTOR.message_types_by_name['reply'] = _REPLY
DESCRIPTOR
.
message_types_by_name
[
'Args'
]
=
_ARGS
_sym_db
.
RegisterFileDescriptor
(
DESCRIPTOR
)
Empty
=
_reflection
.
GeneratedProtocolMessageType
(
'Empty'
,
(
_message
.
Message
,),
dict
(
DESCRIPTOR
=
_EMPTY
,
__module__
=
'rpc_pb2'
# @@protoc_insertion_point(class_scope:Empty)
))
_sym_db
.
RegisterMessage
(
Empty
)
RPC
=
_reflection
.
GeneratedProtocolMessageType
(
'RPC'
,
(
_message
.
Message
,),
dict
(
DESCRIPTOR
=
_RPC
,
__module__
=
'rpc_pb2'
...
...
@@ -541,8 +573,8 @@ _RPC_REQ = _descriptor.ServiceDescriptor(
file
=
DESCRIPTOR
,
index
=
0
,
serialized_options
=
None
,
serialized_start
=
697
,
serialized_end
=
7
39
,
serialized_start
=
706
,
serialized_end
=
7
48
,
methods
=
[
_descriptor
.
MethodDescriptor
(
name
=
'register_ADC'
,
...
...
@@ -550,7 +582,7 @@ _RPC_REQ = _descriptor.ServiceDescriptor(
index
=
0
,
containing_service
=
None
,
input_type
=
_ARGS
,
output_type
=
_
REPL
Y
,
output_type
=
_
EMPT
Y
,
serialized_options
=
None
,
),
])
...
...
software/general/rpc_pb2_grpc.py
View file @
332fa54b
...
...
@@ -17,7 +17,7 @@ class RPC_reqStub(object):
self
.
register_ADC
=
channel
.
unary_unary
(
'/RPC_req/register_ADC'
,
request_serializer
=
rpc__pb2
.
Args
.
SerializeToString
,
response_deserializer
=
rpc__pb2
.
repl
y
.
FromString
,
response_deserializer
=
rpc__pb2
.
Empt
y
.
FromString
,
)
...
...
@@ -38,7 +38,7 @@ def add_RPC_reqServicer_to_server(servicer, server):
'register_ADC'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
register_ADC
,
request_deserializer
=
rpc__pb2
.
Args
.
FromString
,
response_serializer
=
rpc__pb2
.
repl
y
.
SerializeToString
,
response_serializer
=
rpc__pb2
.
Empt
y
.
SerializeToString
,
),
}
generic_handler
=
grpc
.
method_handlers_generic_handler
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment