mUPnP for C
CGUpnpDevice Class Reference

#include <CGUpnpDevice.h>

Inheritance diagram for CGUpnpDevice:

Instance Methods

(id) - init
 
(id) - initWithCObject:
 
(id) - initWithDeviceSnapshot:
 
(id) - initWithXMLDescription:
 
(BOOL) - parseXMLDescription:
 
(NSString *) - friendlyName
 
(NSString *) - deviceType
 
(NSString *) - udn
 
(NSString *) - manufacturer
 
(NSString *) - modelNumber
 
(NSString *) - modelName
 
(NSString *) - urlBase
 
(NSString *) - descriptionURL
 
(NSString *) - locationURL
 
(void) - setDeviceType:
 
(void) - setFriendlyName:
 
(void) - setUdn:
 
(BOOL) - isDeviceType:
 
(BOOL) - isUDN:
 
(BOOL) - isFriendlyName:
 
(NSString *) - presentationURL
 
(NSArray *) - services
 
(CGUpnpService *) - getServiceForID:
 
(CGUpnpService *) - getServiceForType:
 
(NSArray *) - icons
 
(BOOL) - start
 
(BOOL) - stop
 
(BOOL) - isRunning
 
(BOOL) - announce
 
(void) - setUserData:
 
(void *) - userData
 
(NSString *) - ipaddress
 
(CGUpnpIcon *) - smallestIcon
 
(CGUpnpIcon *) - smallestIconWithMimeType:
 
(NSString *) - absoluteIconUrl:
 

Protected Attributes

BOOL isCObjectCreated
 

Properties

mUpnpDevice * cObject
 
id< CGUpnpDeviceDelegate > delegate
 

Detailed Description

The CGUpnpDevice class is a wrapper class for mUpnpDevice of mUPnP for C.

Method Documentation

◆ absoluteIconUrl:

- (NSString *) absoluteIconUrl: (CGUpnpIcon*) anIcon

Return a absolute url of the specified icon.

Parameters
anIconIcon.
Returns
Absolute url of the specified icon.

◆ announce

- (BOOL) announce

Announce the device.

Returns
YES if the device is started normally, otherwise NO.

◆ descriptionURL

- (NSString *) descriptionURL

Return a descrition URL

Returns
Descripton URL of the device.

◆ deviceType

- (NSString *) deviceType

Get the device type of the device.

Returns
Device Type.

◆ friendlyName

- (NSString *) friendlyName

Get the friendly name of the device.

Returns
Friendly name.

◆ getServiceForID:

- (CGUpnpService *) getServiceForID: (NSString*) serviceId

Get a service in the device by the specified service ID.

Parameters
serviceIdA service ID string of the service.
Returns
The CGUpnpService if the specified service is found; otherwise nil.

◆ getServiceForType:

- (CGUpnpService *) getServiceForType: (NSString*) serviceType

Get a service in the device by the specified service type.

Parameters
serviceTypeA service type string of the service.
Returns
The CGUpnpService if the specified service is found; otherwise nil.

◆ icons

- (NSArray *) icons

Get all icons in the device as a NSArray object. The array has the services as instances of CGUpnpIconIcon.

Returns
NSArray of CGUpnpIcon.

◆ init

- (id) init

Create a new UPnP device.

Returns
New instance if successful; otherwise nil (the partially initialized instance is released).

◆ initWithCObject:

- (id) initWithCObject: (mUpnpDevice*) cobj

Create a new UPnP device with the C instance.

Returns
New instance if successfull; otherwise nil.

◆ initWithDeviceSnapshot:

- (id) initWithDeviceSnapshot: (mUpnpDevice*) cobj

Copy discovery metadata and SCPDs while the caller holds the cache lock. The returned device is an independent snapshot, safe after cache removal.

◆ initWithXMLDescription:

- (id) initWithXMLDescription: (NSString*) xmlDesc

Create a new UPnP device with the XML description.

Parameters
xmlDescThe device description. See parseXMLDescription:.
Returns
New instance if successful; otherwise nil. On failure the instance and its native device are released exactly once.

◆ ipaddress

- (NSString *) ipaddress

Return a IP address.

Returns
IP address of the device.

◆ isDeviceType:

- (BOOL) isDeviceType: (NSString*) aType

Check whether the device type is the specified type.

Parameters
aTypeA type string of the device.
Returns
YES if the specified type is same as the device type; otherwise NO.

◆ isFriendlyName:

- (BOOL) isFriendlyName: (NSString*) aFriendlyName

Check whether the device's friendly name is the specified name.

Parameters
aFriendlyNameA friendly name string of the device.
Returns
YES if the specified friendly name is same as the device' friendly name; otherwise NO.

◆ isRunning

- (BOOL) isRunning

Check if the controll point is running.

Returns
YES if the device is started normally, otherwise NO.

◆ isUDN:

- (BOOL) isUDN: (NSString*) aUDN

Check whether the device's UDN is the specified UDN.

Parameters
aUDNA UDN string of the device.
Returns
YES if the specified UDN is same as the device' UDN; otherwise NO.

◆ locationURL

- (NSString *) locationURL

Return a location URL

Returns
Location URL of the device.

◆ manufacturer

- (NSString *) manufacturer

Return a manufacture.

Returns
Manufacture of the device.

◆ modelName

- (NSString *) modelName

Return a model name.

Returns
Model name of the device.

◆ modelNumber

- (NSString *) modelNumber

Return a model number.

Returns
Model number of the device.

◆ parseXMLDescription:

- (BOOL) parseXMLDescription: (NSString*) xmlDesc

Parse the specified XML description.

The description is passed to the native parser as UTF-8 bytes, so non-ASCII text such as Japanese or emoji is preserved.

Returns NO without touching the receiver when xmlDesc is nil, empty, not an NSString or not convertible to UTF-8. When the native parser rejects the XML, it returns NO after the native device has been cleared: the receiver then has no description, and service, action, state variable and icon wrappers previously obtained from it must not be used.

Parameters
xmlDescThe device description
Returns
YES if successful; otherwise NO.

◆ presentationURL

- (NSString *) presentationURL

Return a presentationURL

Returns
presentationURL of the device.

◆ services

- (NSArray *) services

Get all services in the device as a NSArray object. The array has the services as instances of CGUpnpService.

Returns
NSArray of CGUpnpService.

◆ setDeviceType:

- (void) setDeviceType: (NSString*) aType

Set a device type of the device.

Parameters
aTypeDevice type to set.

◆ setFriendlyName:

- (void) setFriendlyName: (NSString*) aName

Set a friendly name of the device.

Parameters
aNameFriendly name to set.

◆ setUdn:

- (void) setUdn: (NSString*) aUdn

Set a udn of the device.

Parameters
aUdnUDN to set.

◆ setUserData:

- (void) setUserData: (void*) aUserData

Set a user data.

Parameters
aUserDataA user data to set.
Returns
The CGUpnpService if the specified service is found; otherwise nil.

◆ smallestIcon

- (CGUpnpIcon *) smallestIcon

Return a most smallest icon.

Returns
Smallest Icon.

◆ smallestIconWithMimeType:

- (CGUpnpIcon *) smallestIconWithMimeType: (NSString*) mimeType

Return a most smallest icon with a specified mime type.

Returns
Smallest Icon.

◆ start

- (BOOL) start

Start the device.

Returns
YES if the device is started normally, otherwise NO.

◆ stop

- (BOOL) stop

Stop the device.

Returns
YES if the device is started normally, otherwise NO.

◆ udn

- (NSString *) udn

Get the UDN of the device.

Returns
UDN of the specified device.

◆ urlBase

- (NSString *) urlBase

Return a urlBase

Returns
URLBase of the device.

◆ userData

- (void *) userData

Get a stored user data.

Returns
A stored user data.

Field Documentation

◆ isCObjectCreated

- (BOOL) isCObjectCreated
protected

Property Documentation

◆ cObject

- (mUpnpDevice*) cObject
readwriteatomicassign

◆ delegate

- (id<CGUpnpDeviceDelegate>) delegate
readwriteatomicassign

The documentation for this class was generated from the following files: