getTTSData(params: Object)

Requires:
OutdoorKit≥1.0.1@ray-js/ray≥1.4.40
Platforms:
iOSAndroid
import { outdoor } from '@ray-js/ray';

const { getTTSData } = outdoor;

// Promise usage
try {
  const res = await getTTSData();
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Get cycling voice broadcast data

Parameters

PropertyTypeRequiredDescription
complete() => voidNoCompletion callback (executed on both success and failure)
success(params: Object) => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
success callback parameters
PropertyTypeDescription
ttsMainSwitchbooleanGlobal switch for cycling data broadcast
weatherbooleanWeather
abnormalWearbooleanAbnormal wear voice alert switch
cyclingMileagebooleanCycling distance voice alert switch
lowBatterybooleanLow battery
electricThresholdnumberLow-battery voice alert threshold; triggers when the battery falls below this percentage
callReminderbooleanIncoming call voice alert switch
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { outdoor } from '@ray-js/ray'

outdoor.getTTSData({
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});