コード例 #1
0
ファイル: ANTScript.cs プロジェクト: prograhamer/Game
    private void Initialize()
    {
        Action<Exception>ErrorHandler = (ex) => {
            Debug.LogError("Failed to initialize ANT connection: " + ex.Message);
        };

        try {
            Connection = AntPlusConnection.GetConnection();
            Connection.Connect ();
            Initialized = true;
        } catch(DuplicateConnectionException dce)
        {
            ErrorHandler(dce);
        } catch(InitializationException ie)
        {
            ErrorHandler(ie);
        }
    }
コード例 #2
0
ファイル: AntConnection.cs プロジェクト: prograhamer/Truant
        public void Disconnect()
        {
            Console.WriteLine("Disconnecting and resetting");

            AntInternal.ANT_UnassignAllResponseFunctions();

            AntInternal.ANT_ResetSystem();
            AntInternal.ANT_Close();

            connection = null;
        }
コード例 #3
0
ファイル: AntConnection.cs プロジェクト: prograhamer/Truant
 public static AntConnection GetConnection(byte device, byte network, byte [] networkKey)
 {
     if(connection == null) connection = new AntConnection(device, network, networkKey);
     return connection;
 }