0

I am using this sample code given by Movesense code link

I am using this command to get perameter using an ADB command in Android Studio.

adb.exe shell am broadcast -a "android.intent.action.MOVESENSE" --es type get --es path Sample/SensorOutput/Config --es value '''{}'''

I got following out put from above command in Android Studio

2023-03-24 14:46:21.354 6471-6501/com.movesense.showcaseapp I/Komposti: [SDS RESPONSE] type: GET status: OK header: {"TaskId": 44, "Content-Type": "application/json", "Uri": "suunto://223130000601/Sample/SensorOutput/Config", "Content-Length": 64, "Reason": "OK", "Status": 200} body: {"Content": {"path": "UNKNOWN", "period": 20, "sampleRate": 13}}

Getting Successful Response but When I try to set a new parameter using an ADB command, I'm unable to do so.

adb.exe shell am broadcast -a "android.intent.action.MOVESENSE" --es type put --es path Sample/SensorOutput/Config --es value '{"config": {"path": "UNKNOWN", "period": 60, "sampleRate": 100}}'

got this error:

2023-03-24 14:49:49.772 6471-6503/com.movesense.showcaseapp E/Komposti: [SDS RESPONSE] type: PUT status: BAD_REQUEST header: {"TaskId": 46, "Uri": "suunto://223130000601/Sample/SensorOutput/Config", "Content-Length": 0, "Reason": "BAD_REQUEST", "Status": 400} error: expected '"' in object, got 'c' (99) 2023-03-24 14:49:49.773 6471-6503/com.movesense.showcaseapp D/MdsOperationHandler: SDSInternalCallback with call type: 4 header: {"TaskId": 46, "Uri": "suunto://223130000601/Sample/SensorOutput/Config", "Content-Length": 0, "Reason": "BAD_REQUEST", "Status": 400} 2023-03-24 14:49:49.778 6471-6471/com.movesense.showcaseapp E/AdbBridge: onError() put com.movesense.mds.MdsException: Failed status: 400, reason: BAD_REQUEST at com.movesense.mds.internal.operation.MdsRestOperation.onResponse(MdsRestOperation.java:81) at com.movesense.mds.internal.operation.MdsResponseOperation.protectedRun(MdsResponseOperation.java:26) at com.movesense.mds.internal.workqueue.QueueOperation.run(QueueOperation.java:70) at com.movesense.mds.internal.workqueue.WorkQueueImpl.runOperation(WorkQueueImpl.java:79) at com.movesense.mds.internal.workqueue.WorkQueueImpl$1.run(WorkQueueImpl.java:30) at java.lang.Thread.run(Thread.java:1012)

here is yaml file link SensorsOutputSample.yaml

here is c++ file link SensorOutputService.cpp

I am expecting. How can I put a new value in a particular path using the ADB command? I want to make a similar custom example that also set custom parameters in OnPutReqest.

1 Answers1

0

The reason is probably that you are trying to PUT the config with path "UNKNOWN" when the c++ code you linked has the requirement that the path must be one of: "MEAS_ACC", "MEAS_GYRO", "MEAS_MAGN".

PetriL
  • 1,211
  • 1
  • 7
  • 11