diff --git a/scheduler/DeviceHandler/Handler.cs b/scheduler/DeviceHandler/Handler.cs index 3fc19abe..7ac633b9 100644 --- a/scheduler/DeviceHandler/Handler.cs +++ b/scheduler/DeviceHandler/Handler.cs @@ -11,23 +11,29 @@ namespace DeviceHandler #region Unmanaged Code - [DllImport("TellUsbD101.dll")] - private static extern bool devTurnOn(int value); + [DllImport("TelldusCore.dll")] + private static extern bool tdTurnOn(int value); - [DllImport("TellUsbD101.dll")] - private static extern bool devTurnOff(int value); + [DllImport("TelldusCore.dll")] + private static extern bool tdTurnOff(int value); - [DllImport("TellUsbD101.dll")] - private static extern int devGetDeviceId(int value); + [DllImport("TelldusCore.dll")] + private static extern bool tdBell(int value); - [DllImport("TellUsbD101.dll")] - private static extern string devGetName(int value); + [DllImport("TelldusCore.dll")] + private static extern int tdGetDeviceId(int value); - [DllImport("TellUsbD101.dll")] - private static extern string devGetVendor(int value); + [DllImport("TelldusCore.dll")] + private static extern string tdGetName(int value); - [DllImport("TellUsbD101.dll")] - private static extern int devGetNumberOfDevices(); + [DllImport("TelldusCore.dll")] + private static extern string tdGetProtocol(int value); + + [DllImport("TelldusCore.dll")] + private static extern int tdGetNumberOfDevices(); + + [DllImport("TelldusCore.dll")] + private static extern int tdClose(); #endregion private List m_Devices = new List(); @@ -50,12 +56,12 @@ namespace DeviceHandler /// True if the command was successfull and false if not. public bool TurnOff(Device item) { - return devTurnOff(item.ID); + return tdTurnOff(item.ID); } public bool TurnOffWithDelay(Device item) { - bool result = devTurnOff(item.ID); + bool result = tdTurnOff(item.ID); System.Threading.Thread.Sleep(1000); return result; } @@ -67,14 +73,33 @@ namespace DeviceHandler /// True if the command was successfull. public bool TurnOn(Device item) { - return devTurnOn(item.ID); + return tdTurnOn(item.ID); } public bool TurnOnWithDelay(Device item) { //Makesure that we halt for 1 second so that the Telldus stick have time to send the signal. - bool result = devTurnOn(item.ID); + bool result = tdTurnOn(item.ID); + System.Threading.Thread.Sleep(1000); + return result; + } + + + /// + /// Sends the bell signal. + /// + /// The device in question. + /// True if the command was successfull. + public bool Bell(Device item) + { + return tdBell(item.ID); + } + + public bool BellWithDelay(Device item) + { + //Makesure that we halt for 1 second so that the Telldus stick have time to send the signal. + bool result = tdBell(item.ID); System.Threading.Thread.Sleep(1000); return result; } @@ -89,15 +114,15 @@ namespace DeviceHandler { m_Devices.Clear(); - int count = devGetNumberOfDevices() - 1; + int count = tdGetNumberOfDevices() - 1; for (int i = 0; i <= count; i++) { //Collect information from the driver. - int deviceID = devGetDeviceId(i); - string deviceName = devGetName(deviceID); - string deviceVendor = devGetVendor(deviceID); + int deviceID = tdGetDeviceId(i); + string deviceName = tdGetName(deviceID); + string deviceProtocol = tdGetProtocol(deviceID); - m_Devices.Add(new Device(deviceID, deviceName, deviceVendor)); + m_Devices.Add(new Device(deviceID, deviceName, deviceProtocol)); } return true; @@ -127,18 +152,18 @@ namespace DeviceHandler { private int m_ID = -1; private string m_Name = ""; - private string m_Vendor = ""; + private string m_Protocol = ""; public Device(SerializationInfo info,StreamingContext cntx) { } - public Device(int id, string name,string vendor) + public Device(int id, string name,string protocol) { m_ID = id; m_Name = name; - m_Vendor = vendor; + m_Protocol = protocol; } public int ID @@ -153,10 +178,10 @@ namespace DeviceHandler set { m_Name = value; } } - public string Vendor + public string Protocol { - get { return m_Vendor; } - set { m_Vendor = value; } + get { return m_Protocol; } + set { m_Protocol = value; } } public override string ToString() diff --git a/scheduler/DeviceHandler/Properties/AssemblyInfo.cs b/scheduler/DeviceHandler/Properties/AssemblyInfo.cs index 6e39202e..44d0571e 100644 --- a/scheduler/DeviceHandler/Properties/AssemblyInfo.cs +++ b/scheduler/DeviceHandler/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Telldus Technologies")] [assembly: AssemblyProduct("DeviceHandler")] -[assembly: AssemblyCopyright("Copyright © Telldus Technologies 2007")] +[assembly: AssemblyCopyright("Copyright © Telldus Technologies 2009")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("2007.1.1.2")] -[assembly: AssemblyFileVersion("2007.1.1.2")] +[assembly: AssemblyVersion("2009.2.0.0")] +[assembly: AssemblyFileVersion("2009.2.0.0")] diff --git a/scheduler/DeviceScheduler/DeviceScheduler.csproj b/scheduler/DeviceScheduler/DeviceScheduler.csproj index ae4f4a27..c08a5e63 100644 --- a/scheduler/DeviceScheduler/DeviceScheduler.csproj +++ b/scheduler/DeviceScheduler/DeviceScheduler.csproj @@ -16,6 +16,9 @@ v2.0 + false + + publish\ true Disk @@ -28,11 +31,8 @@ true 0 1.0.0.%2a - false false true - - true diff --git a/scheduler/DeviceScheduler/Properties/AssemblyInfo.cs b/scheduler/DeviceScheduler/Properties/AssemblyInfo.cs index 8eefc934..4781ad04 100644 --- a/scheduler/DeviceScheduler/Properties/AssemblyInfo.cs +++ b/scheduler/DeviceScheduler/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Telldus Technologies")] [assembly: AssemblyProduct("DeviceScheduler")] -[assembly: AssemblyCopyright("Copyright © Telldus Technologies 2007")] +[assembly: AssemblyCopyright("Copyright © Telldus Technologies 2009")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2007.1.1.2")] -[assembly: AssemblyFileVersion("2007.1.1.2")] +[assembly: AssemblyVersion("2009.2.0.0")] +[assembly: AssemblyFileVersion("2009.2.0.0")] diff --git a/scheduler/DeviceScheduler/frmMain.cs b/scheduler/DeviceScheduler/frmMain.cs index 4c6db8fc..9d6bf60f 100644 --- a/scheduler/DeviceScheduler/frmMain.cs +++ b/scheduler/DeviceScheduler/frmMain.cs @@ -158,7 +158,7 @@ namespace DeviceScheduler { ListViewItem item = lvwCommon.Items.Add(dev.Name,2); item.SubItems.Add(dev.ID.ToString()); - item.SubItems.Add(dev.Vendor); + item.SubItems.Add(dev.Protocol); item.Tag = dev; } } @@ -214,7 +214,7 @@ namespace DeviceScheduler Cursor = Cursors.WaitCursor; System.Diagnostics.Process proc = new System.Diagnostics.Process(); - string filename = System.IO.Path.Combine(path, "TelldusSetup.exe"); + string filename = System.IO.Path.Combine(path, "TelldusCenter.exe"); proc.StartInfo.FileName = filename; proc.StartInfo.WorkingDirectory = path; proc.Start(); diff --git a/scheduler/DeviceScheduler/frmMain.en.resx b/scheduler/DeviceScheduler/frmMain.en.resx index 329594f9..1c13bc08 100644 --- a/scheduler/DeviceScheduler/frmMain.en.resx +++ b/scheduler/DeviceScheduler/frmMain.en.resx @@ -345,7 +345,7 @@ Name - Manufacturer + Protocol diff --git a/scheduler/DeviceScheduler/frmMain.resx b/scheduler/DeviceScheduler/frmMain.resx index 1c9b2bce..c506c66e 100644 --- a/scheduler/DeviceScheduler/frmMain.resx +++ b/scheduler/DeviceScheduler/frmMain.resx @@ -3713,7 +3713,7 @@ 47, 20 - Tillverkare + Protokoll 1 diff --git a/scheduler/DeviceSchedulerAgent/Properties/AssemblyInfo.cs b/scheduler/DeviceSchedulerAgent/Properties/AssemblyInfo.cs index 4a234651..1a4f9af7 100644 --- a/scheduler/DeviceSchedulerAgent/Properties/AssemblyInfo.cs +++ b/scheduler/DeviceSchedulerAgent/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Telldus Technologies")] [assembly: AssemblyProduct("DeviceSchedulerAgent")] -[assembly: AssemblyCopyright("Copyright © Telldus Technologies 2007")] +[assembly: AssemblyCopyright("Copyright © Telldus Technologies 2009")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2007.1.1.2")] -[assembly: AssemblyFileVersion("2007.1.1.2")] +[assembly: AssemblyVersion("2009.2.0.0")] +[assembly: AssemblyFileVersion("2009.2.0.0")]