kindle.net

Handles network functionality

Has the following properties:

NameValueDescription
backgroundRequestHeader'WAF-HTTP-REQUEST-BACKGROUND-HEADER'Unknown, possibly a header used to show background network requests?
roamingfalseDetermine if a 3G Kindle is roaming
rffSessionId''Unknown

kindle.net.getWirelessState

kindle.net.getWirelessState()

Gets the wireless state of the Kindle, returns a string, either 'on' or 'off'

kindle.net.getActiveInterface

kindle.net.getActiveInterface()

Gets the currently active interface of the Kindle, returns a string of the connectionTypes enum

kindle.net.setWirelessPrompt

kindle.net.setWirelessPrompt(promptLevel)

Enables/Disables wireless prompting via the promptLevel parameter

kindle.net.confirmSSLException

kindle.net.confirmSSLException(confirm, callback)

Method for handling an invalid SSL certificate

Accepts/Cancels last invalid certificate exception recieved depending on argument confirm whether it is 'yes' or 'no'.

Callback method is optional, it is unknown if any parameters are passed to it.

kindle.net.ensureWifiConnection

kindle.net.ensureWifiConnection(promptLevel, callback)

Ensures a WiFi connection. Can be done with/without a prompt as set by the promptLevel parameter

The callback also gets an response parameter passed to it. It is a string which has the value of 'success' when it is successful, see connectionResults for possible values.

kindle.net.ensureConnection

kindle.net.ensureConnection(promptLevel, forceConnect, callback);

Ensures any sort of connection. Can be done with/without a prompt as set by the promptLevel parameter

Additional parameters:

ParameterTypeDescription
wifiOnlyBooleanWhether the request is for a wifi only connection or not
callbackFunctionThe function called when the request returns, has a single parameter which is a string, see connectionResults for possible values.

kindle.net.registerHttpErrorListener

kindle.net.registerHttpErrorListener(onHttpError)

Registers a callback for http errors. The onHttpError function will recieve the following arguments:

NameDescription
internalCodeString describing the error
uriThe uri that was accessed
httpStatusMost likely the HTTP response’s status code
responseMessageThe HTTP response message

in the order: onHttpError(internalCode, uri, httpStatus, responseMessage)

kindle.net.deregisterHttpErrorListener

kindle.net.deregisterHttpErrorListener()

Takes no arguments, deregisters any registered http handlers