1.0.1 ENABLE.tvi

Namespace: tvi

Functions for TVI connection.

Namespaces

event

Methods

static ENABLE.tvi.getSettings () {Object}

Get tvi settings

{
    "supported" : true,
    "started" : true,
    "baud_rate" : "9600",
    "intercharacter_time" : "0",
    "binary_mode" : "false",
    "status_code" : ""
}
Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
supported Boolean tvi capability
started Boolean tvi connection
baud_rate Number tvi baud rate setting
intercharacter_time Number tvi intercharacter time setting
binary_mode Boolean tvi binary mode setting
status_code String ENABLE.status.SUCCESS or ENABLE.status.ERROR

static ENABLE.tvi.sendMessage (message) {Object}

Send tvi message
Before sending any message, Tvi connection should be started using ENABLE.tvi.startTvi

Name Type Description
message String
Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

static ENABLE.tvi.setEventCallback (callback) {Object}

Register TVI event callback function.
Only one callback function can be registered. Pass null as callback to unregister.
Example:

var callback = function(obj) {
    if (obj.event === ENABLE.tvi.event.TVI_EVENT){
        console.log("receive tvi message");
    }
};
ENABLE.tvi.setEventCallback(callback);
Name Type Description
callback ENABLE.tvi~Callback

Callback function.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.tvi.setSettings (object) {Object}

Set tvi settings

Example for options :

{
    "baud_rate" : 9600,
    "intercharacter_time" : 0,
    "binary_mode" : false
}
Name Type Description
object Object
Name Type Description
baud_rate Number
intercharacter_time Number
binary_mode Boolean
Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.tvi.start () {Object}

Start tvi connection

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

static ENABLE.tvi.stop () {Object}

Stop tvi connection

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

Type Definitions

Callback (object)

Callback function for ENABLE.tvi.setEventCallback

Name Type Description
object Object
Name Type Description
event Object

Possible values of event:
ENABLE.tvi.event.TVI_EVENT

Since:
  • 1.0.0