2

我有来自他们的传感器,我想显示传感器的数据(加速度计、陀螺仪、磁力计)并记录记录的数据。

从文档中,我看到了我需要执行的以下 PUT 和 GET 请求。我也有一个示例,但它是用 java 编写的,但我不熟悉 Java。

PUT /Mem/DataLogger/Config 列出您要记录的路径。在我的情况下,它们将是 /Meas/IMU9/104 和 /Meas/Temp。

PUT /Mem/DataLogger/State to 3 (=LOGGING)
PUT /Mem/DataLogger/State to 2 (=READY)
GET "suunto:/MDS/Logbook/{serial}/Entries" on mobile to have a list of entries on the sensors datamemory. The one with biggest LogID is the one you just recorded
GET "suunto:/MDS/Logbook/{serial}/byId/{LogId}/Data" on mobile to get the recording as JSON.

对于所有我需要的 http 插件。我开始为条目创建最终字符串。

我当前的代码如下所示:

import 'package:flutter/material.dart';
import 'package:http/http.dart';
import 'package:mdsflutter/Mds.dart';

class DataLoggerActivity extends StatefulWidget {
  final String URI_MDS_LOGBOOK_ENTRIES = "suunto://MDS/Logbook/{0}/Entries";
  final String URI_MDS_LOGBOOK_DATA = "suunto://MDS/Logbook/{0}/ById/{1}/Data";

  final String URI_LOGBOOK_ENTRIES = "suunto://{0}/Mem/Logbook/Entries";
  final String URI_DATALOGGER_STATE = "suunto://{0}/Mem/DataLogger/State";
  final String URI_DATALOGGER_CONFIG = "suunto://{0}/Mem/DataLogger/Config";


  @override
  _DataLoggerActivityState createState() => _DataLoggerActivityState();
}

class _DataLoggerActivityState extends State<DataLoggerActivity> {
  @override
  Widget build(BuildContext context) {
    return Container();
  }
}

4

0 回答 0