/// <summary>
        /// Called when the Myo sends a <see cref="MyoEventType.Rssi"/> event.
        /// </summary>
        /// <param name="evt">The pointer to the event.</param>
        /// <param name="timestamp">The timestamp of the event.</param>
        protected virtual void OnRssi(IntPtr evt, DateTime timestamp)
        {
            var handler = Rssi;

            if (handler != null)
            {
                var rssi = _myoDeviceDriver.GetEventRssi(evt);
                var args = new RssiEventArgs(
                    this,
                    timestamp,
                    rssi);
                handler.Invoke(this, args);
            }
        }
Example #2
0
        /// <summary>
        /// Called when the Myo sends a <see cref="MyoEventType.Rssi"/> event.
        /// </summary>
        /// <param name="evt">The pointer to the event.</param>
        /// <param name="timestamp">The timestamp of the event.</param>
        protected virtual void OnRssi(IntPtr evt, DateTime timestamp)
        {
            // Contract.Requires<ArgumentException>(evt != IntPtr.Zero, "The event handle must be set.");

            var handler = Rssi;

            if (handler != null)
            {
                var rssi = _myoDeviceDriver.GetEventRssi(evt);
                var args = new RssiEventArgs(
                    this,
                    timestamp,
                    rssi);
                handler.Invoke(this, args);
            }
        }