grpc: fixed wireless config client/server

This commit is contained in:
Blake Harnden 2022-04-01 21:23:58 -07:00
parent 9d97699b1f
commit 559cac18e8
3 changed files with 20 additions and 0 deletions

View file

@ -1112,6 +1112,8 @@ class CoreGrpcClient:
options1: LinkOptions, options1: LinkOptions,
options2: LinkOptions = None, options2: LinkOptions = None,
) -> None: ) -> None:
if options2 is None:
options2 = options1
request = WirelessConfigRequest( request = WirelessConfigRequest(
session_id=session_id, session_id=session_id,
wireless_id=wireless_id, wireless_id=wireless_id,

View file

@ -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( def convert_link(
node1: NodeBase, node1: NodeBase,
iface1: Optional[CoreInterface], iface1: Optional[CoreInterface],

View file

@ -1355,5 +1355,7 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer):
options2 = options1 options2 = options1
if request.HasField("options2"): if request.HasField("options2"):
options2 = request.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) wireless.link_config(request.node1_id, request.node2_id, options1, options2)
return WirelessConfigResponse() return WirelessConfigResponse()