Search code examples
samsung-smart-tv

Checking Network Connection in a Samsung Smart TV app


I'm running the 2.5 SDK on a 2011 TV.

I'm having trouble checking the network connection using the Network API found here: http://www.samsungdforum.com/upload_files/files/guide/data/html/html_2/api_reference/javascript_apis/deviceapi/deviceapi_network.html

The values should return either a 1 or 0 but all I'm getting is -1.

Heres my code:

index.html

<object id='pluginNetwork' classid='clsid:SAMSUNG-INFOLINK-NETWORK'></object>
<object id='pluginObjectTV' classid='clsid:SAMSUNG-INFOLINK-TV'></object>

attached js:

var network = document.getElementById('pluginNetwork');
var tvPlugin = document.getEelementById('pluginObjectTV'); 
var ProductType = tvPlugin.GetProductType();
var phyConnection = network.CheckPhysicalConnection(ProductType); //returns -1
var http = network.CheckHTTP(ProductType); //returns -1
var gateway = network.CheckGateway(ProductType); //returns -1

Solution

  • First of all as far as i know there's no such function as GetProductType on SAMSUNG-INFOLINK-NETWORK object.

    Replace GetProductType with GetActiveType and it should work.