devices: wire close up as rpc method

Normally `DeviceService.close` would be called when the connection
was closed on the other end. Expose that close method via RPC so
that clients can call it explicitly. This should be mostly useful
in testing.
This commit is contained in:
Christian Kellner 2021-08-07 16:12:36 +00:00 committed by Tom Gundersen
parent bd0e5f19fd
commit ce312f47be

View file

@ -80,5 +80,8 @@ class DeviceService(host.Service):
if method == "open":
r = self.open(args["dev"], args["tree"], args["options"])
return r, None
if method == "close":
r = self.close()
return r, None
raise host.ProtocolError("Unknown method")