public MainPage() { this.InitializeComponent(); var publisher = new Rssdp.SsdpDevicePublisher(); var locator = new Rssdp.SsdpDeviceLocator(); }
// ################################ // ############# 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); }
// 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"); }
// Constructor public MainPage() { InitializeComponent(); // Sample code to localize the ApplicationBar //BuildLocalizedApplicationBar(); var publisher = new Rssdp.SsdpDevicePublisher(); var locator = new Rssdp.SsdpDeviceLocator(); }
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); }
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."); }
public async Task <IEnumerable <Rssdp.DiscoveredSsdpDevice> > SearchAsync() { var locator = new Rssdp.SsdpDeviceLocator(); return(await locator.SearchAsync()); }
static void Main(string[] args) { var publisher = new Rssdp.SsdpDevicePublisher(); var locator = new Rssdp.SsdpDeviceLocator(); }