movesense可以设置dataloggerconfig获取错误400
我正在尝试将Datalogger配置设置为开始测量,但要获得错误400。 没有问题阅读config或启动Datalogger。但是由于设置配置不起作用,因此没有任何存储。我正在使用与本机Java代码的颤动与Movesens API通信。请这里有什么问题?
此软件包不是直接使用的,但该部分完全来自此软件包: https://gitlab.com/bluesquall/movesense_flutter_flutter
static Future<String> setDataLoggerConfiguration(HRBandDevice device) async {
const String configJsonString = '{"dataEntries": {"dataEntry": [{"path": "/Meas/Acc/13"}, {"path": "/Meas/Gyro/13"}]}}';
final String response = await _wb.invokeMethod('put', {
'path': 'suunto://${device.serial}/Mem/DataLogger/Config',
'contract': configJsonString,
});
return response;
}
String contract = call.argument("contract");
Log.d(TAG, String.format("PUT %s : %s", path, contract));
mMds.put(path, contract,
new MdsResponseListener() {
@Override
public void onSuccess(String data) {
Log.d(TAG, String.format("PUT received whiteboard response of type %s:", data.getClass().getName()));
Log.d(TAG, data);
result.success(data);
}
@Override
public void onError(MdsException e) {
Log.e(TAG, "PUT returned error:" + e);
result.error(String.format("%d", e.getStatusCode()), "MdsException", e.getMessage() + String.format(", path: %s, contract: %s", path, contract));
}
} // MdsResponseListener
); // mds.put
break;
D/MainActivity(19266): operation: put, path: suunto://204730000534/Mem/DataLogger/Config
D/MainActivity(19266): PUT suunto://204730000534/Mem/DataLogger/Config : {"dataEntries": {"dataEntry": [{"path": "/Meas/Acc/13"}, {"path": "/Meas/Gyro/13"}]}}
D/Mds (19266): Mds put() uri: suunto://204730000534/Mem/DataLogger/Config contract: {"dataEntries": {"dataEntry": [{"path": "/Meas/Acc/13"}, {"path": "/Meas/Gyro/13"}]}}
I/Komposti(19266): [SDS REQUEST] type: PUT uri: suunto://204730000534/Mem/DataLogger/Config contract: {"dataEntries": {"dataEntry": [{"path": "/Meas/Acc/13"}, {"path": "/Meas/Gyro/13"}]}}
D/BleManager(19266): sendCb(1000000e), 13 bytes
D/BleManager(19266): Send complete
D/BleManager(19266): Received data: WB_DATAMSG_CLIENT_ON_PUT_RESULT, type: 7, direct msg, msgLen: 10, reqId: 5377, size: 16
E/Komposti(19266): [SDS RESPONSE] type: PUT status: BAD_REQUEST header: {"TaskId": 156, "Uri": "suunto://204730000534/Mem/DataLogger/Config", "Content-Length": 0, "Reason": "[wb] Operation failed", "Status": 400}
D/MdsOperationHandler(19266): SDSInternalCallback with call type: 4 header: {"TaskId": 156, "Uri": "suunto://204730000534/Mem/DataLogger/Config", "Content-Length": 0, "Reason": "[wb] Operation failed", "Status": 400}
E/MainActivity(19266): PUT returned error:com.movesense.mds.MdsException: Failed status: 400, reason: [wb] Operation failed
E/flutter (19266): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(400, MdsException, Failed status: 400, reason: [wb] Operation failed, path: suunto://204730000534/Mem/DataLogger/Config, contract: {"dataEntries": {"dataEntry": [{"path": "/Meas/Acc/13"}, {"path": "/Meas/Gyro/13"}]}}, null)
I'm trying to set DataLogger Config to start measuring but get error 400.
Don't have problems reading config or starting DataLogger. But since setting config doesn't work there is nothing to store. I'm using Flutter with native Java code to communicate with Movesens API. Please what is the issue here?
This package isn't used directly but this part is exactly from this package:
https://gitlab.com/bluesquall/movesense_flutter
static Future<String> setDataLoggerConfiguration(HRBandDevice device) async {
const String configJsonString = '{"dataEntries": {"dataEntry": [{"path": "/Meas/Acc/13"}, {"path": "/Meas/Gyro/13"}]}}';
final String response = await _wb.invokeMethod('put', {
'path': 'suunto://${device.serial}/Mem/DataLogger/Config',
'contract': configJsonString,
});
return response;
}
String contract = call.argument("contract");
Log.d(TAG, String.format("PUT %s : %s", path, contract));
mMds.put(path, contract,
new MdsResponseListener() {
@Override
public void onSuccess(String data) {
Log.d(TAG, String.format("PUT received whiteboard response of type %s:", data.getClass().getName()));
Log.d(TAG, data);
result.success(data);
}
@Override
public void onError(MdsException e) {
Log.e(TAG, "PUT returned error:" + e);
result.error(String.format("%d", e.getStatusCode()), "MdsException", e.getMessage() + String.format(", path: %s, contract: %s", path, contract));
}
} // MdsResponseListener
); // mds.put
break;
D/MainActivity(19266): operation: put, path: suunto://204730000534/Mem/DataLogger/Config
D/MainActivity(19266): PUT suunto://204730000534/Mem/DataLogger/Config : {"dataEntries": {"dataEntry": [{"path": "/Meas/Acc/13"}, {"path": "/Meas/Gyro/13"}]}}
D/Mds (19266): Mds put() uri: suunto://204730000534/Mem/DataLogger/Config contract: {"dataEntries": {"dataEntry": [{"path": "/Meas/Acc/13"}, {"path": "/Meas/Gyro/13"}]}}
I/Komposti(19266): [SDS REQUEST] type: PUT uri: suunto://204730000534/Mem/DataLogger/Config contract: {"dataEntries": {"dataEntry": [{"path": "/Meas/Acc/13"}, {"path": "/Meas/Gyro/13"}]}}
D/BleManager(19266): sendCb(1000000e), 13 bytes
D/BleManager(19266): Send complete
D/BleManager(19266): Received data: WB_DATAMSG_CLIENT_ON_PUT_RESULT, type: 7, direct msg, msgLen: 10, reqId: 5377, size: 16
E/Komposti(19266): [SDS RESPONSE] type: PUT status: BAD_REQUEST header: {"TaskId": 156, "Uri": "suunto://204730000534/Mem/DataLogger/Config", "Content-Length": 0, "Reason": "[wb] Operation failed", "Status": 400}
D/MdsOperationHandler(19266): SDSInternalCallback with call type: 4 header: {"TaskId": 156, "Uri": "suunto://204730000534/Mem/DataLogger/Config", "Content-Length": 0, "Reason": "[wb] Operation failed", "Status": 400}
E/MainActivity(19266): PUT returned error:com.movesense.mds.MdsException: Failed status: 400, reason: [wb] Operation failed
E/flutter (19266): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(400, MdsException, Failed status: 400, reason: [wb] Operation failed, path: suunto://204730000534/Mem/DataLogger/Config, contract: {"dataEntries": {"dataEntry": [{"path": "/Meas/Acc/13"}, {"path": "/Meas/Gyro/13"}]}}, null)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
配置JSON对象应该看起来像这样:
或用于ACC和Gyro:
The config json object should look like this:
or this for Acc and Gyro: