Esempio n. 1
0
 static HALDriverStation()
 {
     try
     {
         NativeDelegateInitializer.SetupNativeDelegates <HALDriverStation>(LibraryLoaderHolder.NativeLoader);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 2
0
 static HALI2C()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALI2C>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 3
0
 static HALSimDigitalPWMData()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALSimDigitalPWMData>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 4
0
 static HALSimAnalogInData()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALSimAnalogInData>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 5
0
 static HALSimSPIAccelerometerData()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALSimSPIAccelerometerData>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 6
0
 static HALSolenoid()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALSolenoid>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 7
0
 static HALNotifier()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALNotifier>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 8
0
        static InteropForTesting()
        {
            var nativeLoader = Interop.NativeLoader;

            NativeDelegateInitializer.SetupNativeDelegates <InteropForTesting>(nativeLoader);
        }
Esempio n. 9
0
        static Interop()
        {
            if (!s_libraryLoaded)
            {
                try
                {
                    finalizeInterop.Ping();
                    string[] commandArgs = Environment.GetCommandLineArgs();
                    foreach (var commandArg in commandArgs)
                    {
                        //search for a line with the prefix "-ntcore:"
                        if (commandArg.ToLower().Contains("-ntcore:"))
                        {
                            //Split line to get the library.
                            int    splitLoc = commandArg.IndexOf(':');
                            string file     = commandArg.Substring(splitLoc + 1);

                            //If the file exists, just return it so dlopen can load it.
                            if (File.Exists(file))
                            {
                                s_libraryLocation    = file;
                                s_useCommandLineFile = true;
                            }
                        }
                    }

                    const string resourceRoot = "FRC.NetworkTables.Core.DesktopLibraries.Libraries.";

                    NativeLoader = new NativeLibraryLoader();
                    NativeLoader.AddLibraryLocation(OsType.Windows32,
                                                    resourceRoot + "Windows.x86.ntcore.dll");
                    NativeLoader.AddLibraryLocation(OsType.Windows64,
                                                    resourceRoot + "Windows.amd64.ntcore.dll");
                    NativeLoader.AddLibraryLocation(OsType.Linux32,
                                                    resourceRoot + "Linux.x86.libntcore.so");
                    NativeLoader.AddLibraryLocation(OsType.Linux64,
                                                    resourceRoot + "Linux.amd64.libntcore.so");
                    NativeLoader.AddLibraryLocation(OsType.MacOs32,
                                                    resourceRoot + "Mac_OS_X.x86.libntcore.dylib");
                    NativeLoader.AddLibraryLocation(OsType.MacOs64,
                                                    resourceRoot + "Mac_OS_X.x86_64.libntcore.dylib");
                    NativeLoader.AddLibraryLocation(OsType.roboRIO, "libntcore.so");

                    if (s_useCommandLineFile)
                    {
                        NativeLoader.LoadNativeLibrary <Interop>(s_libraryLocation, true);
                    }
                    else
                    {
                        NativeLoader.LoadNativeLibraryFromReflectedAssembly("FRC.NetworkTables.Core.DesktopLibraries");
                        s_libraryLocation = NativeLoader.LibraryLocation;
                    }

                    NativeDelegateInitializer.SetupNativeDelegates <Interop>(NativeLoader);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                    Console.WriteLine(e.StackTrace);
                    Environment.Exit(1);
                }
                s_runFinalizer  = true;
                s_libraryLoaded = true;
            }
        }
Esempio n. 10
0
 static HALThreads()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALThreads>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 11
0
 static HALAnalogInput()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALAnalogInput>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 12
0
 static HALSerialPort()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALSerialPort>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 13
0
 static HALAnalogTrigger()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALAnalogTrigger>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 14
0
 static HALAccelerometer()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALAccelerometer>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 15
0
 static HALCompressor()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALCompressor>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 16
0
 static HALInterrupts()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALInterrupts>(LibraryLoaderHolder.NativeLoader);
 }
Esempio n. 17
0
 static HALAnalogAccumulator()
 {
     NativeDelegateInitializer.SetupNativeDelegates <HALAnalogAccumulator>(LibraryLoaderHolder.NativeLoader);
 }