| // Copyright 2023 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @available(added=HEAD) |
| library fuchsia.hardware.overnet; |
| |
| using zx; |
| |
| closed protocol Callback { |
| // Called when a new link is ready to be serviced. RCS should serve a circuit link over the |
| // given socket. |
| strict NewLink(resource struct { |
| socket zx.Handle:SOCKET; |
| }) -> (); |
| }; |
| |
| // An interface to the USB function device driver that translates bulk in and out requests |
| // into a socket API |
| closed protocol Usb { |
| // Sets a callback that will receive a new socket when the usb device is connected to the host. |
| // If the host disconnects, the socket will be closed and the downstream user can call this |
| // again to wait for another connection. |
| strict SetCallback(resource struct { |
| callback client_end:Callback; |
| }) -> (); |
| }; |
| |
| service UsbService { |
| device client_end:Usb; |
| }; |
| |
| closed protocol Device { |
| // Called by RCS to set a callback through which RCS can receive sockets. |
| strict SetCallback(resource struct { |
| callback client_end:Callback; |
| }) -> (); |
| }; |
| |
| service Service { |
| device client_end:Device; |
| }; |