Service
@objc open 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
-
Discovery Type LAN/BLE
Declaration
Swift
open internal(set) var discoveryType = ServiceSearchDiscoveryType.LAN
-
The id of the service
Declaration
Swift
open var id: String
-
The uri of the service (http://
: /api/v2/) Declaration
Swift
open var uri: String
-
The name of the service (Living Room TV)
Declaration
Swift
open var name: String
-
The version of the service (x.x.x)
Declaration
Swift
open var version: String
-
The type of the service (Samsung SmartTV)
Declaration
Swift
open var type: String
-
The service description
Declaration
Swift
override open var description: String
-
This asynchronously method retrieves a dictionary of additional information about the device the service is running on
Declaration
Swift
open func getDeviceInfo(_ timeout: Int, completionHandler: @escaping (_ deviceInfo: [String:AnyObject]?, _ error: NSError?) -> Void )
Parameters
timeout
timeout
completionHandler
A block to handle the response dictionary
-
Creates an application instance belonging to that service
Declaration
Swift
open func createApplication(_ id: AnyObject, channelURI: String, args: [String:AnyObject]?) -> Application?
Parameters
id
The id of the application
channelURI
The uri of the Channel (“com.samsung.multiscreen.helloworld”)
args
A 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
open func createChannel(_ channelURI: String) -> Channel
Return Value
A Channel instance
-
Creates video player instance
Declaration
Swift
open func createVideoPlayer(_ appName : String) -> VideoPlayer
Parameters
appName
Return Value
VideoPlayer instance
-
Creates audio player instance
Declaration
Swift
open func createAudioPlayer(_ appName : String) -> AudioPlayer
Parameters
appName
Return Value
AudioPlayer instance
-
Creates photo player instance
Declaration
Swift
open func createPhotoPlayer(_ appName : String) -> PhotoPlayer
Parameters
appName
Return Value
PhotoPlayer instance
-
Creates a service search object
Declaration
Swift
open class func search() -> ServiceSearch
Return Value
An instance of ServiceSearch
-
This asynchronous method retrieves a service instance given a service URI
Declaration
Swift
open class func getByURI(_ uri: String, timeout: TimeInterval, completionHandler: @escaping (_ service: Service?, _ error: NSError? ) -> Void)
Parameters
uri
The uri of the service
timeOut
completionHandler
The completion handler with the service instance or an error
-
This asynchronous method retrieves a service instance given a service id
Declaration
Swift
open class func getById(_ id: String, completionHandler: @escaping (_ service: Service?, _ error: NSError? ) -> Void)
Parameters
id
The id of the service
completionHandler
The completion handler with the service instance or an error
-
Send a packet for WakeOnWirelessLan.
Declaration
Swift
open class func WakeOnWirelessLan(_ macAddr:String)
Parameters
macAddr
Mac Address of TV
-
Send a packet via WakeOnWirelessLan and create and connect to particular appilcation
Declaration
Swift
open class func WakeOnWirelessAndConnect(_ macAddr:String, uri:String, completionHandler: @escaping (_ service:Service? , _ error: NSError? ) -> Void) -> Void
Parameters
macAddr
Mac Address of TV
uri
The uri of service
service
The service instance
error
An error info if getByURI fails
-
Send a packet via WakeOnWirelessLan and create and connect to particular appilcation
Declaration
Swift
open class func WakeOnWirelessAndConnect(_ macAddr:String, uri:String, timeOut:TimeInterval ,completionHandler: @escaping (_ service:Service? , _ error: NSError? ) -> Void) -> Void
Parameters
macAddr
Mac Address of TV
uri
The uri of service
timeOut
timeout to wakeup
service
The service instance
error
An error info if getByURI fails
-
Undocumented
Declaration
Swift
@objc open class Service : NSObject
-
Tries to Remove the standby service from the DB
Declaration
Swift
open func remove()
-
Checks whether DMP is supported by the Service or not.
Declaration
Swift
open func isDMPSupported() -> Bool