/**
     * <summary> A new BiopluxFrame is received here as a json</summary>
     *
     * <param name="frame">Frame containing data acquired from the multiple active sensors/channels
     * of the PLUX device under use.</param>
     */
    public void onDataAvailable(string frame)
    {
        BiopluxFrame bFrame = JsonUtility.FromJson <BiopluxFrame>(frame);

        if (OnDataEvent != null)
        {
            OnDataEvent(bFrame);
        }
    }
    /*
     * ====================================================== Callbacks ============================================================
     */

    /**
     * <summary>Callback invoked when a new package of data is communicated by PLUX device and reaches the Android system.</summary>
     * <param name="frame">Package of data containing the RAW values returned by each active channel.</param>
     */
    private void OnNewDataEvent(BiopluxFrame frame)
    {
        //show the values for sensor/channel 1 - Examples
        valueTextProperty.Value = frame.analogData[0].ToString();

        if (BarScript.Instance == null)
        {
            return;
        }

        // Update widget value/state.
        BarScript.Instance.Value = frame.analogData[0];
    }