Helper Functions

A number of helper functions are provided to make things easier for you in integration.

ttv Helper Functions

FunctionDescriptionReturns
ttv.log(message)Send the message (string) to the device’s debug log so it can be viewed in debug mode or in the device logs if the device's log level is set to "Debug".null
ttv.message(message, level)Display a message (string) banner on top of the screen. Takes an optional level which is one of: debug (default) | log | info | warn | errornull
ttv.sendSerialMessage(message)Sends a serial message (string) to an attached serial device.null
ttv.getValue(argumentKey)For Custom Apps. Get argument value by its unique key (string).argument value (string, boolean or number)

Code Samples

window.onloadTelemetryTV = function (ttv) {
	ttv.log('SDK successfully loaded!');

  ttv.message('This is a test debug  message');
  ttv.message('This is an info message', 'info');
  
  ttv.sendSerialMessage('12 34 56 78 90');
  
  // NOTE: Replace the 'yourArgumentKey' with a real key from you Custom App template
  const yourArgValue = ttv.getValue('yourArgumentKey');
  console.log(`The value is: ${yourArgValue}`);
};