public void InitiateConnection(string endpointId, ScanEndpointInfo scanEndpointInfo, IConnectCallBack connectCallBack)
 {
     if (scanEndpointInfo.Name.Equals(scanInfo))
     {
         Debug.Log("[HMS] Nearby Client found Server and request connection. Server id:" + scanEndpointInfo.Name);
         // Initiate a connection.
         Nearby.DiscoveryEngine.RequestConnect(myNameStr, endpointId, connectCallBack);
     }
 }
Ejemplo n.º 2
0
        public override void OnFound(string Endpoint, ScanEndpointInfo scanEndpointInfo)
        {
            Device device = MainActivity.FindDevice(Endpoint);

            if (device == null)
            {
                device = new Device(scanEndpointInfo.Name, Endpoint, false);
                MainActivity.AvaliableDevicesList.Add(device);
                Log.Debug(MainActivity.TAG, "OnFound : " + Endpoint);
                context.UpdateAvaliableDevices();
            }
        }
Ejemplo n.º 3
0
    public void InitiateConnection(string endpointId, ScanEndpointInfo scanEndpointInfo)
    {
        NearbyManagerListener callBack = new NearbyManagerListener(this);

        nearbyManager.InitiateConnection(endpointId, scanEndpointInfo, callBack);
    }
Ejemplo n.º 4
0
 //ScanEndpointCallback
 public void onFound(string endpointId, ScanEndpointInfo discoveryEndpointInfo)
 {
     Debug.Log("[HMS] NearbyManager OnFound");
     nearbyManagerObject.InitiateConnection(endpointId, discoveryEndpointInfo);
     nearbyManagerObject.OnFound?.Invoke(endpointId, discoveryEndpointInfo);
 }