| // Copyright 2016 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. |
| |
| library fuchsia.netconnector; |
| |
| using fuchsia.sys; |
| |
| // Special value for GetKnownDeviceNames version_last_seen parameter to |
| // get the current status immediately. |
| const uint64 kInitialKnownDeviceNames = 0; |
| |
| // Primary netconnector service definition. |
| [Discoverable] |
| interface NetConnector { |
| // Registers a running responding service. |service_name| identifies the |
| // service and is the same name used in |ConnectToService|. |service_provider| |
| // provides the service. This method is provided so that responding services |
| // running in a user context can register with a |netconnector| running in a |
| // device context. |
| 1: RegisterServiceProvider(string service_name, |
| fuchsia.sys.ServiceProvider service_provider); |
| |
| // Gets a provider for services on the specified device. Services provided |
| // on the local device can be accessed by passing a |device_name| of "local" |
| // or the actual name of the local device. |
| 2: GetDeviceServiceProvider(string device_name, |
| request<fuchsia.sys.ServiceProvider> service_provider); |
| |
| // Gets the names of known devices. To get the list immediately, call |
| // |GetKnownDeviceNames(kInitialKnownDeviceNames)|. To get updates thereafter, |
| // pass the version sent in the previous callback. |
| 3: GetKnownDeviceNames(uint64 version_last_seen) -> |
| (uint64 version, vector<string> devices); |
| }; |