Example #1
0
        /// <summary>
        /// Initializes the Telldus library.
        /// This service needs to be initialized before other methods are called.
        /// </summary>
        public void Initialize()
        {
            NativeWrapper.tdInit();

            deviceEvent       = TDDeviceEvent;
            deviceChangeEvent = TDDeviceChangeEvent;
            rawDeviceEvent    = TDRawDeviceEvent;
            sensorEvent       = TDSensorEvent;
            controllerEvent   = TDControllerEvent;

            NativeWrapper.tdRegisterDeviceEvent(deviceEvent, IntPtr.Zero);
            NativeWrapper.tdRegisterDeviceChangeEvent(deviceChangeEvent, IntPtr.Zero);
            NativeWrapper.tdRegisterRawDeviceEvent(rawDeviceEvent, IntPtr.Zero);
            NativeWrapper.tdRegisterSensorEvent(sensorEvent, IntPtr.Zero);
            NativeWrapper.tdRegisterControllerEvent(controllerEvent, IntPtr.Zero);
        }
Example #2
0
 public static extern int tdRegisterDeviceEvent(NativeWrapper.TDDeviceEvent eventFunction, IntPtr context);