movesense可以设置dataloggerconfig获取错误400

发布于 2025-01-27 08:32:49 字数 3967 浏览 3 评论 0原文

我正在尝试将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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千秋岁 2025-02-03 08:32:49

配置JSON对象应该看起来像这样:

        '{ "config": { "dataEntries" : { "dataEntry" : [{ "path" : "/Meas/HR" }] }}}'

或用于ACC和Gyro:

        '{ "config": { "dataEntries" : { "dataEntry" : [{ "path" : "/Meas/Acc/13" }, { "path" : "/Meas/Gyro/13" }] }}}'

The config json object should look like this:

        '{ "config": { "dataEntries" : { "dataEntry" : [{ "path" : "/Meas/HR" }] }}}'

or this for Acc and Gyro:

        '{ "config": { "dataEntries" : { "dataEntry" : [{ "path" : "/Meas/Acc/13" }, { "path" : "/Meas/Gyro/13" }] }}}'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文