grpc: fixed wireless config client/server
This commit is contained in:
parent
9d97699b1f
commit
559cac18e8
3 changed files with 20 additions and 0 deletions
|
@ -1112,6 +1112,8 @@ class CoreGrpcClient:
|
|||
options1: LinkOptions,
|
||||
options2: LinkOptions = None,
|
||||
) -> None:
|
||||
if options2 is None:
|
||||
options2 = options1
|
||||
request = WirelessConfigRequest(
|
||||
session_id=session_id,
|
||||
wireless_id=wireless_id,
|
||||
|
|
|
@ -476,6 +476,22 @@ def convert_link_options(options: LinkOptions) -> core_pb2.LinkOptions:
|
|||
)
|
||||
|
||||
|
||||
def convert_options_proto(options: core_pb2.LinkOptions) -> LinkOptions:
|
||||
return LinkOptions(
|
||||
delay=options.delay,
|
||||
bandwidth=options.bandwidth,
|
||||
loss=options.loss,
|
||||
dup=options.dup,
|
||||
jitter=options.jitter,
|
||||
mer=options.mer,
|
||||
burst=options.burst,
|
||||
mburst=options.mburst,
|
||||
buffer=options.buffer,
|
||||
unidirectional=options.unidirectional,
|
||||
key=options.key,
|
||||
)
|
||||
|
||||
|
||||
def convert_link(
|
||||
node1: NodeBase,
|
||||
iface1: Optional[CoreInterface],
|
||||
|
|
|
@ -1355,5 +1355,7 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer):
|
|||
options2 = options1
|
||||
if request.HasField("options2"):
|
||||
options2 = request.options2
|
||||
options1 = grpcutils.convert_options_proto(options1)
|
||||
options2 = grpcutils.convert_options_proto(options2)
|
||||
wireless.link_config(request.node1_id, request.node2_id, options1, options2)
|
||||
return WirelessConfigResponse()
|
||||
|
|
Loading…
Reference in a new issue