示例#1
0
        internal static SocketConnection ConvertStructToSocketConnection(SocketConnectionStruct structInfo)
        {
            SocketConnection connectionInfo = new SocketConnection();

            connectionInfo.Fd            = structInfo.SocketFd;
            connectionInfo.RemoteAddress = structInfo.Address;
            connectionInfo.Uuid          = structInfo.ServiceUuid;
            return(connectionInfo);
        }
示例#2
0
        internal static SocketConnection ConvertStructToSocketConnection(SocketConnectionStruct structInfo)
        {
            SocketConnection connectionInfo = new SocketConnection();

            connectionInfo.Fd            = structInfo.SocketFd;
            connectionInfo.RemoteAddress = structInfo.Address;
            connectionInfo.Uuid          = structInfo.ServiceUuid;
            connectionInfo.ServerFd      = structInfo.ServerFd;

            BluetoothSocket clientSocket = new BluetoothSocket();

            clientSocket.connectedSocket = structInfo.SocketFd;
            clientSocket.remoteAddress   = structInfo.Address;
            clientSocket.serviceUuid     = structInfo.ServiceUuid;
            connectionInfo.ClientSocket  = (IBluetoothServerSocket)clientSocket;

            return(connectionInfo);
        }