Esempio n. 1
0
        public MainPage()
        {
            this.InitializeComponent();

            var publisher = new Rssdp.SsdpDevicePublisher();
            var locator   = new Rssdp.SsdpDeviceLocator();
        }
Esempio n. 2
0
// ################################
// ############# SSDP #############
// ################################

#region SSDP

	// Call with: "" for root devices; null for all devices; Any other input for specific search
	public static async Task<Dictionary<string,Rssdp.DiscoveredSsdpDevice>> SearchForDevicesType( string type){

		if( type == null )
			DebugStream.outPut += "Searching for all devices...\n";

		else if( type == "" )
			DebugStream.outPut += "Searching for root devices...\n";

		else
			DebugStream.outPut += "Searching for \"" + type + "\" devices...\n";

		IEnumerable<Rssdp.DiscoveredSsdpDevice> results = null;

		using( var deviceLocator = new Rssdp.SsdpDeviceLocator() ){

			if( type != null )
				results = await deviceLocator.SearchAsync(type == "" ? Rssdp.Infrastructure.SsdpConstants.UpnpDeviceTypeRootDevice : type);
			else
				results = await deviceLocator.SearchAsync();
		}

		// ################################
		foreach( var device in results)
			DebugStream.outPut += device.ResponseHeaders.ToString() + "\n";

		return results.ToDictionary(dev => dev.Usn.Substring(5,36),dev => dev);
	}
Esempio n. 3
0
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            var publisher = new Rssdp.SsdpDevicePublisher();
            var locator   = new Rssdp.SsdpDeviceLocator();

            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            UIApplication.Main(args, null, "AppDelegate");
        }
Esempio n. 4
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
            var publisher = new Rssdp.SsdpDevicePublisher();
            var locator   = new Rssdp.SsdpDeviceLocator();
        }
Esempio n. 5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var publisher = new Rssdp.SsdpDevicePublisher();
            var locator   = new Rssdp.SsdpDeviceLocator();

            // Set our view from the "main" layout resource
            // SetContentView (Resource.Layout.Main);
        }
Esempio n. 6
0
        private static async void SearchAsync()
        {
            Console.WriteLine("Searching");
            var locator = new Rssdp.SsdpDeviceLocator(new Rssdp.Infrastructure.SsdpCommunicationsServer(new Rssdp.SocketFactory("192.168.1.57")));
            var results = await locator.SearchAsync();

            foreach (var device in results)
            {
                Console.WriteLine(device.Usn + " " + device.DescriptionLocation);
            }
            Console.WriteLine("Done. Press any key to exit.");
        }
Esempio n. 7
0
        public async Task <IEnumerable <Rssdp.DiscoveredSsdpDevice> > SearchAsync()
        {
            var locator = new Rssdp.SsdpDeviceLocator();

            return(await locator.SearchAsync());
        }
Esempio n. 8
0
 static void Main(string[] args)
 {
     var publisher = new Rssdp.SsdpDevicePublisher();
     var locator   = new Rssdp.SsdpDeviceLocator();
 }