mUPnP for Objective-C
CGUpnpStateVariable Class Reference

#include <CGUpnpStateVariable.h>

Inheritance diagram for CGUpnpStateVariable:

Instance Methods

(id) - initWithCObject:
 
(NSString *) - name
 
(NSString *) - value
 
(NSString *) - dataType
 
(NSString *) - defaultValue
 
(NSArray *) - allowedValues
 
(NSDictionary< NSString *, id > *) - metadata
 
(BOOL) - isAllowedValue:
 
(BOOL) - query
 
(NSInteger) - statusCode
 

Properties

NSObject * cObjectOwner
 
mUpnpStateVariable * cObject
 

Detailed Description

The CGUpnpStateVariable class is a wrapper class for mUpnpStateVariable of mUPnP for C.

Method Documentation

◆ allowedValues

- (NSArray *) allowedValues

Get an array of the allowed values for the state variable

Returns
The array.

◆ dataType

- (NSString *) dataType

Get the data type declared in the service description (e.g. "string", "ui4", "uri").

Returns
The data type, or nil.

◆ defaultValue

- (NSString *) defaultValue

Get the default value declared in the service description.

Returns
The default value, or nil if none is declared.

◆ initWithCObject:

- (id) initWithCObject: (mUpnpStateVariable*) cobj

Create a wrapper for the specified native state variable.

The native object is borrowed: the wrapper does not take ownership of it and does not modify its userdata. Passing NULL (or using -init) creates an invalid wrapper: name, value, dataType, defaultValue and statusCode return nil/0, allowedValues returns an empty array, and isAllowedValue: and query return NO.

Parameters
cobjThe native state variable, or NULL

◆ isAllowedValue:

- (BOOL) isAllowedValue: (NSString*) value

Checks whether value is allowed for this state variable

Parameters
valueto be checked
Returns
YES if true

◆ metadata

- (NSDictionary< NSString *, id > *) metadata

Owned immutable description snapshot: name/dataType/defaultValue when present, allowedValues (always an immutable array), and allowedValueRange (only when the XML element exists). Range minimum/maximum/step retain exact strings, including incomplete/malformed declarations, for strict validation by the consumer. A declaration never establishes device permission/support.

◆ name

- (NSString *) name

Get the name of the state variable.

Returns
The name.

◆ query

- (BOOL) query

Send query

Returns
YES if successfull; otherwise NO

◆ statusCode

- (NSInteger) statusCode

Get a states code of the last query.

Returns
The status code

◆ value

- (NSString *) value

Get the current value of the state variable.

On a control point this is nil until the variable has been queried with -query or updated by an event. The value declared in the service description is available from -defaultValue.

Returns
The value.

Property Documentation

◆ cObject

- (mUpnpStateVariable*) cObject
readatomicassign

◆ cObjectOwner

- (NSObject*) cObjectOwner
readwriteatomicretain

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