internal void StartDiscovery(string serviceId, long duration,
                          NativeEndpointDiscoveryListenerHelper listener)
 {
     C.NearbyConnections_StartDiscovery(SelfPtr(), serviceId, duration, listener.AsPointer());
 }
Example #2
0
 internal void StartDiscovery(string serviceId, long duration,
                              NativeEndpointDiscoveryListenerHelper listener)
 {
     C.NearbyConnections_StartDiscovery(SelfPtr(), serviceId, duration, listener.AsPointer());
 }
        private static NativeEndpointDiscoveryListenerHelper ToDiscoveryListener(
            IDiscoveryListener listener)
        {
            listener = new OnGameThreadDiscoveryListener(listener);
            var helper = new NativeEndpointDiscoveryListenerHelper();

            helper.SetOnEndpointFound((localClientId, endpoint) =>
            listener.OnEndpointFound(endpoint.ToDetails()));
            helper.SetOnEndpointLostCallback((localClientId, lostEndpointId) =>
            listener.OnEndpointLost(lostEndpointId));

            return helper;
        }