Example #1
0
        //private static WindowsInput.Events.Sources.IKeyboardEventSource keyboard;
        //private static WindowsInput.Events.Sources.IMouseEventSource mouse;

        public static void Start(MainActivity m)
        {
            Program.mActivity = m;

            pid = Process.MyPid().ToString();             // get current process id for HidCerberus.Srv

            foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
            {
                // Get local BT host MAC
                if (nic.NetworkInterfaceType != NetworkInterfaceType.FastEthernetFx && nic.NetworkInterfaceType != NetworkInterfaceType.Wireless80211)
                {
                    if (nic.Name.Split()[0] == "Bluetooth")
                    {
                        btMAC = nic.GetPhysicalAddress();
                    }
                }
            }

            mgr           = new JoyconManager();
            mgr.mActivity = mActivity;
            mgr.Awake();
            mgr.CheckForNewControllers();
            mgr.Start();

            server           = new UdpServer(mgr.j);
            server.mActivity = mActivity;

            server.Start(IPAddress.Parse(ConfigurationManager.AppSettings["IP"]), Int32.Parse(ConfigurationManager.AppSettings["Port"]));
            timer = new HighResTimer(pollsPerSecond, new HighResTimer.ActionDelegate(mgr.Update));
            timer.Start();

            mActivity.console.Append("All systems go\r\n");
        }
 public void Awake()
 {
     instance = this;
     j        = new List <Joycon>();
     HIDapi.hid_init();
 }