BasicUPnPDevice+VLC.m 1.88 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
/*****************************************************************************
 * BasicUPnPDevice+VLC.m
 * VLC for iOS
 *****************************************************************************
 * Copyright (c) 2014 VideoLAN. All rights reserved.
 * $Id$
 *
 * Authors: Marc Etcheverry <marc # taplightsoftware com>
 *
 * Refer to the COPYING file of the official project for license.
 *****************************************************************************/

#import "BasicUPnPDevice+VLC.h"

@implementation BasicUPnPDevice (VLC)

/// Note that we check if it is a media server as well as being an HDHomeRun device
- (BOOL)VLC_isHDHomeRunMediaServer
{
    /*
     * This is a sample UPnP broadcast of a HDHomeRun HDTC-2US device:
     *
     * Type: urn:schemas-upnp-org:device:MediaServer:1
     * UPnP Version: 1.0
     * DLNA Device Class: DMS-1.50
     * Friendly Name: HDHomeRun DLNA Tuner XXXXXXXX
     * Manufacturer: Silicondust
     * Manufacturer URL: http://www.silicondust.com
     * Model Description: HDTC-2US HDHomeRun PLUS Tuner
     * Model Name: HDHomeRun PLUS Tuner
     * Model Number HDTC-2US
     * Model URL: http://www.silicondust.com
     * Serial Nuymber: XXXXXXXX
     * Presentation URL: /
     *
     */

    // Let us do a case insensitive search to be safer. Silicondust's logo has is stylized as "SiliconDust", but the UPnP broadcast is "Silicondust"
    if ([[self urn] rangeOfString:@"urn:schemas-upnp-org:device:MediaServer" options:NSCaseInsensitiveSearch].location != NSNotFound &&
        [[self manufacturer] rangeOfString:@"Silicondust" options:NSCaseInsensitiveSearch].location != NSNotFound &&
        [[self modelName] rangeOfString:@"HDHomeRun" options:NSCaseInsensitiveSearch].location != NSNotFound &&
        [[self modelDescription] rangeOfString:@"HDHomeRun" options:NSCaseInsensitiveSearch].location != NSNotFound) {
        return YES;
    }

    return NO;
}

@end