Exemplo n.º 1
0
        internal Device(IntPtr devicePtr)
        {
            DevicePtr = devicePtr;
            if (DevicePtr == null)
            {
                throw new ArgumentNullException(nameof(devicePtr), "Device pointer is null");
            }

            _paramChangedFunc = OnParameterChanged;
            var result = device_subscribe_param_changed(DevicePtr, _paramChangedFunc, out _paramChangedListenerPtr, IntPtr.Zero);

            SdkError.ThrowIfError(result);

            _doubleDataReceivedFunc = OnDoubleDataReceived;
            _signalDataReceivedFunc = OnSignalDataReceived;
            _intDataReceivedFunc    = OnIntDataReceived;
        }
Exemplo n.º 2
0
        public Device(DeviceInfo info)
        {
            DevicePtr = create_Device(info);
            if (DevicePtr == null)
            {
                throw new InvalidOperationException(SdkError.LastErrorMessage);
            }

            _paramChangedFunc = OnParameterChanged;
            var result = device_subscribe_param_changed(DevicePtr, _paramChangedFunc, out _paramChangedListenerPtr, IntPtr.Zero);

            SdkError.ThrowIfError(result);

            _doubleDataReceivedFunc = OnDoubleDataReceived;
            _signalDataReceivedFunc = OnSignalDataReceived;
            _intDataReceivedFunc    = OnIntDataReceived;
        }
Exemplo n.º 3
0
 private static extern int device_subscribe_int_channel_data_received(IntPtr devicePtr, ChannelInfo info, DeviceIntDataReceivedFunc callback, out IntPtr outListenerPtr, IntPtr userData);