I'm trying to configure the TapParams of the LSM6DS3 through Showcase App's AdbBridge feature.
I have no problems reading the current config with
.\adb.exe shell am broadcast -a "android.intent.action.MOVESENSE" --es type get --es path Component/LSM6DS3/TapParams --es value '''{}'''
But when I try to write back my config (even the one I got with the previous command) with
.\adb.exe shell am broadcast -a "android.intent.action.MOVESENSE" --es type put --es path Component/LSM6DS3/TapParams --es value '''{\"doubleTapDur\": 0, \"doubleTapQuiet\": 0, \"tapThs\": 2, \"axes\": 0}'''
I get this error on logcat
2021-06-14 16:48:42.735 22813-22813/com.movesense.showcaseapp E/AdbBridge: onError()
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:760)
What's wrong with my request?
The LSM6DS API defines a put parameter with name "newParams". So your object needs to provide the correct name like this (just like when calling from code using MDS):
{\"newParams\":{\"doubleTapDur\": 0, \"doubleTapQuiet\": 0, \"tapThs\": 2, \"axes\": 0}}
Full disclosure: I work for the Movesense team