saveSettings( settings ) method

Save the connection settings to native application storage.

Device registration will be attempted if and only the following conditions are both satisfied.
  1. The registration method is not manual. This can be passed in the hwc.ConnectionSettings object, or if that value is null, the currently configured value will be used.
  2. The password must be non-empty. This value MUST be passed in the hwc.ConnectionSettings object.


             hwc.startClient() needs to be called after hwc.saveSettings() for the device to complete automatic/manual registration. 

            


             Usage Note:  It is not mandatory to specify a value for each  hwc.ConnectionSettings property. Specifying a null or undefined for a hwc.ConnectionSettings 
property will effectively cause this method to IGNORE the property and not change it's value. 

If the saveSettings() operation fails, a non-zero number will be returned. See hwc.REG_ERR_* for device registration errors.
There can be other types of errors not listed here.

Syntax

<static> saveSettings( settings ) → {number}

Parameters

Name Type Description
settings hwc.ConnectionSettings The connection settings to be saved.

Returns

A status code indicating success (hwc.SETTING_SUCCESS) or an error (one of hwc.REG_ERR_AUTO_REG_NOT_ENABLED, hwc.REG_ERR_AUTO_REG_TEMPLATE_NOT_FOUND, hwc.REG_ERR_AUTO_REG_USER_NAME_TOO_LONG, hwc.REG_ERR_AUTO_REG_WRONG_USER_FOR_DEVICE, hwc.REG_ERR_COULD_NOT_REACH_MMS_SERVER, hwc.REG_ERR_INVALID_USER_NAME, hwc.REG_ERR_MMS_AUTHENTICATION_FAILED).

Type:

number

Example

// Load the connection settings.
var connectionSettings = hwc.loadSettings();
// Modify the connection settings.
connectionSettings.ServerName = "999.999.999.999";
// Save the modified connection settings.
hwc.saveSettings( connectionSettings );
// Start the client to for the device to complete automatic/manual registration.
hwc.startClient();

Source

hwc-api.js, line 196.