BasicUPnPDevice+VLC.m 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*****************************************************************************
  2. * BasicUPnPDevice+VLC.m
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2014 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Marc Etcheverry <marc # taplightsoftware com>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. #import "BasicUPnPDevice+VLC.h"
  13. @implementation BasicUPnPDevice (VLC)
  14. /// Note that we check if it is a media server as well as being an HDHomeRun device
  15. - (BOOL)VLC_isHDHomeRunMediaServer
  16. {
  17. /*
  18. * This is a sample UPnP broadcast of a HDHomeRun HDTC-2US device:
  19. *
  20. * Type: urn:schemas-upnp-org:device:MediaServer:1
  21. * UPnP Version: 1.0
  22. * DLNA Device Class: DMS-1.50
  23. * Friendly Name: HDHomeRun DLNA Tuner XXXXXXXX
  24. * Manufacturer: Silicondust
  25. * Manufacturer URL: http://www.silicondust.com
  26. * Model Description: HDTC-2US HDHomeRun PLUS Tuner
  27. * Model Name: HDHomeRun PLUS Tuner
  28. * Model Number HDTC-2US
  29. * Model URL: http://www.silicondust.com
  30. * Serial Nuymber: XXXXXXXX
  31. * Presentation URL: /
  32. *
  33. */
  34. // Let us do a case insensitive search to be safer. Silicondust's logo has is stylized as "SiliconDust", but the UPnP broadcast is "Silicondust"
  35. if ([[self urn] rangeOfString:@"urn:schemas-upnp-org:device:MediaServer" options:NSCaseInsensitiveSearch].location != NSNotFound &&
  36. [[self manufacturer] rangeOfString:@"Silicondust" options:NSCaseInsensitiveSearch].location != NSNotFound &&
  37. [[self modelName] rangeOfString:@"HDHomeRun" options:NSCaseInsensitiveSearch].location != NSNotFound &&
  38. [[self modelDescription] rangeOfString:@"HDHomeRun" options:NSCaseInsensitiveSearch].location != NSNotFound) {
  39. return YES;
  40. }
  41. return NO;
  42. }
  43. @end