{IDO工具接口说明}

1.功能概述

提供查询是否支持获取固件日志接口,查询日志目录地址,开始启动获取日志和取消获取日志的能力。

2.接口能力

1.PNG格式图片转BMP格式:

1.1 功能概括:

提供转换图片格式的能力(png to bmp)。

1.2 API ID:

int png2Bmp(
  {required String inPath,
   required String outPath,
   required ImageFormatType format})

1.3 API参数说明:

@param:inPath 素材路径,png图片路径,包含素材文件名和文件后缀。

@param:outPath 目标路径,bmp图片路径,包含目标文件名和文件后缀。

@param:format 目标文件(bmp图片)格式,5:RGB565,8:RGB888。

@return:0 成功。

2.压缩png图片质量:

2.1 功能概括:

提供压缩png图片质量的能力。

2.2 API ID:

int compressToPNG(
  {required String inputFilePath, required String outputFilePath})

2.3 API参数说明:

@param:inputFilePath 素材路径,包含素材文件名和文件后缀。

@param:outputFilePath 目标路径,包含目标文件名和文件后缀。

@return:0 成功

2.压缩png图片质量:

2.1 功能概括:

提供压缩png图片质量的能力。

2.2 API ID:

int compressToPNG(
  {required String inputFilePath, required String outputFilePath})

2.3 API参数说明:

@param:inputFilePath 素材路径,包含素材文件名和文件后缀。

@param:outputFilePath 目标路径,包含目标文件名和文件后缀。

@return:0 成功

3.制作EPO文件:

3.1 功能概括:

提供一个三合一的制作EPO.DAT文件的能力。

3.2 API ID:

Future<bool> makeEpoFile({
    required String dirPath,
    required String epoFilePath,
  })

3.3 API参数说明:

@param:dirPath 素材目录路径,字符串,末尾需要填‘/’。

@param:epoFilePath 目标文件名,包含文件后缀,固定为EPO.DAT。

@return:0 成功

4.设置流数据输出到日志开关:

4.1 功能概括:

提供写入流数据指令到日志文件的开关,默认不写入。

4.2 API ID:

bool setWriteStreamByte(bool isWrite)

4.3 API参数说明:

@param:isWrite 流数据写入日志文件的开关,true:写入,fasle:不写入。

@return:0 成功

5.初始化运动速度阈值:

5.1 功能概括:

gsp运动后优化轨迹,根据运动类型初始化速度阈值。

5.2 API ID:

int gpsInitType(int motionTypeIn)

5.3 API参数说明:

@param:motionTypeIn 运动类型,若输入其他运动类型,会导致无运动轨迹,包括:

户外走路 = 52, 走路 = 1, 徒步 = 4, 运动类型设为0
户外跑步 = 48, 跑步 = 2, 运动类型设为1
户外骑行 = 50, 骑行 = 3, 运动型性设为2

@return:满足运动类型输出结果为1,否则为0。

6.GPS数据实时处理:

6.1 功能概括:

提供处理GPS数据方法,对输出的坐标进行判断。

6.2 API ID:

String gpsAlgProcessRealtime({required String json})

6.3 API参数说明:

@param:json GPS坐标数据,json格式字符串,json key值包括:

lon,经度,数据类型double
lat,纬度,数据类型double
timestamp,时间戳,数据类型int
accuracy,定位精度,数据类型double
gpsaccuracystatus,定位等级,0:定位未知,1:定位好,2:定位差,数据类型int

@return:失败返回null,成功返回json格式字符串,处理后的GPS坐标数据,json key值包括:

lon,经度,数据类型double
lat,纬度,数据类型double
timestamp,时间戳,数据类型int
accuracy,定位精度,数据类型double
gpsaccuracystatus,定位等级,0:定位未知,1:定位好,2:定位差,数据类型int

7.平滑GPS数据集合:

7.1 功能概括:

传入多组GPS坐标,提供平滑GPS数据集合的能力。

7.2 API ID:

String gpsSmoothData({required String json})

7.3 API参数说明:

@param:json GPS坐标数据,json格式字符串,json key值包括:

lat,纬度数组,长度为len,数据类型double
lon,经度数组,长度为len,数据类型double
len,纬度数组和经度数组的组数

@return:失败返回null,成功返回json格式字符串,处理后的GPS坐标数据,json key值包括:

lat,纬度数组,长度为len,数据类型double
lon,经度数组,长度为len,数据类型double
len,纬度数组和经度数组的组数

8.获取log根路径:

8.1 功能概括:

无。

8.2 API ID:

Future<String> logPath() async {
  final pathSDK = await LocalStorage.pathSDKStatic();
  return Future.value('$pathSDK/logs');
}

8.3 API参数说明:

@return:log根路径,字符串。

9.获取alexa根路径:

9.1 功能概括:

无。

9.2 API ID:

Future<String> alexaPath() async {
  final pathSDK = await LocalStorage.pathSDKStatic();
  return Future.value('$pathSDK/alexa');
}

9.3 API参数说明:

@return:alexa根路径,字符串。

10.获取alexa测试路径:

10.1 功能概括:

无。

10.2 API ID:

Future<String> alexaTestPath() async {
  final dirDocument = await getApplicationDocumentsDirectory();
  return Future.value('${dirDocument.path}/alexa_test_pkg');
}

10.3 API参数说明:

@return:alexa测试路径,字符串。

11.获取当前设备缓存根路径:

11.1 功能概括:

无。

11.2 API ID:

Future<String?> currentDevicePath() async {
  return storage?.pathRoot();
}

11.3 API参数说明:

@return:当前设备缓存根路径,字符串。

12.导出日志:

12.1 功能概括:

无。

12.2 API ID:

Future<String?> exportLog() async {
  final pathSDK = await LocalStorage.pathSDKStatic();
  return await compute(_doZip, pathSDK);
}

12.3 API参数说明:

@return: 压缩后日志zip文件绝对路径,字符串。

13.加载指定设备功能表:

13.1 功能概括:

无。

13.2 API ID:

Future<FunctionTableModel?> loadFuncTable(
      {required String macAddress}) async {
    final macAddr = macAddress.replaceAll(':', '').toUpperCase();
    return storage?.loadFunctionTableWith(macAddress: macAddr);
  }

13.3 API参数说明:

@param:macAddress 设备MAC地址,字符串。

@return: 成功返回json格式字符串,失败返回null。

14.加载指定设备功能表:////TODO

14.1 功能概括:

无。

14.2 API ID:

Future<FunctionTableModel?> loadFuncTable(
      {required String macAddress}) async {
    final macAddr = macAddress.replaceAll(':', '').toUpperCase();
    return storage?.loadFunctionTableWith(macAddress: macAddr);
  }

14.3 API参数说明:

@param:macAddress 设备MAC地址,字符串。

@return: 成功返回json格式字符串,失败返回null。////TODO

15.加载指定设备功能表:////TODO

15.1 功能概括:

无。

15.2 API ID:

Future<BaseFunctionTable?> loadFuncTableByDisk(
  {required String macAddress}) async {
  final macAddr = macAddress.replaceAll(':', '').toUpperCase();
  final ft = await storage?.loadFunctionTableWith(macAddress: macAddr);
  logger?.d('loadFuncTableByDisk rs:$ft');
  if (ft == null) return null;
  return BaseFunctionTable()..initFunTableModel(ft);
}

15.3 API参数说明:

@param:macAddress 设备MAC地址,字符串。

@return: 。

16.加载指定设备绑定状态:////TODO

16.1 功能概括:

无。

16.2 API ID:

Future<bool> loadBindStatus({required String macAddress}) async {
    final macAddr = macAddress.replaceAll(':', '').toUpperCase();
    final rs = await storage?.loadBindStatus(macAddress: macAddr);
    return Future(() => rs ?? false);
  }

16.3 API参数说明:

@param:macAddress 设备MAC地址,字符串。

@return: 输入MAC地址对应的绑定状态,bool类型,true:绑定,false:非绑定。

17.查询最后一次连接设备的信息:////TODO

17.1 功能概括:

提供查询最后一次连接的设备的设备信息,包括ota模式,设备名称,uuid(IOS),bt/mac地址,最后更新时间。

17.2 API ID:

Future<DeviceInfoExtModel?> lastConnectDevice() async {
    final list = await storage?.loadDeviceExtListByDisk();
    return Future(() => list?.first);
  }

17.3 API参数说明:

@return: 最后一次连接设备的设备信息,包括:////TODO

final String macAddress;  //mac地址
String? macAddressFull;   //?
bool otaMode = false;     //ota模式?
String uuid;              //uuid(IOS)
String deviceName;        //设备名称
int updateTime;           //最后更新时间 单位毫秒
String? macAddressBt;     //bt地址

String formatTime(int millisecondsSince) {
  return DateTime.fromMicrosecondsSinceEpoch(millisecondsSince).toString();
}

18.查询连接过的设备列表:////TODO

18.1 功能概括:

提供查询连接过的设备列表的能力,包括设备的ota模式,设备名称,uuid(IOS),bt/mac地址,最后更新时间。

18.2 API ID:

Future<List<DeviceInfoExtModel>?> loadDeviceExtListByDisk(
      {bool sortDesc = true}) async {
    return storage?.loadDeviceExtListByDisk(sortDesc: sortDesc);
  }

18.3 API参数说明:

@return: 连接过的设备列表的设备信息,列表中的每个设备信息包括:////TODO

final String macAddress;  //mac地址
String? macAddressFull;   //?
bool otaMode = false;     //ota模式?
String uuid;              //uuid(IOS)
String deviceName;        //设备名称
int updateTime;           //最后更新时间 单位毫秒
String? macAddressBt;     //bt地址

String formatTime(int millisecondsSince) {
  return DateTime.fromMicrosecondsSinceEpoch(millisecondsSince).toString();
}
Copyright © 2023-2024 IDO. All rights reserved. all right reserved,powered by Gitbook修订时间: 2026-04-07 16:03:39

results matching ""

    No results matching ""