network api to use samsung product api, <script type="text/javascript" src="$webapis/webapis/webapis js"></script> should be loaded in index html this module defines the network information retrieval functionalities provided by the tizen samsung product api since 2 3 product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public summary of interfaces and methods interface method networkmanagerobject networkmanager domstring getversion ;boolean isconnectedtogateway ;networkipmode getipmode ;void setipmode networkipmode ipmode ;domstring getsubnetmask ;void setsubnetmask domstring subnet ;domstring getgateway ;void setgateway domstring gateway ;domstring getmac ;domstring getdns ;void setdns domstring dns ;domstring getip ;void setip domstring ip ;domstring getproxyserverinfo ;void setproxyserverinfo domstring id, domstring pwd, domstring url, domstring port ;domstring gettvname ;networkactiveconnectiontype getactiveconnectiontype ;unsigned long addnetworkstatechangelistener networkstatechangedcallback listener ;void removenetworkstatechangelistener unsigned long listenerid ;domstring getwifissid ;long getwifisignalstrengthlevel ;networkwifisecuritymode getwifisecuritymode ;networkwifiencryptiontype getwifiencryptiontype ;domstring getsecondarydns ;void setdhcpoption60field domstring vendorname ;void removedhcpoption60field ;domstring getcurrentdhcpoption60field ;domstring checkcurrentipwith60field ;void enablesoftap ;void disablesoftap ;boolean issoftapenabled ;domstring getsoftapssid ;void setsoftapchannel long channel ;domstring getsoftapsecuritykey ;void setsoftapsignalstrength unsigned long power ;void seteapcafilepath domstring path ;void seteappassphrase domstring name, domstring password ;long getwififrequency ; networkstatechangedcallback void onchange networkstate state ; networkipmode networkactiveconnectiontype networkstate networkwifisecuritymode networkwifiencryptiontype 1 interfaces 1 1 networkmanagerobject defines a webapi object instance of the tizen samsung product api the webapis network object enables access to network api functionality [nointerfaceobject] interface networkmanagerobject { readonly attribute networkmanager network; }; webapi implements networkmanagerobject; attributes readonly networkmanager network network api namespace 1 2 networkmanager provides methods for network functionalities [nointerfaceobject] interface networkmanager { attribute networkactiveconnectiontype networkactiveconnectiontype; attribute networkipmode networkipmode; attribute networkstate networkstate; attribute networkwifisecuritymode networkwifisecuritymode; attribute networkwifiencryptiontype networkwifiencryptiontype; domstring getversion ; boolean isconnectedtogateway ; networkipmode getipmode ; void setipmode networkipmode ipmode ; domstring getsubnetmask ; void setsubnetmask domstring subnet ; domstring getgateway ; void setgateway domstring gateway ; domstring getmac ; domstring getdns ; void setdns domstring dns ; domstring getip ; void setip domstring ip ; domstring getproxyserverinfo ; void setproxyserverinfo domstring id, domstring pwd, domstring url, domstring port ; domstring gettvname ; networkactiveconnectiontype getactiveconnectiontype ; unsigned long addnetworkstatechangelistener networkstatechangedcallback listener ; void removenetworkstatechangelistener unsigned long listenerid ; domstring getwifissid ; long getwifisignalstrengthlevel ; networkwifisecuritymode getwifisecuritymode ; networkwifiencryptiontype getwifiencryptiontype ; domstring getsecondarydns ; void setdhcpoption60field domstring vendorname ; void removedhcpoption60field ; domstring getcurrentdhcpoption60field ; domstring checkcurrentipwith60field ; void enablesoftap ; void disablesoftap ; boolean issoftapenabled ; domstring getsoftapssid ; void setsoftapchannel long channel ; domstring getsoftapsecuritykey ; void setsoftapsignalstrength unsigned long power ; void seteapcafilepath domstring path ; void seteappassphrase domstring name, domstring password ; long getwififrequency ; }; attributes networkactiveconnectiontype networkactiveconnectiontype networkactiveconnectiontype interface-related constant networkipmode networkipmode networkipmode interface-related constant networkstate networkstate networkstate interface-related constant networkwifisecuritymode networkwifisecuritymode networkwifisecuritymode interface-related constant networkwifiencryptiontype networkwifiencryptiontype networkwifiencryptiontype interface-related constant methods getversion retrieves the device network module version domstring getversion ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value domstring domstring network plugin module version exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method since 2 3 code example var version = null; try { version = webapis network getversion ; } catch e { console log "getversion exception [" + e code + "] name " + e name + " message " + e message ; } if null != version { console log "[getversion] version " + version ; } isconnectedtogateway checks whether the device is connected to a network gateway boolean isconnectedtogateway ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value boolean boolean value true gateway connected false gateway is not connected exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method since 2 3 code example var gatewaystatus = null; try { gatewaystatus = webapis network isconnectedtogateway ; } catch e { console error "isconnectedtogateway exception [" + e code + "] name " + e name + " message " + e message ; } if null != gatewaystatus { console log "[isconnectedtogateway] gatewaystatus " + gatewaystatus ; } getipmode retrieves the device's ip configuration mode networkipmode getipmode ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value networkipmode unsigned long network ip mode "none" 0 "static" 1 "dynamic" 2 "auto" 3 "fixed" 4 "unknown" 5 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method since 2 3 code example var ipmode = null; var retval = null; try { retval = webapis network getipmode ; } catch e { console log "getipmode exception [" + e code + "] message " + e message ; } if null != retval { switch retval { case webapis network networkipmode static ipmode = "static"; break; case webapis network networkipmode dynamic ipmode = "dynamic"; break; case webapis network networkipmode auto ipmode = "auto"; break; case webapis network networkipmode fixed ipmode = "fixed"; break; case webapis network networkipmode none ipmode = "none"; break; case webapis network networkipmode unknown ipmode = "unknown"; break; default ipmode = "error"; } console log "[getipmode] ipmode " + ipmode ; } setipmode configures device's ip mode void setipmode networkipmode ipmode ; product b2b privilege level public privilege http //developer samsung com/privilege/network public parameters ipmode ip mode to be set "none" 0 "static" 1 "dynamic" 2 "auto" 3 "fixed" 4 "unknown" 5 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with the error type typemismatcherror if different type argument values are passed for an input parameter with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 6 5 code example var err = false; try { webapis network setipmode webapis network networkipmode static ; } catch e { console error "setipmode exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[setipmode] success" ; } getsubnetmask retrieves the device's configured subnet mask address domstring getsubnetmask ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value domstring domstring subnet mask address for the currently-configured network example 255 255 255 0 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 2 3 code example var netmask = null; try { netmask = webapis network getsubnetmask ; } catch e { console log "getsubnetmask exception [" + e code + "] name " + e name + " message " + e message ; } if null != netmask { console log "[getsubnetmask] netmask " + netmask ; } setsubnetmask configures device's subnet mask void setsubnetmask domstring subnet ; product b2b privilege level public privilege http //developer samsung com/privilege/network public parameters subnet subnet mask to be set exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with the error type typemismatcherror if different type argument values are passed for an input parameter with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 6 5 code example var err = false; try { webapis network setsubnetmask "255 255 255 0" ; } catch e { console error "setsubnetmask exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[setsubnetmask] success" ; } getgateway retrieves the device's configured gateway address domstring getgateway ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value domstring domstring gateway address for the currently-configured network example 192 168 0 1 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 2 3 code example var gateway = null; try { gateway = webapis network getgateway ; } catch e { console log "getgateway exception [" + e code + "] name " + e name + " message " + e message ; } if null != gateway { console log "[getgateway] gateway " + gateway ; } setgateway configures device's gateway address void setgateway domstring gateway ; product b2b privilege level public privilege http //developer samsung com/privilege/network public parameters gateway gateway to be set exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with the error type typemismatcherror if different type argument values are passed for an input parameter with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 6 5 code example var err = false; try { webapis network setgateway "107 109 92 1" ; } catch e { console error "setgateway exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[setgateway] success" ; } getmac retrieves the network device's mac address domstring getmac ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value domstring domstring mac address for the currently-configured network example 50 b7 a3 c2 96 11 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 2 3 code example var mac = null; try { mac = webapis network getmac ; } catch e { console log "getmac exception [" + e code + "] name " + e name + " message " + e message ; } if null != mac { console log "[getmac] mac " + mac ; } getdns retrieves the device's configured dns address domstring getdns ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value domstring domstring dns address for the currently-configured network example 192 168 0 1 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 2 3 code example var dns = null; try { dns = webapis network getdns ; } catch e { console log "getdns exception [" + e code + "] name " + e name + " message " + e message ; } if null != dns { console log "[getdns] dns " + dns ; } setdns configures device's dns address void setdns domstring dns ; product b2b privilege level public privilege http //developer samsung com/privilege/network public parameters dns dns to be set exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with the error type typemismatcherror if different type argument values are passed for an input parameter with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 6 5 code example var err = false; try { webapis network setdns "8 8 8 8" ; } catch e { console error "setdns exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[setdns] success" ; } getip retrieves the device's configured ip address domstring getip ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value domstring domstring ip address for the currently-configured network example 192 168 0 11 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 2 3 code example var ip = null; try { ip = webapis network getip ; } catch e { console log "getip exception [" + e code + "] name " + e name + " message " + e message ; } if null != ip { console log "[getip] ip " + ip ; } setip configures device's ip address void setip domstring ip ; product b2b privilege level public privilege http //developer samsung com/privilege/network public parameters ip ip to be set exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with the error type typemismatcherror if different type argument values are passed for an input parameter with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 6 5 code example var err = false; try { webapis network setip "107 109 92 9" ; } catch e { console error "setip exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[setip] success" ; } getproxyserverinfo retrieves the device's configured proxy server info domstring getproxyserverinfo ; product b2b privilege level public privilege http //developer samsung com/privilege/network public return value domstring domstring proxy server info exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 6 5 code example var proxy = null; try { proxy = network getproxyserverinfo ; } catch e { console log "getproxyserverinfo exception [" + e code + "] name " + e name + " message " + e message ; } if null != proxy { console log "[getproxyserverinfo] proxy " + proxy ; } setproxyserverinfo configures device's proxy server info void setproxyserverinfo domstring id, domstring pwd, domstring url, domstring port ; product b2b privilege level public privilege http //developer samsung com/privilege/network public parameters id id to be set pwd password to be set url url to be set port port to be set exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type typemismatcherror if different type argument values are passed for an input parameter with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 6 5 code example var err = false; try { webapis network setproxyserverinfo "id", "pwd", "10 20 30 40", "9998" ; } catch e { console error "setproxyserverinfo exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[setproxyserverinfo] success" ; } gettvname retrieves the device's configured name when device is connected to a network domstring gettvname ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value domstring domstring device name for any connected network example tizen_device exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 4 0 code example var tvname = null; try { tvname = webapis network gettvname ; } catch e { console log "gettvname exception [" + e code + "] mname " + e name + " message " + e message ; } if null != tvname { console log "[gettvname] tvname " + tvname ; } getactiveconnectiontype retrieves the device's currently-active connection type networkactiveconnectiontype getactiveconnectiontype ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value networkactiveconnectiontype unsigned long currently-active network connection type "disconnected" 0 "wifi" 1 "cellular" 2 "ethernet" 3 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method since 2 3 code example var conntype = null; var retval = null; try { retval = webapis network getactiveconnectiontype ; } catch e { console error "getactiveconnectiontype exception [" + e code + "] message " + e message ; } if null != retval { switch retval { case webapis network networkactiveconnectiontype disconnected conntype = "disconnected"; break; case webapis network networkactiveconnectiontype wifi conntype = "wifi"; break; case webapis network networkactiveconnectiontype cellular conntype = "cellular"; break; case webapis network networkactiveconnectiontype ethernet conntype = "ethernet"; break; default conntype = "error"; } console log "[getactiveconnectiontype] active connection type " + conntype ; } addnetworkstatechangelistener registers an asynchronous event listener unsigned long addnetworkstatechangelistener networkstatechangedcallback listener ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public parameters listener callback method for example listenerid = network addnetworkstatechangelistener onchange ; return value unsigned long unsigned long application async listener id exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type typemismatcherror, if an input parameter is not compatible with its expected type since 2 3 code example var onchange = function data { console log "[networkstatechangedcallback] data " + data + " changed" ; } try { listenerid = webapis network addnetworkstatechangelistener onchange ; } catch e { console log "addnetworkstatechangelistener exception [" + e code + "] name " + e name + " message " + e message ; } if listenerid > -1 { console log "addnetworkstatechangelistener success listener id [" + listenerid + "] " ; } removenetworkstatechangelistener unregisters an asynchronous event listener void removenetworkstatechangelistener unsigned long listenerid ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public parameters listenerid listenerid to be removed exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type typemismatcherror, if an input parameter is not compatible with its expected type with error type invalidvalueserror, if the listenerid value is not the same as the value generated by addnetworkstatechangelistener since plugin version 3 0 since 2 3 code example try { console log "begin removenetworkstatechangelistener listenerid " + listenerid ; webapis network removenetworkstatechangelistener listenerid ; } catch e { console log "removenetworkstatechangelistener exception [" + e code + "] name " + e name + " message " + e message ; return; } console log "removenetworkstatechangelistener success" ; getwifissid retrieves the wi-fi network ssid works only when the active connection type is wi-fi domstring getwifissid ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value domstring domstring wi-fi network ssid example strawbarry exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a wi-fi connection is not available since plugin version 3 0 since 2 3 code example var wifissid = null; try { wifissid = webapis network getwifissid ; } catch e { console log "getwifissid exception [" + e code + "] name " + e name + " message " + e message ; } if null != wifissid { console log "[getwifissid] wifissid " + wifissid ; } getwifisignalstrengthlevel retrieves the wi-fi signal strength works only when the active connection type is wi-fi long getwifisignalstrengthlevel ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value long long signal strength level valid values are 1 to 5 signal strength is strongest when the value is 5 8dbm 8 ~ -77dbm 7 ~ -66dbm 6 ~ -55dbm 5dbm exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a wi-fi connection is not available since plugin version 3 0 since 2 3 code example var wifisignalstrengthlevel = null; try { wifisignalstrengthlevel = webapis network getwifisignalstrengthlevel ; } catch e { console log "getwifisignalstrengthlevel exception [" + e code + "] name " + e name + " message " + e message ; } if null != wifisignalstrengthlevel { console log "[getwifisignalstrengthlevel] wifisignalstrengthlevel " + wifisignalstrengthlevel ; } getwifisecuritymode retrieves the wi-fi security mode works only when the active connection type is wi-fi networkwifisecuritymode getwifisecuritymode ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value networkwifisecuritymode unsigned long wi-fi security mode "wep" 1 "wpa_psk" 2 "wpa2_psk" 3 "eap" 4 "none" 5 "unknown" 6 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a wi-fi connection is not available since plugin version 3 0 since 2 3 code example var wifisecuritymode = null; try { wifisecuritymode = webapis network getwifisecuritymode ; } catch e { console log "getwifisecuritymode exception [" + e code + "] name " + e name + " message " + e message ; } if null != wifisecuritymode { console log "[getwifisecuritymode] wifisecuritymode " + wifisecuritymode ; } getwifiencryptiontype retrieves the wi-fi encryption type works only when the active connection type is wi-fi networkwifiencryptiontype getwifiencryptiontype ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value networkwifiencryptiontype unsigned long wi-fi encryption type "wep" 1 "tkip" 2 "aes" 3 "tkip_aes_mixed" 4 "none" 5 "unknown" 6 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a wi-fi connection is not available since plugin version 3 0 since 2 3 code example var wifiencryptiontype = null; try { wifiencryptiontype = webapis network getwifiencryptiontype ; } catch e { console log "getwifiencryptiontype exception [" + e code + "] name " + e name + " message " + e message ; } if null != wifiencryptiontype { console log "[getwifiencryptiontype] wifiencryptiontype " + wifiencryptiontype ; } getsecondarydns retrieves the device's configured secondary dns address domstring getsecondarydns ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value domstring domstring secondary dns address example 192 168 0 100 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 2 3 code example var secondarydns = null; try { secondarydns = webapis network getsecondarydns ; } catch e { console error "getsecondarydns exception [" + e code + "] name " + e name + " message " + e message ; } if null != secondarydns { console log "[getsecondarydns] secondarydns " + secondarydns ; } setdhcpoption60field sets the dhcp option 60 vendor string works only when the active connection type is wired the vendor string is updated when udhcpc is restarted or relaunched void setdhcpoption60field domstring vendorname ; product tv, av, b2b privilege level partner privilege http //developer samsung com/privilege/network dhcpoption60 parameters vendorname dhcp option 60 vendor name string exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 with error type invalidstateerror, if the active connection type is wi-fi since plugin version 3 0 with error type typemismatcherror, if an input parameter is not compatible with its expected type since plugin version 3 0 since 2 3 code example try { webapis network setdhcpoption60field "cisco" ; } catch e { console error "setdhcpoption60field exception [" + e code + "] message " + e message ; } console log "[setdhcpoption60field] dhcpoption60field success " ; removedhcpoption60field sets the dhcp option 60 vendor string to the default value, "udhcpc1 21 1" works only when the active connection type is wired the vendor string is updated when udhcpc is restarted or relaunched void removedhcpoption60field ; product tv, av, b2b privilege level partner privilege http //developer samsung com/privilege/network dhcpoption60 exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 with error type invalidstateerror, if the active connection type is wi-fi since plugin version 3 0 since 2 3 code example try { webapis network removedhcpoption60field ; } catch e { console error "removedhcpoption60field exception [" + e code + "] message " + e message ; } console log "[removedhcpoption60field] dhcpoption60field success " ; getcurrentdhcpoption60field retrieves the dhcp option 60 vendor string works only when the active connection type is wired domstring getcurrentdhcpoption60field ; product tv, av, b2b privilege level partner privilege http //developer samsung com/privilege/network dhcpoption60 return value domstring domstring vendor-specific string default value is "default" example if setdhcpoption60field = "cisco" then getcurrentdhcpoption60field = "cisco" exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 with error type invalidstateerror, if the active connection type is wi-fi since plugin version 3 0 since 2 3 code example var dhcpoption60field = null; try { dhcpoption60field = webapis network getcurrentdhcpoption60field ; } catch e { console error "getcurrentdhcpoption60field exception [" + e code + "] name " + e name + " message " + e message ; } if null != dhcpoption60field { console log "[getcurrentdhcpoption60field] dhcpoption60field " + dhcpoption60field ; } checkcurrentipwith60field retrieves the dhcp option 60 vendor string currently used by udhcp works only when the active connection type is wired domstring checkcurrentipwith60field ; product tv, av, b2b privilege level partner privilege http //developer samsung com/privilege/network dhcpoption60 return value domstring domstring vendor string example if udhcpc is running with the default string "udhcpc1 21 1", after calling setdhcpoption60field = "cisco", checkcurrentipwith60field= "udhcpc1 21 1" exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 with error type invalidstateerror, if the active connection type is wi-fi since plugin version 3 0 since 2 3 code example var dhcpoption60field = null; try { dhcpoption60field = webapis network checkcurrentipwith60field ; } catch e { console error "checkcurrentipwith60field exception [" + e code + "] name " + e name + " message " + e message ; } if null != dhcpoption60field { console log "[checkcurrentipwith60field] dhcpoption60field " + dhcpoption60field ; } enablesoftap this method enables softap in hotel tv void enablesoftap ; product b2b htv privilege level public privilege http //developer samsung com/privilege/network softap exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 with error type invalidstateerror, if connected on wireless connection as softap feature is valid for only wired connection since plugin version 3 0 since 3 0 code example var err = false; try { webapis network enablesoftap ; } catch e { console error "enable softap exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[enablesoftap] success" ; } disablesoftap this method disables softap in hotel tv void disablesoftap ; product b2b htv privilege level public privilege http //developer samsung com/privilege/network softap exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 with error type invalidstateerror, if connected on wireless connection as softap feature is valid for only wired connection since plugin version 3 0 since 3 0 code example var err = false; try { webapis network disablesoftap ; } catch e { console error "disable softap exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[disablesoftap] success" ; } issoftapenabled this method gets the softap status in hotel tv whether it is enabled or not boolean issoftapenabled ; product b2b htv privilege level public privilege http //developer samsung com/privilege/network softap return value boolean boolean it returns true if softap is enabled, false if softap is disabled exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 with error type invalidstateerror, if connected on wireless connection as softap feature is valid for only wired connection since plugin version 3 0 since 3 0 code example var status = null; try { status = webapis network issoftapenabled ; } catch e { console error "issoftapenabled exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if null != status { console log "[issoftapenabled] status " + status ; } getsoftapssid this method returns the softap ssid domstring getsoftapssid ; product b2b htv privilege level public privilege http //developer samsung com/privilege/network softap return value domstring domstring it returns the softap ssid from tethering module exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 with error type invalidstateerror, if connected on wireless connection as softap feature is valid for only wired connection since plugin version 3 0 since 3 0 code example var ssid = null; try { ssid = webapis network getsoftapssid ; } catch e { console error "getsoftapssid exception [" + e code + "] name " + e name + " message " + e message ; } if null != ssid { console log "[getsoftapssid] ssid " + ssid ; } setsoftapchannel this method sets the softap channel to specified channel void setsoftapchannel long channel ; product b2b htv privilege level public privilege http //developer samsung com/privilege/network softap parameters channel softap channel to be set exceptions webapiexception with error type typemismatcherror, if invalid long type passed for 'channel' parameter with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 with error type invalidstateerror, if connected on wireless connection as softap feature is valid for only wired connection since plugin version 3 0 since 3 0 code example var err = false; try { //take input from user and forward it to below api webapis network setsoftapchannel 5 ; } catch e { console error "setsoftapchannel exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[setsoftapchannel] success" ; } getsoftapsecuritykey this method returns the softap security key domstring getsoftapsecuritykey ; product b2b htv privilege level public privilege http //developer samsung com/privilege/network softap return value domstring domstring it returns the softap security key from tethering module exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 with error type invalidstateerror, if connected on wireless connection as softap feature is valid for only wired connection since plugin version 3 0 since 3 0 code example var key = null; try { key = webapis network getsoftapsecuritykey ; } catch e { console error "getsoftapsecuritykey exception [" + e code + "] name " + e name + " message " + e message ; } if null != key { console log "[getsoftapsecuritykey] key " + key ; } setsoftapsignalstrength this method sets softap signal strength to a specific value void setsoftapsignalstrength unsigned long power ; product b2b htv privilege level public privilege http //developer samsung com/privilege/network softap parameters power signal strength 0-100 exceptions webapiexception with error type typemismatcherror, if invalid unsigned long type passed for 'power' parameter with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 with error type invalidstateerror, if connected on wireless connection as softap feature is valid for only wired connection since plugin version 3 0 with error type invalidvalueserror, if power is out of range since 3 0 code example var err = false; try { //take input from user and forward it to below api webapis network setsoftapsignalstrength 100 ; } catch e { console error "setsoftapsignalstrength exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[setsoftapsignalstrength] success" ; } seteapcafilepath set the peap certification file path for peap base ap connection void seteapcafilepath domstring path ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public parameters path peap certification file path exceptions webapiexception with error type typemismatcherror, if invalid domstring type passed for 'path' parameter with error type securityerror, if the application does not have the privilege to call this method since 6 5 code example var err = false; try { webapis network seteapcafilepath "/opt/usr/home/owner/share/root_test/ca der" ; } catch e { console error "seteapcafilepath exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[seteapcafilepath] success" ; } seteappassphrase sets the username and password void seteappassphrase domstring name, domstring password ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public parameters name to be set password to be set exceptions webapiexception with error type typemismatcherror, if invalid domstring type passed for 'name' and 'password' parameter with error type securityerror, if the application does not have the privilege to call this method since 6 5 code example var err = false; try { webapis network seteappassphrase "testing11", "password11" ; } catch e { console error "seteappassphrase exception [" + e code + "] name " + e name + " message " + e message ; err = true; } if err != true { console log "[seteappassphrase] success" ; } getwififrequency retrieves the wi-fi network frequency works only when the active connection type is wi-fi long getwififrequency ; product tv, av, b2b privilege level public privilege http //developer samsung com/privilege/network public return value long wi-fi network frequency mhz exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a wi-fi connection is not available since 6 0 code example var wififrequency = null; try { wififrequency = webapis network getwififrequency ; } catch e { console log "getwififrequency exception [" + e code + "] name " + e name + " message " + e message ; } if null != wififrequency { console log "[getwififrequency] wififrequency " + wififrequency ; } 1 3 networkstatechangedcallback defines a listener for gateway connection state change notifications [callback = functiononly, nointerfaceobject] interface networkstatechangedcallback { void onchange networkstate state ; }; methods onchange callback method for gateway connection state change notifications void onchange networkstate state ; privilege level public privilege http //developer samsung com/privilege/network public parameters state connection state exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type invalidstateerror, if a network connection is not available since plugin version 3 0 since 3 0 code example var gatewaystatus =null; var onchange = function data { if data == webapis network networkstate gateway_connected { gatewaystatus ="gateway_connected"; } else if data == webapis network networkstate gateway_disconnected { gatewaystatus ="gateway_disconnected"; } else{ gatewaystatus ="status unknown"; } console log "[networkstatechangedcallback] data " + data +" "+ gatewaystatus ; } 1 4 networkipmode defines constants for network ip modes [nointerfaceobject] interface networkipmode { const unsigned long none = 0; const unsigned long static = 1; const unsigned long dynamic = 2; const unsigned long auto = 3; const unsigned long fixed = 4; const unsigned long unknown = 5; }; constants none no network ip mode configured static connected to wired or wireless ipv4 network through static ip configuration dynamic connected to wired or wireless ipv6 network through dynamic ip configuration auto dhcp connected to wired or wireless ipv4 network through automatic ip configuration fixed connected to cellular network through fixed ip configuration unknown no wired or wireless connection 1 5 networkactiveconnectiontype defines constants for network connection types [nointerfaceobject] interface networkactiveconnectiontype { const unsigned long disconnected = 0; const unsigned long wifi = 1; const unsigned long cellular = 2; const unsigned long ethernet = 3; }; constants disconnected no network configured wifi connected to a wi-fi network cellular connected to a cellular network ethernet connected to an ethernet network 1 6 networkstate defines constants for network states [nointerfaceobject] interface networkstate { const unsigned long internet_connected = 0; const unsigned long lan_cable_attached = 1; const unsigned long lan_cable_detached = 2; const unsigned long lan_cable_state_unknown = 3; const unsigned long gateway_connected = 4; const unsigned long gateway_disconnected = 5; const unsigned long wifi_module_state_attached = 6; const unsigned long wifi_module_state_detached = 7; const unsigned long wifi_module_state_unknown = 8; const unsigned long internet_disconnected = 9; }; constants internet_connected internet connected lan_cable_attached lan cable connected lan_cable_detached lan cable disconnected lan_cable_state_unknown lan cable connection state unknown gateway_connected gateway connected gateway_disconnected gateway disconnected wifi_module_state_attached wi-fi module connected wifi_module_state_detached wi-fi module disconnected wifi_module_state_unknown wi-fi module connection state unknown internet_disconnected internet disconnected 1 7 networkwifisecuritymode defines constants for wi-fi network security modes [nointerfaceobject] interface networkwifisecuritymode { const unsigned long wep = 1; const unsigned long wpa_psk = 2; const unsigned long wpa2_psk = 3; const unsigned long eap = 4; const unsigned long none = 5; const unsigned long unknown = 6; }; constants wep wep security mode wpa_psk psk security mode wpa2_psk wpa2_psk security mode eap eap security mode none open security mode unknown security mode unknown 1 8 networkwifiencryptiontype defines constants for wi-fi network encryption types [nointerfaceobject] interface networkwifiencryptiontype { const unsigned long wep = 1; const unsigned long tkip = 2; const unsigned long aes = 3; const unsigned long tkip_aes_mixed = 4; const unsigned long none = 5; const unsigned long unknown = 6; }; constants wep wep encryption tkip tkip encryption aes aes encryption tkip_aes_mixed tkip_aes_mixed encryption none no encryption unknown encryption type unknown 2 full webidl module network { [nointerfaceobject] interface networkmanagerobject { readonly attribute networkmanager network; }; webapi implements networkmanagerobject; [nointerfaceobject] interface networkmanager { attribute networkactiveconnectiontype networkactiveconnectiontype; attribute networkipmode networkipmode; attribute networkstate networkstate; attribute networkwifisecuritymode networkwifisecuritymode; attribute networkwifiencryptiontype networkwifiencryptiontype; domstring getversion ; boolean isconnectedtogateway ; networkipmode getipmode ; void setipmode networkipmode ipmode ; domstring getsubnetmask ; void setsubnetmask domstring subnet ; domstring getgateway ; void setgateway domstring gateway ; domstring getmac ; domstring getdns ; void setdns domstring dns ; domstring getip ; void setip domstring ip ; domstring getproxyserverinfo ; void setproxyserverinfo domstring id, domstring pwd, domstring url, domstring port ; domstring gettvname ; networkactiveconnectiontype getactiveconnectiontype ; unsigned long addnetworkstatechangelistener networkstatechangedcallback listener ; void removenetworkstatechangelistener unsigned long listenerid ; domstring getwifissid ; long getwifisignalstrengthlevel ; networkwifisecuritymode getwifisecuritymode ; networkwifiencryptiontype getwifiencryptiontype ; domstring getsecondarydns ; void setdhcpoption60field domstring vendorname ; void removedhcpoption60field ; domstring getcurrentdhcpoption60field ; domstring checkcurrentipwith60field ; void enablesoftap ; void disablesoftap ; boolean issoftapenabled ; domstring getsoftapssid ; void setsoftapchannel long channel ; domstring getsoftapsecuritykey ; void setsoftapsignalstrength unsigned long power ; void seteapcafilepath domstring path ; void seteappassphrase domstring name, domstring password ; long getwififrequency ; }; [callback = functiononly, nointerfaceobject] interface networkstatechangedcallback { void onchange networkstate state ; }; [nointerfaceobject] interface networkipmode { const unsigned long none = 0; const unsigned long static = 1; const unsigned long dynamic = 2; const unsigned long auto = 3; const unsigned long fixed = 4; const unsigned long unknown = 5; }; [nointerfaceobject] interface networkactiveconnectiontype { const unsigned long disconnected = 0; const unsigned long wifi = 1; const unsigned long cellular = 2; const unsigned long ethernet = 3; }; [nointerfaceobject] interface networkstate { const unsigned long internet_connected = 0; const unsigned long lan_cable_attached = 1; const unsigned long lan_cable_detached = 2; const unsigned long lan_cable_state_unknown = 3; const unsigned long gateway_connected = 4; const unsigned long gateway_disconnected = 5; const unsigned long wifi_module_state_attached = 6; const unsigned long wifi_module_state_detached = 7; const unsigned long wifi_module_state_unknown = 8; const unsigned long internet_disconnected = 9; }; [nointerfaceobject] interface networkwifisecuritymode { const unsigned long wep = 1; const unsigned long wpa_psk = 2; const unsigned long wpa2_psk = 3; const unsigned long eap = 4; const unsigned long none = 5; const unsigned long unknown = 6; }; [nointerfaceobject] interface networkwifiencryptiontype { const unsigned long wep = 1; const unsigned long tkip = 2; const unsigned long aes = 3; const unsigned long tkip_aes_mixed = 4; const unsigned long none = 5; const unsigned long unknown = 6; }; };