Skip to content

Streaming

ShimmerEngineering edited this page Mar 29, 2024 · 6 revisions

Streaming

Packet Reception Rate

There are two ways to retrieve the packet reception rate one is via the object cluster:-

Collection<FormatCluster> allFormatsPRR = objectCluster.getCollectionOfFormatClusters(Configuration.Shimmer3.ObjectClusterSensorName.PACKET_RECEPTION_RATE_OVERALL);
FormatCluster prrCluster = ((FormatCluster)ObjectCluster.returnFormatCluster(allFormatsPRR,"CAL"));
double PRR = prrCluster.mData;
Log.i(LOG_TAG, "Packet Reception Rate: " + PRR);

the second way is through the use of the method getPacketReceptionRateOverall

Efficient Data Array Example

This example is only applicable for Shimmer3 devices onwards. Its main purpose is to demonstrate settings for optimal packet reception rate on lower-end Android devices.

It demonstrates the use of the following:

  • New arrays data structure - Switching to using the new arrays data structure reduces the processing load on the Android device, which can benefit packet reception rate, especially on older devices. This example demonstrates how to enable the arrays data structure and retrieve data from it.
  • Disabling PC Timestamps - This improves performance on Android devices, at the cost of slightly less accurate timestamps. When this is disabled, the timestamps will be taken on each full packet received, rather than on each byte received.
  • CSV file writing

Note that the performance benefits from the above will only be apparent on lower-end or older Android devices.

Note that there is currently a delay, typically between 5-12 seconds, between receiving the "Device ABCD ready for streaming" Toast message in the Handler and the Shimmer device being actually ready for streaming.

Clone this wiki locally