예제 #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;
        }
예제 #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;
        }
예제 #3
0
 private static extern int device_subscribe_double_channel_data_received(IntPtr devicePtr, ChannelInfo info, DeviceDoubleDataReceivedFunc callback, out IntPtr outListenerPtr, IntPtr userData);