Skip to content

Configuring

jyong15 edited this page Oct 14, 2021 · 4 revisions

Configuring

The recommended way of configuring a Shimmer devices is via the use of the Bluetooth Manager using clone devices The following are the recommended steps:

  1. Clone the Shimmer device – Note: a clone is a virtual copy of the Shimmer which you can freely configure without affecting the physical device.
  2. Configure the clone using “set” methods
  3. Generate a Shimmer config for the clone using: AssembleShimmerConfig.generateSingleShimmerConfig();
  4. Write the settings back from the clone to the physical Shimmer device using:
BluetoothManagerAndroid.configureShimmer(clone);

Please see the code below for an example of this:

//Step 1)
Shimmer clone = (Shimmer) shimmer.deepClone();  
//Step 2)
clone.setSensorEnabledState(Configuration.Shimmer3.SENSOR_ID.SHIMMER_ANALOG_ACCEL, true);
clone.setSensorEnabledState(Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM303_ACCEL, true);
clone.setSensorEnabledState(Configuration.Shimmer3.SENSOR_ID.SHIMMER_MPU9X50_GYRO, false);
clone.setSensorEnabledState(Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM303_MAG, false);
clone.setShimmerAndSensorsSamplingRate(512);
clone.setAccelRange(1);
//Step 3)
AssembleShimmerConfig.generateSingleShimmerConfig(clone, Configuration.COMMUNICATION_TYPE.BLUETOOTH);
//Step 4)
btManager.configureShimmer(clone);

Disabling all device sensors

See below for an example on how to disable all sensors on a Shimmer device.

Integer[] sensorsIDsEnabled = {};
shimmer.setSensorIdsEnabled(sensorsIDsEnabled);

Available configuration options

The available configuration options are stored in a map in the ShimmerDevice class.

shimmer.getConfigOptionsMap();

The available config values and their corresponding mapping to GUI values can be found by inspecting the mConfigValues and mGuiValues variables inside each of the map's values (ConfigOptionDetailsSensor).