Service
@objc public class Service : NSObject
A Service instance represents the multiscreen service root on the remote device Use the class to control top level services of the device
-
Undocumented
Declaration
Swift
@objc public class Service : NSObject -
The id of the service
Declaration
Swift
public var id: String -
The uri of the service (http://
: /api/v2/) Declaration
Swift
public var uri: String -
The name of the service (Living Room TV)
Declaration
Swift
public var name: String -
The version of the service (x.x.x)
Declaration
Swift
public var version: String -
The type of the service (Samsung SmartTV)
Declaration
Swift
public var type: String -
The service description
Declaration
Swift
override public var description: String -
This asynchronously method retrieves a dictionary of additional information about the device the service is running on
Declaration
Swift
public func getDeviceInfo(timeout: Int, completionHandler: (deviceInfo: [String:AnyObject]?, error: NSError?) -> Void )Parameters
timeouttimeout
completionHandlerA block to handle the response dictionary
-
Creates an application instance belonging to that service
Declaration
Swift
public func createApplication(id: AnyObject, channelURI: String, args: [String:AnyObject]?) -> Application?Parameters
idThe id of the application
channelURIThe uri of the Channel (
com.samsung.multiscreen.helloworld
)argsA dictionary of command line aruguments to be passed to the Host TV App
Return Value
An Application instance or nil if application id or channel id is empty
-
Creates a channel instance belonging to that service (
mychannel
)Declaration
Swift
public func createChannel(channelURI: String) -> ChannelReturn Value
A Channel instance
-
Creates video player instance
Declaration
Swift
public func createVideoPlayer(appName : String) -> VideoPlayerParameters
appNameReturn Value
VideoPlayer instance
-
Creates audio player instance
Declaration
Swift
public func createAudioPlayer(appName : String) -> AudioPlayerParameters
appNameReturn Value
AudioPlayer instance
-
Creates photo player instance
Declaration
Swift
public func createPhotoPlayer(appName : String) -> PhotoPlayerParameters
appNameReturn Value
PhotoPlayer instance
-
Creates a service search object
Declaration
Swift
public class func search() -> ServiceSearchReturn Value
An instance of ServiceSearch
-
This asynchronous method retrieves a service instance given a service URI
Declaration
Swift
public class func getByURI(uri: String, timeout: NSTimeInterval, completionHandler: (service: Service?, error: NSError? ) -> Void)Parameters
uriThe uri of the service
timeOutcompletionHandlerThe completion handler with the service instance or an error
-
This asynchronous method retrieves a service instance given a service id
Declaration
Swift
public class func getById(id: String, completionHandler: (service: Service?, error: NSError? ) -> Void)Parameters
idThe id of the service
completionHandlerThe completion handler with the service instance or an error
-
Send a packet for WakeOnWirelessLan.
Declaration
Swift
public class func WakeOnWirelessLan(macAddr:String)Parameters
macAddrMac Address of TV
-
Send a packet via WakeOnWirelessLan and create and connect to particular appilcation
Declaration
Swift
public class func WakeOnWirelessAndConnect(macAddr:String, uri:String, completionHandler: (service:Service? , error: NSError? ) -> Void) -> VoidParameters
macAddrMac Address of TV
uriThe uri of service
serviceThe service instance
errorAn error info if getByURI fails
-
Send a packet via WakeOnWirelessLan and create and connect to particular appilcation
Declaration
Swift
public class func WakeOnWirelessAndConnect(macAddr:String, uri:String, timeOut:NSTimeInterval ,completionHandler: (service:Service? , error: NSError? ) -> Void) -> VoidParameters
macAddrMac Address of TV
uriThe uri of service
timeOuttimeout to wakeup
serviceThe service instance
errorAn error info if getByURI fails
Service Class Reference