Reputation: 543
I have Sensors from them i want to Display the Data of the Sensor(Accelorometer, Gyroscope, Magnetometer) and log that recorded data.
From the Documentation I see following PUT and GET Requests that I need to perform. I also have a Example but that is written in java but I'm not familiar with Java.
PUT /Mem/DataLogger/Config that lists paths that you want to log. In my case they would be /Meas/IMU9/104 and /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.
For all that i need the http Plugin. I started with creating Final String's for the Entries.
My current Code looks like:
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();
}
}
Upvotes: 2
Views: 174
Reputation: 1299
First, the GET & PUT are not HTTP calls (so no HTTP plugin), but calls in MDS library. Please check the latest mdsflutter plugin and the example within.
Full disclosure: I work for the Movesense team
Upvotes: 0