‪Black Box
Program.cs
Go to the documentation of this file.
1 /*
2 * FILE : program.cs
3 * PROJECT : Black Box
4 * PROGRAMMER : BRIAN HINDS
5 * FIRST VERSION : 1.0.0.0
6 * DESCRIPTION : This file is the main program for the BBThermostatSensor.
7 */
8 
10 using System.Threading;
11 
12 /*
13  *
14  * Thermostat Architecture
15  *
16  *
17 Conestoga College
18 
19 Copyright (c) 2019, Brian Hinds
20 
21 Permission is hereby granted, free of charge, to any person obtaining a copy
22 of this software and associated documentation files (the "Software"), to deal
23 in the Software without restriction, including without limitation the rights
24 to use, copy, modify, merge, publish, distribute, sub-license, and/or sell
25 copies of the Software, and to permit persons to whom the Software is
26 furnished to do so, subject to the following conditions:
27 
28 The above copyright notice and this permission notice shall be included in all
29 copies or substantial portions of the Software.
30 
31 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37 SOFTWARE.
38 */
39 
41 {
42  internal class ‪Program
43  {
44  private const int ‪timerInerval = 60000;
45 
50  public static void ‪Tick(object stateInfo)
51  {
53  }
54 
59  private static void ‪Main(string[] args)
60  {
61  TimerCallback callback = new TimerCallback(‪Tick);
62 
63  // create a one second timer tick
64  System.Threading.Timer stateTimer = new System.Threading.Timer(callback, null, 0, ‪timerInerval);
65 
66  // loop here forever
67  for (; ; )
68  {
69  // add a sleep for 100 mSec to reduce CPU usage
70  Thread.Sleep(100);
71  }
72  }
73  }
74 }
‪static void BBThermosataCheck()
‪Get thermostat data and encrypt
‪const int timerInerval
Definition: Program.cs:44
‪static void Tick(object stateInfo)
‪This method executes the thermostat data request on 10 sec interval
Definition: Program.cs:50
‪static void Main(string[] args)
‪this is the main method for the BBthermostatSensor
Definition: Program.cs:59