Esempio n. 1
0
        internal static WiFiDirectPeer ConvertStructToDiscoveredPeer(DiscoveredPeerStruct peer)
        {
            WiFiDirectPeer resultPeer = new WiFiDirectPeer();

            resultPeer._peerDeviceName         = peer._name;
            resultPeer._peerMacAddress         = peer._macAddress;
            resultPeer._peerInterfaceAddress   = peer._interfaceAddress;
            resultPeer._peerChannel            = peer._channel;
            resultPeer._isPeerConnected        = peer._isConnected;
            resultPeer._isPeerGroupOwner       = peer._isGroupOwner;
            resultPeer._peerPrimaryType        = peer._primaryType;
            resultPeer._peerSecondaryType      = peer._secondaryType;
            resultPeer._peerWpsTypes           = peer._wpsTypes;
            resultPeer._p2PInvitationSupported = peer._isP2PInvitationSupported;
            Collection <string> uuidList = null;

            if (peer._serviceCount > 0)
            {
                IntPtr[] serviceList = new IntPtr[peer._serviceCount];
                Marshal.Copy(peer._serviceList, serviceList, 0, (int)peer._serviceCount);
                uuidList = new Collection <string>();
                foreach (IntPtr service in serviceList)
                {
                    string registeredService = Marshal.PtrToStringAnsi(service);
                    uuidList.Add(registeredService);
                }

                resultPeer._peerServiceCount = peer._serviceCount;
                resultPeer._peerServiceList  = uuidList;
            }

            resultPeer._isPeerMiracastDevice = peer._isMiracast;
            return(resultPeer);
        }
Esempio n. 2
0
 internal ServiceStateChangedEventArgs(WiFiDirectError error, WiFiDirectServiceDiscoveryState state, WiFiDirectServiceType type, string response, WiFiDirectPeer peer)
 {
     _error    = error;
     _state    = state;
     _type     = type;
     _response = response;
     _peer     = peer;
 }
Esempio n. 3
0
 internal PeerFoundEventArgs(WiFiDirectError error, WiFiDirectDiscoveryState state, WiFiDirectPeer peer)
 {
     _error = error;
     _state = state;
     _peer  = peer;
 }