Showing preview only (3,821K chars total). Download the full file or copy to clipboard to get everything.
Repository: MSOpenTech/connectthedots
Branch: master
Commit: fd72e90a2962
Files: 407
Total size: 3.5 MB
Directory structure:
gitextract_ovnh2m6b/
├── .deployment
├── .gitattributes
├── .gitignore
├── .gitmodules
├── Azure/
│ ├── ARMTemplate/
│ │ ├── CustomizeTemplate.md
│ │ ├── Readme.md
│ │ └── azuredeploy.json
│ ├── EHConsole/
│ │ ├── EHConsole/
│ │ │ ├── App.config
│ │ │ ├── Microsoft.ConnectTheDots.EHConsole.csproj
│ │ │ ├── Program.cs
│ │ │ ├── Properties/
│ │ │ │ └── AssemblyInfo.cs
│ │ │ └── packages.config
│ │ ├── EHConsole.sln
│ │ └── nuget.config
│ ├── MachineLearning/
│ │ ├── MachineLearningCloudService.md
│ │ ├── SQL/
│ │ │ ├── SQL.sqlproj
│ │ │ ├── StoredProcedures/
│ │ │ │ └── InsertAlertsData.sql
│ │ │ ├── TableType/
│ │ │ │ └── AlertsDataTableType.sql
│ │ │ └── Tables/
│ │ │ └── AlertsData.sql
│ │ ├── WorkerHost/
│ │ │ ├── Analyzer.cs
│ │ │ ├── AnomalyRecord.cs
│ │ │ ├── App.config
│ │ │ ├── CircularBuffer.cs
│ │ │ ├── Data.Outputs/
│ │ │ │ ├── BlobWriter.cs
│ │ │ │ ├── SQLOutputRepository.cs
│ │ │ │ └── Utils/
│ │ │ │ └── SqlDBReaderSafeParser.cs
│ │ │ ├── EventHubReader.cs
│ │ │ ├── Program.cs
│ │ │ ├── Properties/
│ │ │ │ └── AssemblyInfo.cs
│ │ │ ├── SensorDataContract.cs
│ │ │ ├── WorkerHost.csproj
│ │ │ └── packages.config
│ │ ├── WorkerHost.sln
│ │ └── WorkerRole/
│ │ ├── ServiceConfiguration.Cloud.cscfg
│ │ ├── ServiceConfiguration.Local.cscfg
│ │ ├── ServiceDefinition.csdef
│ │ ├── WorkerHostContent/
│ │ │ └── diagnostics.wadcfgx
│ │ └── WorkerRole.ccproj
│ ├── PowerBI/
│ │ └── PBI_setup.md
│ ├── StreamAnalyticsQueries/
│ │ ├── Aggregates.sql
│ │ ├── Alert.sql
│ │ ├── HumidityAlert.sql
│ │ ├── LightSensor.sql
│ │ ├── SA_setup.md
│ │ └── cg4pbi.sql
│ └── WebSite/
│ ├── WebsiteDetails.md
│ ├── WebsitePublish.md
│ ├── site/
│ │ ├── Default.aspx
│ │ ├── Docs/
│ │ │ └── license.txt
│ │ ├── Global.asax
│ │ ├── Web.config
│ │ ├── css/
│ │ │ └── connectthedots.css
│ │ ├── js/
│ │ │ ├── d3CTD.js
│ │ │ ├── d3CTDDataSourceFilter.js
│ │ │ ├── d3CTDDataSourceSocket.js
│ │ │ ├── d3Chart.js
│ │ │ ├── d3ChartControl.js
│ │ │ ├── d3DataFlow.js
│ │ │ ├── d3DataSourceSocket.js
│ │ │ ├── d3utils.js
│ │ │ ├── devicesList.js
│ │ │ ├── jquery.ui-contextmenu.js
│ │ │ └── qrcode.js
│ │ └── packages.config
│ └── source/
│ ├── ConnectTheDotsWebSite/
│ │ ├── ConnectTheDotsWebSite.csproj
│ │ ├── Default.aspx
│ │ ├── Default.aspx.cs
│ │ ├── Default.aspx.designer.cs
│ │ ├── Docs/
│ │ │ └── license.txt
│ │ ├── Global.asax
│ │ ├── Global.asax.cs
│ │ ├── Helpers/
│ │ │ ├── BlobHelper.cs
│ │ │ └── IoTHubHelper.cs
│ │ ├── Properties/
│ │ │ ├── AssemblyInfo.cs
│ │ │ └── PublishProfiles/
│ │ │ └── LocalDeploy.pubxml
│ │ ├── SensorInventory.cs
│ │ ├── Web.Debug.config
│ │ ├── Web.PublishTemplate.config
│ │ ├── Web.Release.config
│ │ ├── Web.config
│ │ ├── WebSocketEventProcessor.cs
│ │ ├── WebSocketHandler.cs
│ │ ├── css/
│ │ │ └── connectthedots.css
│ │ ├── js/
│ │ │ ├── d3CTD.js
│ │ │ ├── d3CTDDataSourceFilter.js
│ │ │ ├── d3CTDDataSourceSocket.js
│ │ │ ├── d3Chart.js
│ │ │ ├── d3ChartControl.js
│ │ │ ├── d3DataFlow.js
│ │ │ ├── d3DataSourceSocket.js
│ │ │ ├── d3utils.js
│ │ │ ├── devicesList.js
│ │ │ ├── jquery.ui-contextmenu.js
│ │ │ └── qrcode.js
│ │ └── packages.config
│ └── ConnectTheDotsWebSite.sln
├── Contribute.md
├── Devices/
│ ├── DirectlyConnectedDevices/
│ │ ├── Common/
│ │ │ ├── csharp/
│ │ │ │ └── ConnectTheDotsHelper.cs
│ │ │ └── javascript/
│ │ │ ├── connectthedots.js
│ │ │ ├── package.json
│ │ │ └── readme.md
│ │ ├── ESP8266/
│ │ │ ├── ESP8266_setup.md
│ │ │ └── connect_the_dots/
│ │ │ ├── connect_the_dots.cpp
│ │ │ ├── connect_the_dots.h
│ │ │ └── connect_the_dots.ino
│ │ ├── NodeJS/
│ │ │ ├── BeagleBoneBlack/
│ │ │ │ ├── BeagleBone_Black_setup.md
│ │ │ │ ├── Hardware.md
│ │ │ │ ├── beagleboneblackctd.js
│ │ │ │ ├── package.json
│ │ │ │ └── settings.json
│ │ │ ├── Desktop/
│ │ │ │ ├── Desktop_setup.md
│ │ │ │ ├── desktop.js
│ │ │ │ ├── package.json
│ │ │ │ └── settings.json
│ │ │ ├── IntelEdisonGrove/
│ │ │ │ ├── Hardware.md
│ │ │ │ ├── Intel_Edison_setup.md
│ │ │ │ ├── inteledisonctd.js
│ │ │ │ ├── package.json
│ │ │ │ └── settings.json
│ │ │ ├── IntelEdisonSensorTag/
│ │ │ │ ├── Hardware.md
│ │ │ │ ├── Intel_Edison_setup.md
│ │ │ │ ├── inteledisonsensortagctd.js
│ │ │ │ ├── lib/
│ │ │ │ │ ├── cc2540.js
│ │ │ │ │ ├── cc2650.js
│ │ │ │ │ ├── common.js
│ │ │ │ │ └── sensortag.js
│ │ │ │ ├── package.json
│ │ │ │ └── settings.json
│ │ │ ├── IntelEdisonXadow/
│ │ │ │ ├── Hardware.md
│ │ │ │ ├── Intel_Edison_setup.md
│ │ │ │ ├── inteledisonctd.js
│ │ │ │ ├── package.json
│ │ │ │ └── settings.json
│ │ │ ├── SensorTag/
│ │ │ │ ├── Setup.md
│ │ │ │ ├── index.js
│ │ │ │ ├── package.json
│ │ │ │ ├── sensorWorker.js
│ │ │ │ └── settings.json
│ │ │ └── Tessel2/
│ │ │ ├── Hardware.md
│ │ │ ├── Tessel2_setup.md
│ │ │ ├── package.json
│ │ │ ├── settings.json
│ │ │ └── tessel2ctd.js
│ │ ├── UWPMSBand/
│ │ │ ├── UWPMSBand/
│ │ │ │ ├── App.xaml
│ │ │ │ ├── App.xaml.cs
│ │ │ │ ├── MainPage.xaml
│ │ │ │ ├── MainPage.xaml.cs
│ │ │ │ ├── Package.appxmanifest
│ │ │ │ ├── Properties/
│ │ │ │ │ ├── AssemblyInfo.cs
│ │ │ │ │ └── Default.rd.xml
│ │ │ │ ├── UWPMSBand.csproj
│ │ │ │ ├── UWPMSBand_TemporaryKey.pfx
│ │ │ │ ├── project.json
│ │ │ │ └── project.lock.json
│ │ │ └── UWPMSBand.sln
│ │ ├── UWPSimulatedSensors/
│ │ │ ├── UWPSimulatedSensors/
│ │ │ │ ├── App.xaml
│ │ │ │ ├── App.xaml.cs
│ │ │ │ ├── ApplicationInsights.config
│ │ │ │ ├── MainPage.xaml
│ │ │ │ ├── MainPage.xaml.cs
│ │ │ │ ├── Package.appxmanifest
│ │ │ │ ├── Properties/
│ │ │ │ │ ├── AssemblyInfo.cs
│ │ │ │ │ └── Default.rd.xml
│ │ │ │ ├── UWPSimulatedSensors.csproj
│ │ │ │ ├── UWPSimulatedSensors_TemporaryKey.pfx
│ │ │ │ ├── project.json
│ │ │ │ └── project.lock.json
│ │ │ └── UWPSimulatedSensors.sln
│ │ └── XamarinSimulatedSensors/
│ │ ├── XamarinSimulatedSensors/
│ │ │ ├── XamarinSimulatedSensors/
│ │ │ │ ├── Helpers/
│ │ │ │ │ └── Settings.cs
│ │ │ │ ├── MyClass.cs
│ │ │ │ ├── Properties/
│ │ │ │ │ └── AssemblyInfo.cs
│ │ │ │ ├── XamarinSimulatedSensors.csproj
│ │ │ │ ├── app.config
│ │ │ │ └── packages.config
│ │ │ ├── XamarinSimulatedSensors.Droid/
│ │ │ │ ├── Assets/
│ │ │ │ │ └── AboutAssets.txt
│ │ │ │ ├── Helpers/
│ │ │ │ │ └── Settings.cs
│ │ │ │ ├── MainActivity.cs
│ │ │ │ ├── Properties/
│ │ │ │ │ ├── AndroidManifest.xml
│ │ │ │ │ └── AssemblyInfo.cs
│ │ │ │ ├── Resources/
│ │ │ │ │ ├── AboutResources.txt
│ │ │ │ │ ├── Resource.designer.cs
│ │ │ │ │ ├── layout/
│ │ │ │ │ │ └── Main.axml
│ │ │ │ │ └── values/
│ │ │ │ │ └── Strings.xml
│ │ │ │ ├── XamarinSimulatedSensors.Droid.csproj
│ │ │ │ ├── app.config
│ │ │ │ └── packages.config
│ │ │ ├── XamarinSimulatedSensors.Windows/
│ │ │ │ ├── App.config
│ │ │ │ ├── Form1.Designer.cs
│ │ │ │ ├── Form1.cs
│ │ │ │ ├── Form1.resx
│ │ │ │ ├── Helpers/
│ │ │ │ │ └── Settings.cs
│ │ │ │ ├── Program.cs
│ │ │ │ ├── Properties/
│ │ │ │ │ ├── AssemblyInfo.cs
│ │ │ │ │ ├── Resources.Designer.cs
│ │ │ │ │ ├── Resources.resx
│ │ │ │ │ ├── Settings.Designer.cs
│ │ │ │ │ └── Settings.settings
│ │ │ │ ├── XamarinSimulatedSensors.Windows.csproj
│ │ │ │ └── packages.config
│ │ │ └── XamarinSimulatedSensors.iOS/
│ │ │ ├── AppDelegate.cs
│ │ │ ├── Entitlements.plist
│ │ │ ├── Helpers/
│ │ │ │ └── Settings.cs
│ │ │ ├── Info.plist
│ │ │ ├── Main.cs
│ │ │ ├── Main.storyboard
│ │ │ ├── Resources/
│ │ │ │ ├── ITunesArtwork
│ │ │ │ ├── ITunesArtwork@2x
│ │ │ │ ├── Images.xcassets/
│ │ │ │ │ ├── AppIcons.appiconset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── Images.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ └── LaunchImage.launchimage/
│ │ │ │ │ └── Contents.json
│ │ │ │ └── LaunchScreen.storyboard
│ │ │ ├── ViewController.cs
│ │ │ ├── ViewController.designer.cs
│ │ │ ├── XamarinSimulatedSensors.iOS.csproj
│ │ │ ├── app.config
│ │ │ └── packages.config
│ │ └── XamarinSimulatedSensors.sln
│ ├── GatewayConnectedDevices/
│ │ ├── Arduino DUE/
│ │ │ └── Temperature/
│ │ │ └── DS18B20/
│ │ │ ├── DS18B20.ino
│ │ │ └── Libraries.md
│ │ ├── Arduino UNO/
│ │ │ ├── Accelerometer/
│ │ │ │ └── Memsic2125Json/
│ │ │ │ ├── Libraries.md
│ │ │ │ └── Memsic2125Json.ino
│ │ │ ├── AnalogReadSerial/
│ │ │ │ └── AnalogReadSerial.ino
│ │ │ ├── Combo_accelerometer_and_temperature/
│ │ │ │ └── Memsic2125_plus_DS18B20/
│ │ │ │ ├── Libraries.md
│ │ │ │ └── Memsic2125_plus_DS18B20.ino
│ │ │ ├── Sound/
│ │ │ │ └── SimpleSoundSensor/
│ │ │ │ └── SimpleSoundSensor.ino
│ │ │ ├── Temperature/
│ │ │ │ └── DS18B20/
│ │ │ │ ├── DS18B20.ino
│ │ │ │ └── Libraries.md
│ │ │ └── Weather/
│ │ │ └── WeatherShieldJson/
│ │ │ ├── Arduino-and-Weather-Shield-setup.md
│ │ │ ├── Hardware.md
│ │ │ ├── Libraries.md
│ │ │ ├── SCPRPI.cmd
│ │ │ └── WeatherShieldJson.ino
│ │ ├── Arduino Zero/
│ │ │ └── Weather/
│ │ │ └── SeeedGroveJson/
│ │ │ ├── SeeedGroveJson.ino
│ │ │ └── readme.md
│ │ ├── BLEMoisture/
│ │ │ ├── BLEMoistureSensor.py
│ │ │ ├── DeviceConfig.csv
│ │ │ ├── RedBear_BLE_nano/
│ │ │ │ ├── Configure.md
│ │ │ │ └── main.cpp
│ │ │ ├── SensorAgent.py
│ │ │ ├── SensorAgentConfig.csv
│ │ │ ├── autorun2.sh
│ │ │ ├── configuration.md
│ │ │ └── deploy_next.cmd
│ │ ├── BluetoothUARTExample/
│ │ │ ├── BluetoothUARTExample.py
│ │ │ ├── SetupSerialBaudRate.py
│ │ │ └── readme
│ │ ├── BtUSB_2_BtUART_Example/
│ │ │ ├── ArduinoSensorMock/
│ │ │ │ └── ArduinoSensorMock.ino
│ │ │ ├── BtUSB_2_BtUART_Example.py
│ │ │ ├── TestServer.py
│ │ │ └── readme
│ │ ├── Hydrology/
│ │ │ ├── DO2Sensor.py
│ │ │ ├── Documentation/
│ │ │ │ └── DeviceSetup.md
│ │ │ ├── ECSensor.py
│ │ │ ├── MoistureSensor.py
│ │ │ ├── SensorAgent.py
│ │ │ ├── autorun2.sh
│ │ │ └── deploy_next.cmd
│ │ └── WensnSoundLevelMeter/
│ │ └── WensnPiVS01/
│ │ ├── WensnPiVS01.py
│ │ ├── autorun2.sh
│ │ └── deploy_next.cmd
│ ├── Gateways/
│ │ └── GatewayService/
│ │ ├── Common/
│ │ │ ├── Adapter/
│ │ │ │ └── SensorEndpoint.cs
│ │ │ ├── ILogger.cs
│ │ │ ├── IPAddressHelper.cs
│ │ │ ├── Logger/
│ │ │ │ ├── NLogEventLogger.cs
│ │ │ │ ├── SafeLogger.cs
│ │ │ │ └── TunableLogger.cs
│ │ │ ├── Microsoft.ConnectTheDots.Common.csproj
│ │ │ ├── Platform.cs
│ │ │ ├── Properties/
│ │ │ │ └── AssemblyInfo.cs
│ │ │ ├── SafeAction.cs
│ │ │ ├── SafeFunction.cs
│ │ │ ├── Threading/
│ │ │ │ └── TaskWrapper.cs
│ │ │ ├── Utils/
│ │ │ │ └── Loader.cs
│ │ │ └── packages.config
│ │ ├── DeviceAdapters/
│ │ │ ├── Bluetooth/
│ │ │ │ ├── BluetoothUARTAdapter.cs
│ │ │ │ ├── BluetoothUARTAdapter.csproj
│ │ │ │ └── Properties/
│ │ │ │ └── AssemblyInfo.cs
│ │ │ ├── SerialPort/
│ │ │ │ ├── Properties/
│ │ │ │ │ └── AssemblyInfo.cs
│ │ │ │ ├── SerialPortAdapter.cs
│ │ │ │ └── SerialPortAdapter.csproj
│ │ │ └── Socket/
│ │ │ ├── Properties/
│ │ │ │ └── AssemblyInfo.cs
│ │ │ ├── SocketAdapter.cs
│ │ │ └── SocketAdapter.csproj
│ │ ├── Gateway/
│ │ │ ├── Adapter/
│ │ │ │ ├── DeviceAdapter.cs
│ │ │ │ └── IDeviceAdapter.cs
│ │ │ ├── App.config
│ │ │ ├── Constants.cs
│ │ │ ├── DeviceAdapter/
│ │ │ │ ├── DeviceAdapter.cs
│ │ │ │ ├── IDeviceAdapter.cs
│ │ │ │ └── SensorEndpoint.cs
│ │ │ ├── EventProcessor.cs
│ │ │ ├── GatewayService.cs
│ │ │ ├── GatewayService.csproj
│ │ │ ├── IGatewayService.cs
│ │ │ ├── Microsoft.ConnectTheDots.Gateway.csproj
│ │ │ ├── Models/
│ │ │ │ ├── QueuedItem.cs
│ │ │ │ └── SensorDataContract.cs
│ │ │ ├── Properties/
│ │ │ │ └── AssemblyInfo.cs
│ │ │ ├── ServiceInstantiation/
│ │ │ │ ├── IService.cs
│ │ │ │ ├── ServiceBehavior.cs
│ │ │ │ └── ServiceInstanceProvider.cs
│ │ │ ├── Utils/
│ │ │ │ ├── Loader/
│ │ │ │ │ └── DataIntakeLoader.cs
│ │ │ │ ├── MessageSender/
│ │ │ │ │ ├── IMessageSender.cs
│ │ │ │ │ └── MessageSender.cs
│ │ │ │ ├── OperationStatus/
│ │ │ │ │ ├── ErrorCode.cs
│ │ │ │ │ ├── OperationStatus.cs
│ │ │ │ │ └── OperationStatusFactory.cs
│ │ │ │ └── Queue/
│ │ │ │ ├── BatchSenderThread.cs
│ │ │ │ ├── GatewayQueue.cs
│ │ │ │ └── IAsyncQueue.cs
│ │ │ └── packages.config
│ │ ├── GatewayService.sln
│ │ ├── Hardware.md
│ │ ├── RaspberryPi-Gateway-setup.md
│ │ ├── Scripts/
│ │ │ ├── RaspberryPi/
│ │ │ │ ├── GetLogFile.cmd
│ │ │ │ ├── Modified/
│ │ │ │ │ ├── autorun_install.sh
│ │ │ │ │ ├── certificate_update.sh
│ │ │ │ │ ├── deploy_and_start_ctd_on_boot.sh
│ │ │ │ │ └── kill_all.sh
│ │ │ │ ├── autorunUart2UsbBt.sh
│ │ │ │ ├── autorunUartBT.sh
│ │ │ │ ├── autorunWensnSoundSensor.sh
│ │ │ │ ├── autorun_install.sh
│ │ │ │ ├── certificate_update.sh
│ │ │ │ ├── deploy.cmd
│ │ │ │ ├── deploy_and_start_ctd_on_boot.sh
│ │ │ │ ├── deploy_next.cmd
│ │ │ │ ├── kill_all.sh
│ │ │ │ ├── setupWifi.py
│ │ │ │ └── setup_autostart.sh
│ │ │ └── ScriptConverter/
│ │ │ ├── App.config
│ │ │ ├── Program.cs
│ │ │ ├── Properties/
│ │ │ │ └── AssemblyInfo.cs
│ │ │ └── ScriptConverter.csproj
│ │ ├── ServiceMonitor/
│ │ │ ├── App.config
│ │ │ ├── IMonitor.cs
│ │ │ ├── Microsoft.ConnectTheDots.ServiceMonitor.csproj
│ │ │ ├── Monitor.cs
│ │ │ ├── MonitorProgram.cs
│ │ │ ├── NLog.config
│ │ │ ├── NLog.xsd
│ │ │ ├── ProcessMonitor.cs
│ │ │ ├── Properties/
│ │ │ │ └── AssemblyInfo.cs
│ │ │ ├── ServiceMonitor.cs
│ │ │ ├── Utils/
│ │ │ │ └── Logger/
│ │ │ │ └── Logger.cs
│ │ │ └── packages.config
│ │ ├── Setup/
│ │ │ ├── WindowsExeSetup/
│ │ │ │ ├── Product.wxs
│ │ │ │ └── WindowsExeSetup.wixproj
│ │ │ └── WindowsServiceSetup/
│ │ │ ├── Product.wxs
│ │ │ └── WindowsServiceSetup.wixproj
│ │ ├── Tests/
│ │ │ ├── BatchSenderThreadTest/
│ │ │ │ ├── App.config
│ │ │ │ ├── BatchSenderThreadTest.cs
│ │ │ │ ├── BatchSenderThreadTest.csproj
│ │ │ │ ├── Properties/
│ │ │ │ │ └── AssemblyInfo.cs
│ │ │ │ ├── TestRunner.cs
│ │ │ │ └── Utils/
│ │ │ │ └── MessageSender/
│ │ │ │ ├── MockSenderAsyncQueue.cs
│ │ │ │ └── MockSenderMap.cs
│ │ │ ├── CoreTest/
│ │ │ │ ├── App.config
│ │ │ │ ├── CoreTest.cs
│ │ │ │ ├── CoreTest.csproj
│ │ │ │ ├── Devices/
│ │ │ │ │ ├── SocketClientTestDevice.cs
│ │ │ │ │ └── SocketServiceTestDevice.cs
│ │ │ │ ├── ITest.cs
│ │ │ │ ├── Properties/
│ │ │ │ │ └── AssemblyInfo.cs
│ │ │ │ ├── RealDataTest.cs
│ │ │ │ ├── SocketTest.cs
│ │ │ │ ├── TestRunner.cs
│ │ │ │ ├── Utils/
│ │ │ │ │ ├── Generators/
│ │ │ │ │ │ └── RandomSensorDataGenerator.cs
│ │ │ │ │ ├── Loader/
│ │ │ │ │ │ └── Loader.cs
│ │ │ │ │ ├── Logger/
│ │ │ │ │ │ └── TestLogger.cs
│ │ │ │ │ └── MessageSender/
│ │ │ │ │ └── MockSender.cs
│ │ │ │ ├── WebServiceTest.cs
│ │ │ │ └── packages.config
│ │ │ ├── DeviceAdapterTestMock/
│ │ │ │ ├── DeviceAdapterTestMock.cs
│ │ │ │ ├── DeviceAdapterTestMock.csproj
│ │ │ │ ├── Properties/
│ │ │ │ │ └── AssemblyInfo.cs
│ │ │ │ └── packages.config
│ │ │ └── SocketServiceDeviceMock/
│ │ │ ├── App.config
│ │ │ ├── Properties/
│ │ │ │ └── AssemblyInfo.cs
│ │ │ ├── SocketServiceDeviceMock.cs
│ │ │ ├── SocketServiceDeviceMock.csproj
│ │ │ ├── Utils/
│ │ │ │ └── Logger/
│ │ │ │ └── ConsoleLogger.cs
│ │ │ └── packages.config
│ │ ├── UpgradeLog.htm
│ │ ├── WiFi-Configuration.md
│ │ ├── WindowsEXE/
│ │ │ ├── App.config
│ │ │ ├── Microsoft.ConnectTheDots.GatewayExe.csproj
│ │ │ ├── NLog.config
│ │ │ ├── NLog.xsd
│ │ │ ├── Program.cs
│ │ │ ├── Properties/
│ │ │ │ └── AssemblyInfo.cs
│ │ │ └── packages.config
│ │ └── WindowsService/
│ │ ├── App.config
│ │ ├── Microsoft.ConnectTheDots.GatewayService.csproj
│ │ ├── NLog.config
│ │ ├── NLog.xsd
│ │ ├── ProjectInstaller.cs
│ │ ├── Properties/
│ │ │ └── AssemblyInfo.cs
│ │ ├── Utils/
│ │ │ └── Logger/
│ │ │ └── EventLogger.cs
│ │ ├── WindowsService.cs
│ │ └── packages.config
│ └── readme.md
├── GettingStarted.md
├── SupportedDevices.md
├── license.txt
├── notice.txt
└── readme.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .deployment
================================================
[config]
project = Azure/WebSite/site
================================================
FILE: .gitattributes
================================================
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
# Prevent from further automatic changes
* text=binary
###############################################################################
# We assume following configuration
# Some sh files and other could be changed from Windows too
###############################################################################
#* text=auto
#*.sln text eol=crlf
#*.csproj text eol=crlf
#*.cs text eol=crlf
#*.cpp text eol=crlf
#*.h text eol=crlf
#*.config text eol=crlf
#*.sql text eol=crlf
#*.asax text eol=crlf
#*.css text eol=crlf
#*.js text eol=crlf
#*.xsd text eol=crlf
#
#*.wxs text eol=crlf
#*.wixproj text eol=crlf
#
#*.cmd text eol=crlf
#
#*.ino text eol=lf
#*.py text eol=lf
#*.sh text eol=lf
#
#Devices\DirectlyConnectedDevices\NodeJS\*.* text=binary
#Devices\DirectlyConnectedDevicesParticleCore\*.* text=binary
###############################################################################
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
================================================
FILE: .gitignore
================================================
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
[Bb]in/
[Oo]bj/
# mstest test results
TestResults
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
AzurePrep.sln.ide/
ConnectTheDotsWebSite.sln.ide/
GatewayService.sln.ide/
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.log
*.vspscc
*.vssscc
.builds
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish
# Publish Web Output
*.Publish.xml
# NuGet Packages Directory
packages
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
[Bb]in
[Oo]bj
sql
TestResults
[Tt]est[Rr]esult*
*.Cache
ClientBin
[Ss]tyle[Cc]op.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
# NuGet Packages
*.nupkg
.nuget
#Thumbs.db
Thumbs.db
Azure/MachineLearning/UpgradeLog.htm
# Node modules directory
node_modules/
# Visual Studio config files
.vs/
# VS Code config files
.vscode
# Website exception for bin
!/Azure/Website/site/bin/
================================================
FILE: .gitmodules
================================================
[submodule "Devices/DirectlyConnectedDevices/WindowsIoTCorePi2WeatherShield"]
path = Devices/DirectlyConnectedDevices/WindowsIoTCorePi2WeatherShield
url = https://github.com/ms-iot/iot-build-lab.git
branch = ConnectTheDotsSample
================================================
FILE: Azure/ARMTemplate/CustomizeTemplate.md
================================================
You can adapt the deployment of services in order to extend, optimize and customize your own ConnectTheDots solution.
The deployment of the ConnectTheDots solution is driven by the Azure Resource Manager.
Azure Resource Manager simplifies the deployment, maintenance and management of Azure resources. You can read about it extensively [here](https://azure.microsoft.com/en-us/documentation/articles/resource-group-overview/).
The ConnectTheDots.json file (in the same folder as this document) is the template used for ConnectTheDots deployment.
Below you will find a description of what's in the template and [here](https://azure.microsoft.com/en-us/documentation/articles/resource-group-authoring-templates/) you can read details about ARM templates syntax and formatting.
## Resources in the template ##
Here is what you will find in the template that will get deployed

- Storage:
- The storage account is necessary for reading alerts from the Event Hub in the Website.
- If you remove it then you won't be able to read alerts any longer.
- IoTHub:
- The Azure IoT Hub service is your cloud gateway for devices.
- This is the service that is used to securely connect devices to Azure IoT. When deploying the sevice using the ARM template, you will be prompted to select a SKU. You can choose to pick the free SKU which should be plenty enough for your ConnectTheDots solution (note that you can only deploy one of the free SKU of IoTHub per Azure subscription)
- You cannot remove this service as it is core to the ConnectTheDots architecture.
- Service Bus:
- This is the Service Bus instance that hosts the Event Hub used for alerts flow.
- If you don't want to implement alerts or other alerts, you don't need this service and can comment it out. If you do so you will also have to customize the Website code that assumes this service is deployed.
- Stream Analytics Job:
- This is the Stream Analytics job that does near real time analytics on the stream of data coming from devices (computing averages and triggering alerts)
- You can customize the query as described in [this document](../StreamAnalyticsQueries/SA_Setup.md).
- You can remove this service from the template with no impact on the rest of the solution (other than not having alerts triggered any more)
- Web Plan:
- This is the App Services plan for the Web dashboard.
- If you remove this one, you won't be able to deploy the Website any longer
- DashboardWebApp
- This is the Website dashboard
- The site itself is deployed using a Webdeploy package. Read [here](../WebSite/WebsitePublish.md) if you want to customize and redeploy the site.
## Template walk through
```
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
// The parameters below are used to configure the deployment
"parameters": {
"iotHubSku": {
// The SKU for the IoT Hub service is to be selected during deployment. F1 is for the free SKU (only one instance of the F1 SKU can be deployed per subscription)
...
},
"iotHubTier": {
// The tier for the IoT Hub instance is set by default to "Standard"
...
},
"packageUri": {
// This URI is for the website WebDeploy package. The package is published by the ConnectTheDots team, but if you want your own package to be deployed, you can create it locally and change the below URI to point to it.
"type": "string",
"defaultValue": "http://aka.ms/connectthedotswebsitepackage"
},
"sbSku": {
// The Service Bus SKU is set the cheapest available one by default
...
},
"solutionName": {
// During deployment, you will be prompted for a solution name. This name is used as a prefix for naming the resource group and the various services. Use a unique name!
...
},
"storageAccountSku": {
// The Storage account SKU is set the cheapest available one by default
...
},
"webSku": {
// The Storage account SKU is set the cheapest available one by default
...
},
"webWorkerCount": {
// This is used to scale the web plan. we only have one worker
...
},
"webWorkerSize": {
// Set to the minimum available
}
},
// The variables below are used whithin the template deployment process and don't need to be changed...
"variables": {
...
},
// Below is the list of resources that will be deployed
"resources": [
{
// Storage account
"apiVersion": "[variables('storageVersion')]",
"location": "[variables('location')]",
"name": "[variables('storageName')]",
...
},
{
// IoT Hub
"apiVersion": "[variables('iotHubVersion')]",
"type": "Microsoft.Devices/Iothubs",
"name": "[variables('iotHubName')]",
...
},
{
// Service Bus + Event Hub (forthe alerts Event Hub)
"apiVersion": "[variables('sbVersion')]",
"name": "[variables('sbName')]",
...
"resources": [
{
// Event Hub
"apiVersion": "[variables('sbVersion')]",
"name": "[variables('ehOutName')]",
"type": "eventHubs",
...
}
]
},
{
// Stream Analytics job
"apiVersion": "[variables('saVersion')]",
"type": "Microsoft.StreamAnalytics/streamingjobs",
"name": "[concat(parameters('solutionName'), 'alerts')]",
...
"Transformation": {
"Name": "AllToBlob",
// Here is the inline default query that you can customize
"Properties": {
"Query": "SELECT \r\n 'TempSpike' AS alerttype, \r\n 'Temperature over 80F' AS message, \r\n displayname,\r\n guid,\r\n measurename,\r\n unitofmeasure,\r\n location,\r\n organization,\r\n MIN(timecreated) AS timecreated,\r\n MAX(value) AS tempMax,\r\n MAX(value) AS value\r\nINTO\r\n DeviceInfoEvents\r\nFROM \r\n IoTHubStream TIMESTAMP BY timecreated\r\nWHERE\r\n measurename = 'temperature' OR measurename = 'Temperature'\r\nGROUP BY \r\n displayname, guid, measurename, unitofmeasure, location, organization,\r\n TumblingWindow(Second, 5)\r\n HAVING\r\n tempMax > 80",
"StreamingUnits": 1
}
}
}
},
{
// Webplan
"apiVersion": "[variables('webVersion')]",
"name": "[variables('webPlanName')]",
"type": "Microsoft.Web/serverfarms",
...
},
{
// WebSite (deployed using webdeploy package
"name": "[variables('webSiteName')]",
"type": "Microsoft.Web/sites",
"location": "[variables('location')]",
...
}
],
// The below are outputs printed at the end of the deployment for the user to have references such as connection strings
"outputs": {
...
}
}
```
================================================
FILE: Azure/ARMTemplate/Readme.md
================================================
## How to deploy Azure services for ConnectTheDots.io
To deploy the ConnectTheDots solution to your Azure subscription you will need to follow the below instructions.
We are using Azure Resource Manager to deploy the needed services and connect them to one another.
We are also using the Azure cross platform CLI tool which will allow you to deploy the services from your favorite development machine, running Windows, Linux or OSX.
The below services will be deployed in your Azure subscription:
- 1 instance of Azure IoT Hub (using the SKU of your choice, considering you can only deploy 1 instance of the free SKU per subscription)
- 1 Storage account (Standard performance)
- 1 Service Bus instance (Basic tier) with 1 Event Hub (1 throughput Unit)
- 1 Stream Analytics Job (1 streaming unit)
- 1 App Service plan (Standard: 2 Small SKU) with 1 Web app
You can edit the [ARM template](azuredeploy.json) if you want to add more services or edit the parameters. If you edit the ARM template manually, you will have to deploy it using the command line instructions, not the "Azure Deploy Button".
The ConnectTheDots website can allow you to manage your IoTHub instance (get devices connection strings, add/remove devices). This feature is NOT enabled by default and requires manually configuration in Active Directory described [below](#enable-iothub-management).
## Your connect the dots resource groups
All the services will be deployed under a single resource group in Azure.
The [Azure resource groups](https://azure.microsoft.com/en-us/updates/resource-groups-in-azure-preview-portal/) are a concept allowing to manage a set of resources all together.
This allows you to easily find the various resources for your ConnectTheDots solution in the Azure portal.
## Editing the deployment ARM template
The default Azure Resource Manager template doesn't require editing unless you want to change the architecture of your solution to go from the default ConnectTheDots one to your own version of it.
You can find information on how to customize the ARM template for ConnectTheDots [here](CustomizeTemplate.md).
If you edit the template file, then you will have to deploy it using the command line instructions, not the "Azure Deploy Button"
## Deploy using the Azure Deploy Button
There are several ways to deploy Azure resources to your subscription using Azure Resourre Manager templates. The simplest one is to click on the button below and follow instructions.
If you prefer command line tools, skip to the next chapter.
[](http://azuredeploy.net/?repository=https://github.com/Azure/connectthedots/raw/master/Azure/ARMTemplate)
Once you have clicked on the button, login to your subscription. You will be directed to the first step of the deployment: the setup.

Select the appropriate fields:
- Directory: this is the Azure Active Directory your account has access to and that you want to use
- Subscription: if you have several subscriptions, you can pick the one you want to deploy your solution to
- Resource group/Resource Group Name: the Azure resources/services will all be deployed to a single resource group, allowing for better management of the resources once deployed. You can choose to create a new resource group for your solution or deploy to an existing one.
- Region: pick the region you want to deploy your services to.
- Solution Name: this is the name for your connectthedots solution. This name has to be **all lower case** and **less than 16 characters**
- IoT Hub Sku: you can select F1 (free), S1 or S2 (see [here](https://azure.microsoft.com/en-us/pricing/details/iot-hub/) for details on pricing for these skus). Note that only 1 instance of the free SKU of IoT Hub is allowed per Azure subscription.
- AdminName: this is the user email you want to use as an admin if you want to activate the IoTHub management features in your site. **Use the email address you used to login into your Azure Subscription**
**Important**: the IoT Hub SKU selected by default is an S1 which has a cost (see pricing details link above). If you want to use the free tier, remember to switch the selection to F1. You will then be limited to 8K messages/day.
Once you have made your selections, click on **Next**

You can see the list of services that will be deployed.
Click on **Deploy**. You will see the progress of the deployment and if everything goes well, you will see this:

To access the resource group in the Azure portal directly, you can click on the green **Manage** link.
At this point you can go a start setting up your devices.
Read the chapter after next for instructions on how to clean up your Azure subscription once you are done playing with ConnectTheDots.
## Deploy using Azure CLI tool and the ARM template
Now here is how to deploy the whole ConnectTheDots solution in a few command lines:
1. Install the Azure CLI tool following the instructions [here](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-install/).
1. Once you have installed the Azure CLI, you will need to connect to your Azure account. To do so, follow the instructions [here](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-connect/).
1. If you have multiple subscriptions, select the one you want to deploy the solution to following the instructions [here](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-connect/#multiple-subscriptions)
1. Set the Resource Azure Manager mode typing the following command:
```
azure config mode arm
```
1. Create a new resource group typing the following command (you can replace "ConnectTheDotsRG" with the name of your choice for the resource group):
```
azure group create -n "ConnectTheDotsRG" -l "East US"
```
1. Navigate to the Azure\ARMTemplate folder in the repo
```
cd C:\My\Repo\Location\Azure\ARMTemplate
```
1. Deploy the solution typing the below command. You will actually be prompted for the following:
* region: you can use one of the following: "East US", "West US", "North Europe", "West Europe", "East Asia", "South East Asia", "Japan East", "Japan West", "Australia East", "Australia SouthEast", "North Europe"
* iothub SKU: you can select F1 (free), S1 or S2 (see [here](https://azure.microsoft.com/en-us/pricing/details/iot-hub/) for details on pricing for these skus). Note that only 1 instance of the free SKU of IoT Hub is allowed per Azure subscription.
* solution name: this name has to be **all lower case** and **less than 16 characters**
* AdminName: this is the user email you want to use as an admin if you want to activate the IoTHub management features in your site.
```
azure group deployment create -f "azuredeploy.json" ConnectTheDotsRG ConnectTheDotsDeploy
```
1. If you are seeing errors during the deployment, you can diagnose following instructions on how to debug ARM deployments: [http://aka.ms/arm-debug](http://aka.ms/arm-debug).
## Enable IoTHub Management
The ConnectTheDots website can allow you to manage your IoT Hub instance: create/delete devices in the IoT Hub device registry, retreive connection strings.
In order to ensure this is a secured process, you will need to create a new Azure Active Directory application and register your instance of the website to enable the features.
But keep cool, there is a simple process for this:
1. Go to the [Azure portal](https://portal.azure.com)
1. Look for the resource group created during the deployment of the solution
1. Select the website in the list of resources to bring up the website blade
1. In the Settings section, look for and click on "Authentication/Authorization"
1. Turn "App Service Authentication" to on
1. Select "Log in with Azure Active Directory" in the "Action to take when request is not authenticated"
1. Click on the Azure Active Directory provider to configure it
1. Select "Express" and "Create new AD App", then click OK
1. Save the new Authentication/Authorization setting
Once you have done so you can go back to the site where you will be prompted to login. Use the same account as your Azure Subscription's one. There you should see a new collumn in the devices list as well as a couple buttons allowing you to create a new device or delete an existing one.
No more need to toy around with IoTHub in the portal!
## Deleting a ConnectTheDots solution from your Azure subscription
You can easily delete all the Azure resources at once when you are done with your project and want to clean up your Azure subscirption.
You can do this using a command line in the Azure CLI tool or in the Azure portal.
## Delete the resources using Azure CLI
If you are already logged in in the Azure CLI tool, go directly to step #4
1. Connect to Azure following the instructions [here](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-connect/).
1. If you have multiple subscriptions, select the one you want to deploy the solution to following the instructions [here](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-connect/#multiple-subscriptions)
1. Set the Resource Azure Manager mode typing the following command:
```
azure config mode arm
```
1. Delete the resource group typing the following command (you need to replace "ConnectTheDotsRG" with the name you used in step 5 of the deployment if you changed it):
```
azure group delete -n "ConnectTheDotsRG"
```
================================================
FILE: Azure/ARMTemplate/azuredeploy.json
================================================
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"region": {
"type": "string",
"allowedValues": [
"East US",
"West US",
"North Europe",
"West Europe",
"East Asia",
"South East Asia",
"Japan East",
"Japan West",
"Australia East",
"Australia SouthEast",
"North Europe"
],
"metadata": {
"description": "The Region to deploy the solution to"
}
},
"solutionName": {
"type": "string",
"maxLength": 16,
"metadata": {
"description": "The name of your ConnectTheDots solution (will be used to prefix the services names)"
}
},
"iotHubSku": {
"type": "string",
"allowedValues": [
"F1",
"S1",
"S2"
],
"defaultValue": "S1",
"metadata": {
"description": "The Iothub Sku"
}
},
"adminName": {
"type": "string"
},
"repoUrl": {
"type": "string",
"defaultValue": "https://github.com/Azure/connectthedots"
},
"branch": {
"type": "string",
"defaultValue": "master"
}
},
"variables": {
"location": "[parameters('region')]",
"storageVersion": "2015-06-15",
"storageName": "[concat(parameters('solutionName'), 'storage')]",
"storageId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageName'))]",
"storageAccountSku": "Standard_LRS",
"ehOutName": "ehalerts",
"sbKeyName": "RootManageSharedAccessKey",
"sbSku": 1,
"sbName": "[concat(parameters('solutionName'),'sb')]",
"sbVersion": "2017-04-01",
"sbResourceId": "[resourceId('Microsoft.Eventhub/namespaces/authorizationRules', variables('sbName'), variables('sbKeyName'))]",
"saVersion": "2015-10-01",
"saName": "[concat(parameters('solutionName'), 'alerts')]",
"webVersion": "2015-04-01",
"webPlanName": "[concat(parameters('solutionName'), 'plan')]",
"webSiteName": "[parameters('solutionName')]",
"iotHubVersion": "2016-02-03",
"iotHubTier": "Standard",
"iotHubName": "[concat(parameters('solutionName'), 'hub')]",
"iotHubResourceId": "[resourceId('Microsoft.Devices/Iothubs', variables('iotHubName'))]",
"iotHubKeyName": "iothubowner",
"iotHubKeyResource": "[resourceId('Microsoft.Devices/Iothubs/Iothubkeys', variables('iotHubName'), variables('iotHubKeyName'))]",
"saCGName": "streamanalyticscg",
"websiteCGName": "websitecg",
"webSku": "Standard",
"webWorkerCount": 2,
"webWorkerSize": 0
},
"resources": [
{
"apiVersion": "[variables('storageVersion')]",
"location": "[variables('location')]",
"name": "[variables('storageName')]",
"properties": {
"accountType": "[variables('storageAccountSku')]"
},
"type": "Microsoft.Storage/storageAccounts",
"tags": {
"displayName": "storage"
}
},
{
"apiVersion": "[variables('iotHubVersion')]",
"type": "Microsoft.Devices/Iothubs",
"name": "[variables('iotHubName')]",
"location": "[variables('location')]",
"sku": {
"name": "[parameters('iotHubSku')]",
"tier": "[variables('iotHubTier')]",
"capacity": 1
},
"properties": {
"location": "[variables('location')]"
},
"tags": {
"displayName": "IoTHub"
},
"resources": [
{
"apiVersion": "[variables('iotHubVersion')]",
"name": "[concat(variables('iotHubName'), '/events/', variables('websiteCGName'))]",
"type": "Microsoft.Devices/Iothubs/eventhubEndpoints/ConsumerGroups",
"dependsOn": [
"[concat('Microsoft.Devices/Iothubs/', variables('iotHubName'))]"
],
"tags": {
"displayName": "Website Consumer Group"
}
},
{
"apiVersion": "[variables('iotHubVersion')]",
"name": "[concat(variables('iotHubName'), '/events/', 'debug')]",
"type": "Microsoft.Devices/Iothubs/eventhubEndpoints/ConsumerGroups",
"dependsOn": [
"[concat('Microsoft.Devices/Iothubs/', variables('iotHubName'))]"
],
"tags": {
"displayName": "Debug Consumer Group"
}
},
{
"apiVersion": "[variables('iotHubVersion')]",
"name": "[concat(variables('iotHubName'), '/events/', variables('saCGName'))]",
"type": "Microsoft.Devices/Iothubs/eventhubEndpoints/ConsumerGroups",
"dependsOn": [
"[concat('Microsoft.Devices/Iothubs/', variables('iotHubName'))]"
],
"tags": {
"displayName": "Stream Analytics Consumer Group"
}
}
]
},
{
"apiVersion": "[variables('sbVersion')]",
"name": "[variables('sbName')]",
"type": "Microsoft.Eventhub/namespaces",
"location": "[variables('location')]",
"properties": {
"messagingSku": "[variables('sbSku')]",
"region": "[variables('location')]"
},
"tags": {
"displayName": "Service Bus"
},
"resources": [
{
"apiVersion": "[variables('sbVersion')]",
"name": "[variables('ehOutName')]",
"type": "eventHubs",
"location": "[variables('location')]",
"dependsOn": [
"[concat('Microsoft.Eventhub/namespaces/', variables('sbName'))]"
],
"properties": {
"path": "[variables('ehOutName')]",
"MessageRetentionInDays": 1
},
"tags": {
"displayName": "Alerts Event Hub"
},
"resources": [
{
"apiVersion": "[variables('sbVersion')]",
"name": "[variables('websiteCGName')]",
"type": "ConsumerGroups",
"dependsOn": [
"[variables('ehOutName')]"
],
"tags": {
"displayName": "Website Consumer Group"
}
},
{
"apiVersion": "[variables('sbVersion')]",
"name": "debug",
"type": "ConsumerGroups",
"dependsOn": [
"[variables('ehOutName')]"
],
"tags": {
"displayName": "Debug Consumer Group"
}
}
]
}
]
},
{
"apiVersion": "[variables('saVersion')]",
"type": "Microsoft.StreamAnalytics/streamingjobs",
"name": "[variables('saName')]",
"location": "[variables('location')]",
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', variables('storageName'))]",
"[concat('Microsoft.Devices/Iothubs/', variables('iotHubName'))]",
"[concat('Microsoft.Eventhub/namespaces/', variables('sbName'))]"
],
"tags": {
"displayName": "Stream Analytics Job"
},
"properties": {
"sku": {
"name": "standard"
},
"EventsOutOfOrderMaxDelayInSeconds": 10,
"EventsOutOfOrderPolicy": "adjust",
"outputStartMode": "JobStartTime",
"outputStartTime": null,
"Inputs": [
{
"Name": "IoTHubStream",
"Properties": {
"DataSource": {
"Properties": {
"consumerGroupName": "[variables('saCGName')]",
"iotHubNamespace": "[variables('iotHubName')]",
"sharedAccessPolicyKey": "[listkeys(variables('iotHubKeyResource'), variables('iotHubVersion')).primaryKey]",
"sharedAccessPolicyName": "[variables('iotHubKeyName')]"
},
"Type": "Microsoft.Devices/IotHubs"
},
"Serialization": {
"Properties": {
"Encoding": "UTF8"
},
"Type": "Json"
},
"Type": "Stream"
}
}
],
"Outputs": [
{
"Name": "DeviceInfoEvents",
"Properties": {
"DataSource": {
"Properties": {
"EventHubName": "[variables('ehOutName')]",
"ServiceBusNamespace": "[variables('sbName')]",
"SharedAccessPolicyKey": "[listkeys(variables('sbResourceId'), variables('sbVersion')).primaryKey]",
"SharedAccessPolicyName": "[variables('sbKeyName')]",
"PartitionKey": "PartitionId"
},
"Type": "Microsoft.ServiceBus/EventHub"
},
"Serialization": {
"Properties": {
"Encoding": "UTF8",
"Format": "Array"
},
"Type": "Json"
}
}
}
],
"Transformation": {
"Name": "AllToBlob",
"Properties": {
"Query": "SELECT \r\n 'TempSpike' AS alerttype, \r\n 'Temperature over 80F' AS message, \r\n displayname,\r\n guid,\r\n measurename,\r\n unitofmeasure,\r\n location,\r\n organization,\r\n MIN(timecreated) AS timecreated,\r\n MAX(value) AS tempMax,\r\n MAX(value) AS value\r\nINTO\r\n DeviceInfoEvents\r\nFROM \r\n IoTHubStream TIMESTAMP BY timecreated\r\nWHERE\r\n measurename = 'temperature' OR measurename = 'Temperature'\r\nGROUP BY \r\n displayname, guid, measurename, unitofmeasure, location, organization,\r\n TumblingWindow(Second, 5)\r\n HAVING\r\n tempMax > 80",
"StreamingUnits": 1
}
}
}
},
{
"apiVersion": "[variables('webVersion')]",
"name": "[variables('webPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[variables('location')]",
"tags": {
"displayName": "Web Plan"
},
"properties": {
"name": "[variables('webPlanName')]",
"sku": "[variables('webSku')]",
"workerSize": "[variables('webWorkerSize')]",
"numberOfWorkers": "[variables('webWorkerCount')]"
}
},
{
"name": "[variables('webSiteName')]",
"type": "Microsoft.Web/sites",
"location": "[variables('location')]",
"apiVersion": "[variables('webVersion')]",
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', variables('storageName'))]",
"[concat('Microsoft.Devices/Iothubs/', variables('iotHubName'))]",
"[concat('Microsoft.Eventhub/namespaces/', variables('sbName'))]",
"[variables('ehOutName')]",
"[variables('websiteCGName')]",
"[concat('Microsoft.Web/serverfarms/', variables('webPlanName'))]",
"[concat('Microsoft.StreamAnalytics/streamingjobs/', variables('saName'))]"
],
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', variables('webPlanName'))]": "Resource",
"displayName": "DashboardWebApp"
},
"properties": {
"name": "[variables('WebSiteName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms/', variables('webPlanName'))]",
"siteConfig": {
"AlwaysOn": true,
"WebsocketsEnabled": true,
"appSettings": [
{
"name": "Azure.IoT.IoTHub.ConnectionString",
"value": "[concat('HostName=', reference(variables('iotHubResourceId')).hostName, ';SharedAccessKeyName=', variables('iotHubKeyName'), ';SharedAccessKey=', listkeys(variables('iotHubKeyResource'), variables('iotHubVersion')).primaryKey)]"
},
{
"name": "Azure.IoT.IoTHub.EventHub.Name",
"value": "[reference(variables('iotHubResourceId')).eventHubEndpoints.events.path]"
},
{
"name": "Azure.IoT.IoTHub.EventHub.ConnectionString",
"value": "[concat('Endpoint=', reference(variables('iotHubResourceId')).eventHubEndpoints.events.endpoint, ';SharedAccessKeyName=', variables('iotHubKeyName'), ';SharedAccessKey=', listkeys(variables('iotHubKeyResource'), variables('iotHubVersion')).primaryKey)]"
},
{
"name": "Azure.IoT.IoTHub.EventHub.ConsumerGroup",
"value": "[variables('websiteCGName')]"
},
{
"name": "Azure.ServiceBus.EventHub.Name",
"value": "[variables('ehOutName')]"
},
{
"name": "Azure.ServiceBus.EventHub.ConnectionString",
"value": "[listkeys(variables('sbResourceId'), variables('sbVersion')).primaryConnectionString]"
},
{
"name": "Azure.ServiceBus.EventHub.ConsumerGroup",
"value": "[variables('websiteCGName')]"
},
{
"name": "Azure.Storage.ConnectionString",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageName'), ';AccountKey=', listkeys(variables('storageId'), variables('storageVersion')).key1)]"
},
{
"name": "AdminName",
"value": "[parameters('adminName')]"
},
{
"name": "ObjectTypePrefix",
"value": ""
},
{
"name": "SolutionName",
"value": "[variables('webSiteName')]"
}
]
}
},
"resources": [
{
"apiVersion":"[variables('webVersion')]",
"name":"web",
"type":"sourcecontrols",
"dependsOn":[
"[concat('Microsoft.Web/sites/', variables('webSiteName'))]"
],
"properties":{
"repoUrl":"[parameters('repoUrl')]",
"branch":"[parameters('branch')]",
"isManualIntegration": true
}
}
]
}
],
"outputs": {
"iotHubConnectionString": {
"type": "string",
"value": "[concat('HostName=', reference(variables('iotHubResourceId')).hostName, ';SharedAccessKeyName=', variables('iotHubKeyName'), ';SharedAccessKey=', listkeys(variables('iotHubKeyResource'), variables('iotHubVersion')).primaryKey)]"
},
"Azure.IoT.IoTHub.EventHub.Name": {
"type": "string",
"value": "[reference(variables('iotHubResourceId')).eventHubEndpoints.events.path]"
},
"Azure.IoT.IoTHub.EventHub.ConnectionString": {
"type": "string",
"value": "[concat('Endpoint=', reference(variables('iotHubResourceId')).eventHubEndpoints.events.endpoint, ';SharedAccessKeyName=', variables('iotHubKeyName'), ';SharedAccessKey=', listkeys(variables('iotHubKeyResource'), variables('iotHubVersion')).primaryKey)]"
},
"Azure.IoT.IoTHub.EventHub.ConsumerGroup": {
"type": "string",
"value": "[variables('websiteCGName')]"
},
"Azure.ServiceBus.EventHub.Name": {
"type": "string",
"value": "[variables('ehOutName')]"
},
"Azure.ServiceBus.EventHub.ConnectionString": {
"type": "string",
"value": "[listkeys(variables('sbResourceId'), variables('sbVersion')).primaryConnectionString]"
},
"Azure.ServiceBus.EventHub.ConsumerGroup": {
"type": "string",
"value": "[variables('websiteCGName')]"
},
"Azure.Storage.ConnectionString": {
"type": "string",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageName'), ';AccountKey=', listkeys(variables('storageId'), variables('storageVersion')).key1)]"
}
}
}
================================================
FILE: Azure/EHConsole/EHConsole/App.config
================================================
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<extensions>
<!-- In this extension section we are introducing all known service bus extensions. User can remove the ones they don't need. -->
<behaviorExtensions>
<add name="connectionStatusBehavior" type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</behaviorExtensions>
<bindingElementExtensions>
<add name="netMessagingTransport" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingTransportExtensionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="tcpRelayTransport" type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpsRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="onewayRelayTransport" type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingElementExtensions>
<bindingExtensions>
<add name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="webHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ws2007HttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netOnewayRelayBinding" type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netEventRelayBinding" type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingExtensions>
</extensions>
</system.serviceModel>
<appSettings>
<!-- Service Bus specific app setings for messaging connections -->
<add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=[your secret]" />
</appSettings>
</configuration>
================================================
FILE: Azure/EHConsole/EHConsole/Microsoft.ConnectTheDots.EHConsole.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AAAAA552-F973-4683-8CF9-8B719A69E49C}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.ConnectTheDots.EHConsole</RootNamespace>
<AssemblyName>EHConsole</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<NuGetPackageImportStamp>1610c4c5</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Hyak.Common">
<HintPath>..\..\AzurePrep\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common">
<HintPath>..\..\AzurePrep\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
<HintPath>..\..\AzurePrep\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
<HintPath>..\..\AzurePrep\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.5.207081303-alpha\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform">
<HintPath>..\..\AzurePrep\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.5.207081303-alpha\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ServiceBus, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\AzurePrep\packages\WindowsAzure.ServiceBus.2.7.5\lib\net40-full\Microsoft.ServiceBus.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks">
<HintPath>..\..\AzurePrep\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions">
<HintPath>..\..\AzurePrep\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop">
<HintPath>..\..\AzurePrep\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Common">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.ConfigurationManager.3.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.MediaServices">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Management.MediaServices.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.MediaServices.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Monitoring">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Management.Monitoring.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Monitoring.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Network">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Management.Network.7.0.3\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Scheduler">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Management.Scheduler.6.1.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.ServiceBus">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Management.ServiceBus.0.17.1-preview\lib\net40\Microsoft.WindowsAzure.Management.ServiceBus.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Sql">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Management.Sql.5.2.0\lib\net40\Microsoft.WindowsAzure.Management.Sql.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Storage">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Management.Storage.5.1.1\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.WebSites">
<HintPath>..\..\AzurePrep\packages\Microsoft.WindowsAzure.Management.WebSites.4.4.2-prerelease\lib\net40\Microsoft.WindowsAzure.Management.WebSites.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\AzurePrep\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Management" />
<Reference Include="System.Management.Instrumentation" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions">
<HintPath>..\..\AzurePrep\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives">
<HintPath>..\..\AzurePrep\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\license.txt">
<Link>Docs\license.txt</Link>
</Content>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\AzurePrep\Common\Microsoft.ConnectTheDots.CloudDeploy.Common.csproj">
<Project>{987E2AAB-AC91-4781-89B7-C1AD0AF01D8A}</Project>
<Name>Microsoft.ConnectTheDots.CloudDeploy.Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
================================================
FILE: Azure/EHConsole/EHConsole/Program.cs
================================================
// ---------------------------------------------------------------------------------
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
//
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ---------------------------------------------------------------------------------
namespace Microsoft.ConnectTheDots.EHConsole
{
using System;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
//--//
using Microsoft.Azure;
using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Messaging;
using Microsoft.WindowsAzure.Management.ServiceBus;
using Microsoft.WindowsAzure.Management.ServiceBus.Models;
using Microsoft.WindowsAzure.Management.Storage;
//--//
using Microsoft.ConnectTheDots.CloudDeploy.Common;
//--//
class Program
{
internal class CloudWebDeployInputs
{
public string NamePrefix;
public string SBNamespace;
public string Location;
public string StorageAccountName;
public SubscriptionCloudCredentials Credentials;
}
//--//
private static readonly LogBuffer _ConsoleBuffer = new LogBuffer(
( m ) =>
{
Console.WriteLine( m );
}
);
//--//
public bool GetInputs( out CloudWebDeployInputs result )
{
result = new CloudWebDeployInputs( );
result.Credentials = AzureConsoleHelper.GetUserSubscriptionCredentials( );
if( result.Credentials == null )
{
result = null;
return false;
}
ServiceBusNamespace selectedNamespace = AzureConsoleHelper.SelectNamespace( result.Credentials );
if( selectedNamespace == null )
{
result = null;
Console.WriteLine( "Quiting..." );
return false;
}
result.NamePrefix = selectedNamespace.Name;
if( result.NamePrefix.EndsWith( "-ns" ) )
{
result.NamePrefix = result.NamePrefix.Substring( 0, result.NamePrefix.Length - 3 );
}
result.SBNamespace = selectedNamespace.Name;
result.StorageAccountName = result.NamePrefix.ToLowerInvariant( ) + "storage";
result.Location = selectedNamespace.Region;
return true;
}
bool Run( )
{
CloudWebDeployInputs inputs = null;
if( !GetInputs( out inputs ) )
{
return false;
}
Console.WriteLine( "Retrieving namespace metadata..." );
// Create Namespace
ServiceBusManagementClient sbMgmt = new ServiceBusManagementClient( inputs.Credentials );
var nsDescription = sbMgmt.Namespaces.GetNamespaceDescription( inputs.SBNamespace );
string nsConnectionString = nsDescription.NamespaceDescriptions.First(
( d ) => String.Equals( d.AuthorizationType, "SharedAccessAuthorization" )
).ConnectionString;
NamespaceManager nsManager = NamespaceManager.CreateFromConnectionString( nsConnectionString );
EventHubDescription ehDevices = AzureConsoleHelper.SelectEventHub( nsManager, inputs.Credentials );
var serviceNamespace = inputs.SBNamespace;
var hubName = ehDevices.Path;
var sharedAccessAuthorizationRule = ehDevices.Authorization.FirstOrDefault( ( d )
=> d.Rights.Contains(AccessRights.Listen)) as SharedAccessAuthorizationRule;
if( sharedAccessAuthorizationRule == null )
{
Console.WriteLine( "Cannot locate Authorization rule for WebSite key." );
return false;
}
var receiverKeyName = sharedAccessAuthorizationRule.KeyName;
var receiverKey = sharedAccessAuthorizationRule.PrimaryKey;
//Console.WriteLine("Starting temperature processor with {0} partitions.", partitionCount);
CancellationTokenSource cts = new CancellationTokenSource( );
int closedReceivers = 0;
AutoResetEvent receiversStopped = new AutoResetEvent( false );
MessagingFactory factory = MessagingFactory.Create(ServiceBusEnvironment.CreateServiceUri( "sb", serviceNamespace, "" ),
new MessagingFactorySettings
{
TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider( receiverKeyName, receiverKey ),
TransportType = TransportType.Amqp
} );
EventHubClient eventHubClient = factory.CreateEventHubClient( hubName );
EventHubConsumerGroup eventHubConsumerGroup = eventHubClient.GetDefaultConsumerGroup( );
int partitionCount = ehDevices.PartitionCount;
for( int i = 0; i < partitionCount; i++ )
{
Task.Factory.StartNew( ( state ) =>
{
try
{
_ConsoleBuffer.Add( string.Format( "Starting worker to process partition: {0}", state ) );
var receiver = eventHubConsumerGroup.CreateReceiver( state.ToString( ), DateTime.UtcNow );
_ConsoleBuffer.Add( string.Format( "Waiting for start receiving messages: {0} ...", state ) );
while( true )
{
// Receive could fail, I would need a retry policy etc...
var messages = receiver.Receive( 10 );
foreach( var message in messages )
{
//var eventBody = Newtonsoft.Json.JsonConvert.DeserializeObject<TemperatureEvent>(Encoding.Default.GetString(message.GetBytes()));
//Console.WriteLine("{0} [{1}] Temperature: {2}", DateTime.Now, message.PartitionKey, eventBody.Temperature);
_ConsoleBuffer.Add( message.PartitionKey + " sent message:" + Encoding.Default.GetString( message.GetBytes( ) ) );
}
if( cts.IsCancellationRequested )
{
Console.WriteLine( "Stopping: {0}", state );
receiver.Close( );
if( Interlocked.Increment( ref closedReceivers ) >= partitionCount )
{
receiversStopped.Set();
}
break;
}
}
}
catch( Exception ex )
{
_ConsoleBuffer.Add( ex.Message );
}
}, i );
}
Console.ReadLine( );
cts.Cancel( );
//waiting for all receivers to stop
receiversStopped.WaitOne( );
bool saveToFile;
for( ;; )
{
Console.WriteLine( "Do you want to save received data to file? (y/n)" );
string answer = Console.ReadLine( );
string request = "do not";
saveToFile = false;
if( !string.IsNullOrEmpty( answer ) && answer.ToLower( ).StartsWith( "y" ) )
{
saveToFile = true;
request = "";
}
if( ConsoleHelper.Confirm( "Are you sure you " + request + " want to save received data?" ) )
{
break;
}
}
if( saveToFile )
{
string fileName = inputs.SBNamespace + DateTime.UtcNow.ToString( "_d_MMM_h_mm" ) + ".log";
string filePath = Environment.GetFolderPath( Environment.SpecialFolder.Desktop );
string fileFullName = filePath + @"\" + fileName;
if( _ConsoleBuffer.FlushToFile( fileFullName ) )
{
Console.WriteLine( "Output was saved to your desktop, at " + fileFullName + " file." );
}
}
Console.WriteLine( "Wait for all receivers to close and then press ENTER." );
Console.ReadLine( );
return true;
}
static int Main( string[] args )
{
var p = new Program( );
try
{
bool result = p.Run( );
return result ? 0 : 1;
}
catch ( Exception e )
{
Console.WriteLine( "Exception {0} at {1}", e.Message, e.StackTrace );
return 0;
}
}
}
}
================================================
FILE: Azure/EHConsole/EHConsole/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("EHConsole")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EHConsole")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("54c0c07c-bea0-423c-b360-03c11e593049")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
================================================
FILE: Azure/EHConsole/EHConsole/packages.config
================================================
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="3.5.207081303-alpha" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Common" version="1.4.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="12.2.0-preview" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Libraries" version="2.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.MediaServices" version="4.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Monitoring" version="4.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Network" version="7.0.3" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Scheduler" version="6.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.ServiceBus" version="0.17.1-preview" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Sql" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Storage" version="5.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.WebSites" version="4.4.2-prerelease" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="WindowsAzure.ServiceBus" version="2.7.5" targetFramework="net45" />
</packages>
================================================
FILE: Azure/EHConsole/EHConsole.sln
================================================
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.ConnectTheDots.EHConsole", "EHConsole\Microsoft.ConnectTheDots.EHConsole.csproj", "{AAAAA552-F973-4683-8CF9-8B719A69E49C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.ConnectTheDots.CloudDeploy.Common", "..\AzurePrep\Common\Microsoft.ConnectTheDots.CloudDeploy.Common.csproj", "{987E2AAB-AC91-4781-89B7-C1AD0AF01D8A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AAAAA552-F973-4683-8CF9-8B719A69E49C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AAAAA552-F973-4683-8CF9-8B719A69E49C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AAAAA552-F973-4683-8CF9-8B719A69E49C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AAAAA552-F973-4683-8CF9-8B719A69E49C}.Release|Any CPU.Build.0 = Release|Any CPU
{987E2AAB-AC91-4781-89B7-C1AD0AF01D8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{987E2AAB-AC91-4781-89B7-C1AD0AF01D8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{987E2AAB-AC91-4781-89B7-C1AD0AF01D8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{987E2AAB-AC91-4781-89B7-C1AD0AF01D8A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
================================================
FILE: Azure/EHConsole/nuget.config
================================================
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositorypath" value="..\AzurePrep\packages" />
</config>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
</configuration>
================================================
FILE: Azure/MachineLearning/MachineLearningCloudService.md
================================================
Once you have setup devices and Azure Event Hubs to receive data from your devices, you can do some analytics on the data.
Azure Machine Learning offers a wide range of APIs, along with a platform to create advanced machine learning algorithm.
In this example we use the Anomaly Detection API that is available on the [Azure Data Market](http://datamarket.azure.com/dataset/aml_labs/anomalydetection).
In order to implement the sample you will need to do one of the following (the instructions below assume you are doing the first one):
* [Sign up](http://datamarket.azure.com/checkout/f33b2da0-af7c-42dd-85eb-d625e688f876?ctpa=False) for the free trial (that gives you up to 25,000 transactions per month)
* Create your own Machine Learning endpoint (we are not covering this here, but you can learn how to do so [here](http://azure.microsoft.com/en-us/services/machine-learning/))
The sample consist in a Cloud Service that reads real time data from ehDevices Event Hub and calls the Machine Learning Anomaly Detection API, then sends alerts triggered by the API to the ehAlerts Event Hub so that Web sites and clients can display the alerts.
## Prerequisites ##
Make sure you have all software installed and necessary subscriptions as indicated in the Readme.md file for the project. To repeat them here, you need
1. Microsoft Azure subscription ([free trial subscription](http://azure.microsoft.com/en-us/pricing/free-trial/) is sufficient)
1. If you have not done so already, [Sign up](http://datamarket.azure.com/checkout/f33b2da0-af7c-42dd-85eb-d625e688f876?ctpa=False) for the Anomaly Detection API service.
1. Visual Studio 2013 – [Community Edition](http://www.visualstudio.com/downloads/download-visual-studio-vs)
In addition, you must have run the AzurePrep program discussed in that section, as it creates the event hubs from which the Cloud service pulls data. If you already have the event hubs, you can find information needed below in your Azure portal (see below)
## Deploy the Cloud Service ##
* Open the ConnectTheDots\Azure\AzurePrep\AzurePrep.sln solution in Visual Studio.
* Open and edit the configuration file WorkerHost\app.config:
* Find the lines for the Connection Strings (look for Microsoft.ServiceBus.ConnectionString, Microsoft.ServiceBus.ConnectionStringDevices and Microsoft.ServiceBus.ConnectionStringAlerts)
* Replace the connection strings with the appropriate values for your subscription, found in [https://manage.windowsazure.com](https://manage.windowsazure.com) as follows:
* **ServiceBus.ConnectionString**. Select Service Bus from the left nav menu, highlight the Namespace Name created earlier, click on Connection Information at the bottom of the screen, and copy the RootManagedSharedAccessKey.
* **ServiceBus.ConnectionStringDevices**. Select Service Bus from the left nav menu, select the Namespace Name created earlier, highlight ehdevices, click on Connection information at the bottom of the screen, and copy the WebSite Connection string.
* **ServiceBus.ConnectionStringAlerts**. Select Service Bus from the left nav menu, select the Namespace Name created earlier, highlight ehalerts, click on Connection information at the bottom of the screen, and copy the WebSite Connection string.
* Find the lines for the Anomaly Detection settings and edit appropriately
* **AnomalyDetectionApiUrl**:
* if you are using the data market API, keep the URL unchanged (https://api.datamarket.azure.com/aml_labs/anomalydetection/v1/)
* If you are using your own Machine Learning endpoint use its URL
* **AnomalyDetectionAuthKey**:
* If you are using the data market API, go to [https://datamarket.azure.com/account](https://datamarket.azure.com/account) (login in with the account used to subscribe to the Anomaly Detection API) and search for "Primary Account Key"
* If you are using your own Machine Learning endpoint use the authentication key provided.
* **LiveId**:
* If you are using the data market API, use the Windows ID you used to subscribe to the API
* If you are using your own Machine Learning endpoint this parameter is ignored
* **UseMarketApi**:
* If you are using the data market API, leave this one unchanged ("true")
* If you are using your own Machine Learning endpoint, set to "false".
* The settings **TukeyThresh** and **ZScoreThresh** can be adjusted to fine tune the Anomaly Detection algorithm.
* The **AlertsIntervalSec** sets the minimum time in seconds between 2 alerts from the Anomaly Detection algorithm
* You can test the service locally by hitting F5 in Visual Studio
* If you have created and published a website using the samples in this project, you should see anomalies detected in the charts and in the alerts table when sensors data changes.
* To deploy the Cloud Service, right click on the WorkerRole project, click on "Publish" and follow the prompts
================================================
FILE: Azure/MachineLearning/SQL/SQL.sqlproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Name>SQL</Name>
<SchemaVersion>2.0</SchemaVersion>
<ProjectVersion>4.1</ProjectVersion>
<ProjectGuid>{37fa4922-ac28-474c-9eb9-1544437997f8}</ProjectGuid>
<DSP>Microsoft.Data.Tools.Schema.Sql.SqlAzureDatabaseSchemaProvider</DSP>
<OutputType>Database</OutputType>
<RootPath>
</RootPath>
<RootNamespace>SQL</RootNamespace>
<AssemblyName>SQL</AssemblyName>
<ModelCollation>1033, CI</ModelCollation>
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
<DeployToDatabase>True</DeployToDatabase>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetLanguage>CS</TargetLanguage>
<AppDesignerFolder>Properties</AppDesignerFolder>
<SqlServerVerification>False</SqlServerVerification>
<IncludeCompositeObjects>True</IncludeCompositeObjects>
<TargetDatabaseSet>True</TargetDatabaseSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<!-- VS10 without SP1 will not have VisualStudioVersion set, so do that here -->
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<!-- Default to the v10.0 targets path if the targets file for the current VS version is not found -->
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<ItemGroup>
<Folder Include="Properties" />
<Folder Include="Tables" />
<Folder Include="StoredProcedures" />
<Folder Include="TableType" />
</ItemGroup>
<ItemGroup>
<Build Include="Tables\AlertsData.sql" />
<Build Include="StoredProcedures\InsertAlertsData.sql" />
<Build Include="TableType\AlertsDataTableType.sql" />
</ItemGroup>
</Project>
================================================
FILE: Azure/MachineLearning/SQL/StoredProcedures/InsertAlertsData.sql
================================================
CREATE PROCEDURE [dbo].[InsertAlertsData]
@dataList [dbo].[AlertsDataTableType] READONLY
AS
insert into [dbo].[AlertsData] ([value], [guid], [displayname], [organization], [unitofmeasure], [measurename], [location], [timecreated])
select [value], [guid], [displayname], [organization], [unitofmeasure], [measurename], [location], [timecreated] from @dataList
RETURN 0
================================================
FILE: Azure/MachineLearning/SQL/TableType/AlertsDataTableType.sql
================================================
CREATE TYPE [dbo].[AlertsDataTableType] AS TABLE(
[value] FLOAT NULL,
[guid] VARCHAR(40) NULL,
[organization] VARCHAR(20) NULL,
[displayname] VARCHAR(50) NULL,
[unitofmeasure] VARCHAR(10) NULL,
[measurename] VARCHAR(20) NULL,
[location] VARCHAR(120) NULL,
[timecreated] DATETIME NULL
)
================================================
FILE: Azure/MachineLearning/SQL/Tables/AlertsData.sql
================================================
CREATE TABLE [dbo].[AlertsData]
(
[Id] INT NOT NULL PRIMARY KEY IDENTITY,
[value] FLOAT NULL,
[guid] VARCHAR(40) NULL,
[organization] VARCHAR(20) NULL,
[displayname] VARCHAR(50) NULL,
[unitofmeasure] VARCHAR(10) NULL,
[measurename] VARCHAR(20) NULL,
[location] VARCHAR(120) NULL,
[timecreated] DATETIME NULL
)
================================================
FILE: Azure/MachineLearning/WorkerHost/Analyzer.cs
================================================
//#define DEBUG_LOG
using System;
using System.Collections.Generic;
using System.Data.Services.Client;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using Microsoft.WindowsAzure.Diagnostics;
namespace WorkerHost
{
class ADResult
{
[DataMember]
public string table { get; set; }
public List<AnomalyRecord> GetADResults()
{
var rowDelim = ";";
var colDelim = ",";
var rows = table.Split(new string[] { rowDelim }, StringSplitOptions.RemoveEmptyEntries);
List<AnomalyRecord> series = new List<AnomalyRecord>();
for (int i = 0; i < rows.Length; i++)
{
var row = rows[i].Replace("\"", "").Trim();
if (i == 0 || row.Length == 0)
{
continue; // ignore headers and empty rows
}
var cols = row.Split(new string[] { colDelim }, StringSplitOptions.RemoveEmptyEntries);
series.Add(AnomalyRecord.Parse(cols));
}
return series;
}
}
class Analyzer
{
private static string _detectorUrl;
private static string _detectorAuthKey;
private static string _liveId;
private static string _spikeDetectorParams;
private static bool _useMarketApi;
public Analyzer(string anomalyDetectionApiUrl, string anomalyDetectionAuthKey, string liveId, bool useMarketApi, string tukeyThresh, string zscoreThresh)
{
_detectorUrl = anomalyDetectionApiUrl;
_detectorAuthKey = anomalyDetectionAuthKey;
_liveId = liveId;
_useMarketApi = useMarketApi;
_spikeDetectorParams = string.Format("SpikeDetector.TukeyThresh={0}; SpikeDetector.ZscoreThresh={1}", tukeyThresh, zscoreThresh);
}
public Task<AnomalyRecord[]> Analyze(SensorDataContract[] data)
{
var timeSeriesData = GetTimeseriesData(data);
#if DEBUG_LOG
Trace.TraceInformation("AzureML request: {0}", timeSeriesData);
#endif
if (_useMarketApi)
{
return Task.Run(() => GetAlertsFromAnomalyDetectionAPI(timeSeriesData));
}
return GetAlertsFromRRS(timeSeriesData);
}
private static string GetTimeseriesData(SensorDataContract[] data)
{
var step = 1;
var prevTime = DateTime.MinValue;
var prevVal = 0d;
List<SensorDataContract> newData = new List<SensorDataContract>();
foreach (var d in data.OrderBy(dd => dd.TimeCreated))
{
d.TimeCreated = d.TimeCreated.AddTicks(-(d.TimeCreated.Ticks % TimeSpan.TicksPerSecond)); // round off the millisecs
if (prevTime != DateTime.MinValue)
{
for (; prevTime.AddSeconds(step) < d.TimeCreated; )
{
prevTime = prevTime.AddSeconds(step);
newData.Add(new SensorDataContract { TimeCreated = prevTime, Value = prevVal });
}
}
newData.Add(d);
prevTime = d.TimeCreated;
prevVal = d.Value;
}
var sb = new StringBuilder();
foreach (var d in newData)
{
sb.Append(string.Format("{0}={1};", d.TimeCreated.ToString("O"), d.Value));
}
return sb.ToString();
}
public static double FindMaxValue(IEnumerable<double> values)
{
var avg = values.Average();
var sd = Math.Sqrt(values.Average(v => Math.Pow(v - avg, 2)));
return avg + 5 * sd;
}
private AnomalyRecord[] filterAnomaly(IEnumerable<AnomalyRecord> analyzedRecords)
{
return analyzedRecords.Where(ar => ar.Spike1 == 1 || ar.Spike2 == 1 || ar.LevelScore > 3).ToArray();
}
public AnomalyRecord[] GetAlertsFromAnomalyDetectionAPI(string timeSeriesData)
{
var acitionUri = new Uri(_detectorUrl);
var cred = new NetworkCredential(_liveId, _detectorAuthKey); // your Microsoft live Id here
var cache = new CredentialCache();
cache.Add(acitionUri, "Basic", cred);
DataServiceContext ctx = new DataServiceContext(acitionUri);
ctx.Credentials = cache;
var query = ctx.Execute<ADResult>(acitionUri, "POST", true,
new BodyOperationParameter("data", timeSeriesData),
new BodyOperationParameter("params", _spikeDetectorParams));
var resultTable = query.FirstOrDefault();
var results = resultTable.GetADResults();
var presults = results;
return filterAnomaly(presults);
}
private Task<AnomalyRecord[]> GetAlertsFromRRS(string timeSeriesData)
{
var rrs = _detectorUrl;
var apikey = _detectorAuthKey;
using (var wb = new WebClient())
{
wb.Headers[HttpRequestHeader.ContentType] = "application/json";
wb.Headers.Add(HttpRequestHeader.Authorization, "Bearer " + apikey);
var featureVector =
string.Format("\"data\": \"{0}\",\"params\": \"{1}\"", timeSeriesData, _spikeDetectorParams);
string jsonData = "{\"Id\":\"scoring0001\", \"Instance\": {\"FeatureVector\": {" + featureVector + "}, \"GlobalParameters\":{\"level_mhist\": 300, \"level_shist\": 100, \"trend_mhist\": 300, \"trend_shist\": 100 }}}";
var jsonBytes = Encoding.Default.GetBytes(jsonData);
return wb.UploadDataTaskAsync(rrs, "POST", jsonBytes)
.ContinueWith(
resp =>
{
var response = Encoding.Default.GetString(resp.Result);
#if DEBUG_LOG
Trace.TraceInformation("AzureML response: {0}...", response.Substring(0, Math.Min(100, response.Length)));
#endif
JavaScriptSerializer ser = new JavaScriptSerializer { MaxJsonLength = int.MaxValue };
var results = ser.Deserialize<List<string[]>>(response);
var presults = results.Select(AnomalyRecord.Parse);
return filterAnomaly(presults);
}
);
}
}
}
}
================================================
FILE: Azure/MachineLearning/WorkerHost/AnomalyRecord.cs
================================================
using System;
namespace WorkerHost
{
public class AnomalyRecord
{
public DateTime Time { get; set; }
public double Data { get; set; }
public int Spike1 { get; set; }
public int Spike2 { get; set; }
public double LevelScore { get; set; }
public int LevelAlert { get; set; }
public double TrendScore { get; set; }
public int TrendAlert { get; set; }
public static AnomalyRecord Parse(string[] values)
{
if (values.Length < 8)
throw new ArgumentException("Anomaly Record expects 8 values.");
return new AnomalyRecord()
{
Time = DateTime.Parse(values[0]),
Data = double.Parse(values[1]),
Spike1 = int.Parse(values[2]),
Spike2 = int.Parse(values[3]),
LevelScore = double.Parse(values[4]),
LevelAlert = int.Parse(values[5]),
TrendScore = double.Parse(values[6]),
TrendAlert = int.Parse(values[7]),
};
}
public override string ToString()
{
return Time.ToLocalTime() + ", " + Data + ", " + Spike1 + ", " + Spike2 + ", " +
LevelScore + ", " + LevelAlert + ", " + TrendScore + ", " + TrendAlert;
}
}
}
================================================
FILE: Azure/MachineLearning/WorkerHost/App.config
================================================
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add name="consoleListener" type="System.Diagnostics.ConsoleTraceListener"/>
</listeners>
</trace>
</system.diagnostics>
<system.serviceModel>
<extensions>
<!-- In this extension section we are introducing all known service bus extensions. User can remove the ones they don't need. -->
<behaviorExtensions>
<add name="connectionStatusBehavior"
type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="transportClientEndpointBehavior"
type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="serviceRegistrySettings"
type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</behaviorExtensions>
<bindingElementExtensions>
<add name="netMessagingTransport"
type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingTransportExtensionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="tcpRelayTransport"
type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="httpRelayTransport"
type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="httpsRelayTransport"
type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="onewayRelayTransport"
type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</bindingElementExtensions>
<bindingExtensions>
<add name="basicHttpRelayBinding"
type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="webHttpRelayBinding"
type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ws2007HttpRelayBinding"
type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="netTcpRelayBinding"
type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="netOnewayRelayBinding"
type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="netEventRelayBinding"
type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="netMessagingBinding"
type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</bindingExtensions>
</extensions>
</system.serviceModel>
<appSettings>
<add key="sendToBlob" value="true" />
<add key="sendToSQL" value="true" />
<!--Service Bus specific app settings for messaging connections-->
<add key="Microsoft.ServiceBus.EventHubDevices" value="ehdevices" />
<add key="Microsoft.ServiceBus.EventHubAlerts" value="ehalerts" />
<add key="Microsoft.ServiceBus.ConnectionString" value="[ServiceBus connection string]" />
<add key="Microsoft.ServiceBus.ConnectionStringDevices" value="[EH Devices connection string]" />
<add key="Microsoft.ServiceBus.ConnectionStringAlerts" value="[EH Alerts connection string]" />
<add key="Microsoft.Storage.ConnectionString" value="[Storage connection string]" />
<!--Blob output settings-->
<add key="blobContainerName" value="MLOutputs" />
<add key="blobNamePrefix" value="alerts" />
<!--SQL connection string for output to SQL table-->
<add key="sqlDatabaseConnectionString" value="[Your SQL connection string here]" />
<!--Machine Learning API settings for messaging connections-->
<add key="AnomalyDetectionApiUrl" value="https://api.datamarket.azure.com/data.ashx/aml_labs/anomalydetection/v1/Score" />
<add key="AnomalyDetectionAuthKey" value="Your Auth Key" />
<add key="LiveId" value="your@live.id" />
<add key="UseMarketApi" value="true" />
<add key="MessagesBufferSize" value="200" />
<add key="TukeyThresh" value="7" /><!--Higher values will catch higher spikes-->
<add key="ZscoreThresh" value="7" /><!--Higher values will catch higher spikes-->
<add key="AlertsIntervalSec" value="5" />
<!--You can filter the type of data we want to send to the anomaly detection job
Just put the Measure Name you want separated by spaces. Leave empty ("") if you want to send all data types-->
<add key="MeasureNameFilter" value="Sound" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
================================================
FILE: Azure/MachineLearning/WorkerHost/CircularBuffer.cs
================================================
using System.Collections.Generic;
namespace WorkerHost
{
public class CircularBuffer<T>
{
private readonly Queue<T> _queue;
private readonly int _size;
public CircularBuffer(int size)
{
_queue = new Queue<T>(size);
_size = size;
}
public int Count
{
get { return _queue.Count; }
}
public void Add(T obj)
{
if (_queue.Count == _size)
{
_queue.Dequeue();
}
_queue.Enqueue(obj);
}
public T[] GetAll()
{
return _queue.ToArray();
}
}
}
================================================
FILE: Azure/MachineLearning/WorkerHost/Data.Outputs/BlobWriter.cs
================================================
using System;
using System.IO;
using System.Text;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
namespace WorkerHost.Data.Outputs
{
public class BlobWriter
{
private CloudBlobContainer _ContainerReference;
private CloudBlockBlob _Blob;
private Stream _StreamWriter;
public bool Connect(string blobNamePrefix, string containerName, string storageConnectionString)
{
try
{
_ContainerReference = SetUpContainer(storageConnectionString, containerName);
_ContainerReference.CreateIfNotExists();
_Blob = _ContainerReference.GetBlockBlobReference(blobNamePrefix + DateTime.UtcNow.Ticks);
_StreamWriter = _Blob.OpenWrite();
}
catch (Exception)
{
return false;
}
return true;
}
public void WriteLine(string line)
{
if (_StreamWriter == null)
{
return;
}
try
{
var jsonBytes = Encoding.UTF8.GetBytes(line);
_StreamWriter.Write(jsonBytes, 0, jsonBytes.Length);
}
catch (Exception)
{
}
}
public void Flush()
{
try
{
_StreamWriter.Flush();
}
catch (Exception)
{
}
}
private CloudBlobContainer SetUpContainer(string storageConnectionString,
string containerName)
{
CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(storageConnectionString);
CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();
CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference(containerName);
return cloudBlobContainer;
}
}
}
================================================
FILE: Azure/MachineLearning/WorkerHost/Data.Outputs/SQLOutputRepository.cs
================================================
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
namespace WorkerHost.Data.Outputs
{
public class SQLOutputRepository
{
private const string ValueTableField = "value";
private const string GuidTableField = "guid";
private const string OrganizationTableField = "organization";
private const string DisplayNameTableField = "displayname";
private const string UnitOfMeasureTableField = "unitofmeasure";
private const string MeasureNameTableField = "measurename";
private const string LocationTableField = "location";
private const string TimeCreatedTableField = "timecreated";
private const string InsertStoreProcedure = "InsertAlertsData";
private const string InsertParameter = "@dataList";
private const string TableType = "AlertsDataTableType";
private readonly string _sqlDatabaseConnectionString;
public SQLOutputRepository(string sqlDatabaseConnectionString)
{
_sqlDatabaseConnectionString = sqlDatabaseConnectionString;
}
public void ProcessEvents(IList<SensorDataContract> eventDataList)
{
if (eventDataList == null)
{
return;
}
try
{
using (var sqlConnection = new SqlConnection(_sqlDatabaseConnectionString))
{
sqlConnection.Open();
var table = new DataTable();
// Add columns to the table
table.Columns.Add(ValueTableField, typeof(double));
table.Columns.Add(GuidTableField, typeof(string));
table.Columns.Add(OrganizationTableField, typeof(string));
table.Columns.Add(DisplayNameTableField, typeof(string));
table.Columns.Add(UnitOfMeasureTableField, typeof(string));
table.Columns.Add(MeasureNameTableField, typeof(string));
table.Columns.Add(LocationTableField, typeof(string));
table.Columns.Add(TimeCreatedTableField, typeof(DateTime));
// Add rows to the table
foreach (var eventData in eventDataList)
{
table.Rows.Add(eventData.Value,
eventData.Guid,
eventData.Organization,
eventData.DisplayName,
eventData.UnitOfMeasure,
eventData.MeasureName,
eventData.Location,
eventData.TimeCreated);
}
// Create command
var sqlCommand = new SqlCommand(InsertStoreProcedure, sqlConnection)
{
CommandType = CommandType.StoredProcedure
};
// Add table-valued parameter
sqlCommand.Parameters.Add(new SqlParameter
{
ParameterName = InsertParameter,
SqlDbType = SqlDbType.Structured,
TypeName = TableType,
Value = table,
});
// Execute the query
sqlCommand.ExecuteNonQuery();
}
}
catch (Exception ex)
{
}
}
}
}
================================================
FILE: Azure/MachineLearning/WorkerHost/Data.Outputs/Utils/SqlDBReaderSafeParser.cs
================================================
using System;
using System.Data.SqlClient;
using System.Reflection;
namespace WorkerHost.Data.Outputs.Utils
{
public static class SqlDBReaderSafeParser
{
public static T SafeParse<T>(this SqlDataReader reader, string columnName, T defaultValue = default(T))
{
object dataValue = reader[columnName];
T convertedValue = dataValue.SafeParse(defaultValue);
return convertedValue;
}
public static T SafeParse<T>(this object dataValue, T defaultValue)
{
if (null == dataValue || DBNull.Value == dataValue)
return defaultValue;
Type t = typeof(T);
if (t.IsInstanceOfType(dataValue))
{
T convertedValue = (T)dataValue;
return convertedValue;
}
MethodInfo method = t.GetMethod("op_Implicit", new[] { dataValue.GetType() });
T result;
if (method != null)
{
result = (T)method.Invoke(null, new[] { dataValue });
}
else
{
result = defaultValue;
}
return result;
}
}
}
================================================
FILE: Azure/MachineLearning/WorkerHost/EventHubReader.cs
================================================
//#define DEBUG_LOG
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Messaging;
using Newtonsoft.Json;
using Microsoft.WindowsAzure.Diagnostics;
namespace WorkerHost
{
class EventHubReader
{
private const int DEFAULT_BUFFER_SIZE = 200;
private const int MIN_COUNT_FOR_ANALYSIS = 10;
private static int _bufferSize;
private EventHubReceiver[] _receivers = null;
private string _consumerGroupPrefix;
//DateTime[] _receiversLastUpdate = null;
private Task[] _tasks = null;
private Dictionary<string, CircularBuffer<SensorDataContract>> _buffers;
private object _lock = new object();
//object _lockNoData = new object();
private string _measureNameFilter;
internal ManualResetEvent FailureEvent = new ManualResetEvent(false);
public EventHubReader(int messagesBufferSize, string consumerGroupPrefix = "Local")
{
if (messagesBufferSize == 0)
{
_bufferSize = DEFAULT_BUFFER_SIZE;
}
else
{
_bufferSize = messagesBufferSize;
}
_consumerGroupPrefix = consumerGroupPrefix;
}
public void Close()
{
if (_receivers != null)
{
foreach (var r in _receivers)
{
r.CloseAsync();
}
}
}
public void Run(string connectionString, string hubName, string measureNameFilter)
{
NamespaceManager nsmgr = NamespaceManager.CreateFromConnectionString(connectionString);
EventHubDescription desc = nsmgr.GetEventHub(hubName);
string consumerGroupName = _consumerGroupPrefix + DateTime.UtcNow.Ticks.ToString();
ConsumerGroupDescription consumerGroupDesc = nsmgr.CreateConsumerGroupIfNotExists(new ConsumerGroupDescription(hubName, consumerGroupName));
EventHubClient client = EventHubClient.CreateFromConnectionString(connectionString, hubName);
int numPartitions = desc.PartitionCount;
_receivers = new EventHubReceiver[numPartitions];
//_receiversLastUpdate = new DateTime[numPartitions];
//for (int i = 0; i < numPartitions; i++)
//{
// _receiversLastUpdate[i] = DateTime.UtcNow;
//}
_tasks = new Task[numPartitions];
_buffers = new Dictionary<string, CircularBuffer<SensorDataContract>>();
_measureNameFilter = measureNameFilter;
for (int iPart = 0; iPart < desc.PartitionCount; iPart++)
{
EventHubReceiver receiver = client.GetConsumerGroup(consumerGroupName).CreateReceiver(
desc.PartitionIds[iPart], DateTime.UtcNow - TimeSpan.FromMinutes(2));
_receivers[iPart] = receiver;
Task<IEnumerable<EventData>> task = receiver.ReceiveAsync(1000, TimeSpan.FromSeconds(1));
int thisPart = iPart;
task.ContinueWith(new Action<Task<IEnumerable<EventData>>>((t) => OnTaskComplete(t, thisPart)));
_tasks[iPart] = task;
}
}
//void ProcessNoData()
//{
// lock (_lockNoData)
// {
// DateTime now = DateTime.UtcNow;
// if (_receiversLastUpdate.All(d => now - d > TimeSpan.FromMinutes(3)))
// {
// Trace.TraceError("No data for the last 3 minutes. Reinitializing");
// FailureEvent.Set();
// }
// }
//}
void Process(int iPart, bool firstReport, IEnumerable<EventData> batch)
{
UTF8Encoding enc = new UTF8Encoding();
foreach (EventData e in batch)
{
string body = enc.GetString(e.GetBytes());
string[] lines = body.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var line in lines)
{
try
{
var payload = JsonConvert.DeserializeObject<IDictionary<string, object>>(line);
var sensorData = new SensorDataContract
{
DisplayName = (string) payload["displayname"],
Guid = (string) payload["guid"],
Location = (string) payload["location"],
MeasureName = (string) payload["measurename"],
Organization = (string) payload["organization"],
TimeCreated = (DateTime)payload["timecreated"],
UnitOfMeasure = (string) payload["unitofmeasure"],
Value = (double) payload["value"]
};
var from = sensorData.UniqueId();
// Filter on MeasureName
if ((_measureNameFilter.Length == 0) ||
(_measureNameFilter.IndexOf(sensorData.MeasureName) >= 0))
{
lock (_lock)
{
CircularBuffer<SensorDataContract> buffer;
if (!_buffers.TryGetValue(from, out buffer))
{
buffer = new CircularBuffer<SensorDataContract>(_bufferSize);
_buffers.Add(from, buffer);
}
buffer.Add(sensorData);
#if DEBUG_LOG
Console.WriteLine("Data from device {0}, Total count: {1}", from, buffer.Count);
#endif
}
}
}
catch (Exception)
{
#if DEBUG_LOG
Trace.TraceError("Ignored invalid event data: {0}", line);
#endif
}
}
}
//lock (_lockNoData)
//{
// _receiversLastUpdate[iPart] = DateTime.UtcNow;
//}
}
public Dictionary<string, SensorDataContract[]> GetHistoricData()
{
lock (_lock)
{
return _buffers.Where(kvp => kvp.Value.Count > MIN_COUNT_FOR_ANALYSIS)
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.GetAll());
}
}
void OnTaskComplete(Task<IEnumerable<EventData>> task, int iPart)
{
try
{
if (task.IsCompleted)
{
IEnumerable<EventData> batch = task.Result;
if (batch != null && batch.Count() != 0)
{
#if DEBUG_LOG
Debug.WriteLine("Partition {0}, {1} events", iPart, batch.Count());
#endif
Process(iPart, false, batch);
}
else
{
//ProcessNoData();
}
}
else
{
#if DEBUG_LOG
Trace.TraceError("Event hub reader {0} did not complete successfully : {1}", iPart,
task.Exception == null ? "" : task.Exception.ToString());
#endif
FailureEvent.Set();
}
Task<IEnumerable<EventData>> newTask = _receivers[iPart].ReceiveAsync(1000, TimeSpan.FromSeconds(1));
int thisPart = iPart;
newTask.ContinueWith(new Action<Task<IEnumerable<EventData>>>((t) => OnTaskComplete(t, thisPart)));
this._tasks[iPart] = newTask;
}
catch (Exception e)
{
#if DEBUG_LOG
Trace.TraceError(e.ToString());
#endif
FailureEvent.Set();
}
}
}
}
================================================
FILE: Azure/MachineLearning/WorkerHost/Program.cs
================================================
//#define DEBUG_LOG
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.ServiceBus.Messaging;
using Microsoft.WindowsAzure.Diagnostics;
using Microsoft.WindowsAzure.ServiceRuntime;
using Newtonsoft.Json;
using WorkerHost.Data.Outputs;
namespace WorkerHost
{
public class WorkerHost : RoleEntryPoint
{
public class Configuration
{
public string AlertEHConnectionString;
public string AlertEHName;
public string DeviceEHConnectionString;
public string DeviceEHName;
public string AnomalyDetectionApiUrl;
public string AnomalyDetectionAuthKey;
public string LiveId;
public string MeasureNameFilter;
public string TukeyThresh;
public string ZscoreThresh;
public bool UseMarketApi;
public int MessagesBufferSize;
public int AlertsIntervalSec;
public string StorageConnectionString;
public string BlobContainerName;
public string BlobNamePrefix;
public string SqlDatabaseConnectionString;
}
private static Analyzer _analyzer;
private static EventHubReader _eventHubReader;
private static Timer _timer;
private static BlobWriter _blobWriter;
private static SQLOutputRepository _sqlOutputRepository;
static void Main()
{
StartHost("LocalWorker");
}
public override void Run()
{
StartHost("WorkerRole");
}
private static void StartHost(string consumerGroupPrefix)
{
Trace.WriteLine("Starting Worker...");
#if DEBUG_LOG
RoleEnvironment.TraceSource.TraceInformation("Starting Worker...");
#endif
var config = new Configuration();
config.AlertEHConnectionString = ConfigurationManager.AppSettings.Get("Microsoft.ServiceBus.ConnectionStringAlerts");
config.AlertEHName = ConfigurationManager.AppSettings.Get("Microsoft.ServiceBus.EventHubAlerts");
config.DeviceEHConnectionString = ConfigurationManager.AppSettings.Get("Microsoft.ServiceBus.ConnectionStringDevices");
config.DeviceEHName = ConfigurationManager.AppSettings.Get("Microsoft.ServiceBus.EventHubDevices"); ;
config.AnomalyDetectionApiUrl = ConfigurationManager.AppSettings.Get("AnomalyDetectionApiUrl");
config.AnomalyDetectionAuthKey = ConfigurationManager.AppSettings.Get("AnomalyDetectionAuthKey");
config.LiveId = ConfigurationManager.AppSettings.Get("LiveId");
config.MeasureNameFilter = ConfigurationManager.AppSettings.Get("MeasureNameFilter");
config.TukeyThresh = ConfigurationManager.AppSettings.Get("TukeyThresh");
config.ZscoreThresh = ConfigurationManager.AppSettings.Get("ZscoreThresh");
bool.TryParse(ConfigurationManager.AppSettings.Get("UseMarketApi"), out config.UseMarketApi);
int.TryParse(ConfigurationManager.AppSettings.Get("MessagesBufferSize"), out config.MessagesBufferSize);
int.TryParse(ConfigurationManager.AppSettings.Get("AlertsIntervalSec"), out config.AlertsIntervalSec);
config.StorageConnectionString = ConfigurationManager.AppSettings.Get("Microsoft.Storage.ConnectionString");
config.BlobContainerName = ConfigurationManager.AppSettings.Get("blobContainerName");
config.BlobNamePrefix = ConfigurationManager.AppSettings.Get("blobNamePrefix");
config.SqlDatabaseConnectionString = ConfigurationManager.AppSettings.Get("sqlDatabaseConnectionString");
_analyzer = new Analyzer(config.AnomalyDetectionApiUrl, config.AnomalyDetectionAuthKey,
config.LiveId, config.UseMarketApi, config.TukeyThresh, config.ZscoreThresh);
_eventHubReader = new EventHubReader(config.MessagesBufferSize, consumerGroupPrefix);
if (ConfigurationManager.AppSettings.Get("sendToBlob") == "true")
{
_blobWriter = new BlobWriter();
if (_blobWriter.Connect(config.BlobNamePrefix, config.BlobContainerName, config.StorageConnectionString))
{
_blobWriter = null;
}
}
if (ConfigurationManager.AppSettings.Get("sendToSQL") == "true")
{
_sqlOutputRepository = new SQLOutputRepository(config.SqlDatabaseConnectionString);
}
Process(config);
}
public static void Process(Configuration config)
{
var alertEventHub = EventHubClient.CreateFromConnectionString(config.AlertEHConnectionString, config.AlertEHName);
Trace.TraceInformation("Starting to receive messages...");
_eventHubReader.Run(config.DeviceEHConnectionString, config.DeviceEHName, config.MeasureNameFilter);
var timerInterval = TimeSpan.FromSeconds(1);
var alertLastTimes = new Dictionary<string, DateTime>();
TimerCallback timerCallback = state =>
{
var historicData = _eventHubReader.GetHistoricData();
try
{
var tasks = historicData.ToDictionary(kvp => kvp.Key, kvp => _analyzer.Analyze(kvp.Value));
Task.WaitAll(tasks.Values.ToArray());
List<SensorDataContract> alertsToSQl = new List<SensorDataContract>();
foreach (var kvp in tasks)
{
var key = kvp.Key;
var alerts = kvp.Value.Result;
DateTime alertLastTime;
if (!alertLastTimes.TryGetValue(@key, out alertLastTime))
{
alertLastTime = DateTime.MinValue;
}
foreach (var alert in alerts)
{
if ((alert.Time - alertLastTime).TotalSeconds >= config.AlertsIntervalSec)
{
Trace.TraceInformation("Alert - {0}", alert.ToString());
string eventJSON = OutputResults(key, historicData[key].LastOrDefault(), alert);
alertEventHub.Send(
new EventData(Encoding.UTF8.GetBytes(eventJSON)));
alertLastTime = alert.Time;
alertLastTimes[@key] = alertLastTime;
if (historicData[key].Length > 0)
{
alertsToSQl.Add(historicData[key].Last());
if (_blobWriter != null)
{
_blobWriter.WriteLine(eventJSON);
}
}
}
}
}
if (_sqlOutputRepository != null)
{
_sqlOutputRepository.ProcessEvents(alertsToSQl);
}
if (_blobWriter != null)
{
_blobWriter.Flush();
}
}
catch (Exception e)
{
#if DEBUG_LOG
Trace.TraceError(e.Message);
Trace.TraceError(e.ToString());
#endif
//throw;
}
_timer.Change((int)timerInterval.TotalMilliseconds, Timeout.Infinite);
};
_timer = new Timer(timerCallback, null, Timeout.Infinite, Timeout.Infinite);
_timer.Change(0, Timeout.Infinite);
Trace.TraceInformation("Reading events from Event Hub (press ctrl+c to abort)");
var exitEvent = new ManualResetEvent(false);
Console.CancelKeyPress += (sender, eventArgs) =>
{
eventArgs.Cancel = true;
exitEvent.Set();
};
int index = WaitHandle.WaitAny(new[] {exitEvent, _eventHubReader.FailureEvent});
Trace.TraceInformation("Exiting...");
_timer.Change(Timeout.Infinite, Timeout.Infinite);
Thread.Sleep(timerInterval);
_timer.Dispose();
_eventHubReader.Close();
}
public static IEnumerable<IEnumerable<T>> Batch<T>(IEnumerable<T> collection, int batchSize)
{
List<T> nextbatch = new List<T>(batchSize);
foreach (T item in collection)
{
nextbatch.Add(item);
if (nextbatch.Count == batchSize)
{
yield return nextbatch;
nextbatch = new List<T>();
}
}
if (nextbatch.Count > 0)
yield return nextbatch;
}
private static string OutputResults(string from, SensorDataContract sensorMeta, AnomalyRecord alert)
{
return JsonConvert.SerializeObject(
new
{
guid = sensorMeta.Guid,
displayname = sensorMeta.DisplayName,
measurename = sensorMeta.MeasureName,
unitofmeasure = sensorMeta.UnitOfMeasure,
location = sensorMeta.Location,
organization = sensorMeta.Organization,
timecreated = alert.Time.ToLocalTime(),
value = alert.Data,
alerttype = "MLModelAlert",
message = "Anomaly detected by Machine Learning model."
});
}
}
}
================================================
FILE: Azure/MachineLearning/WorkerHost/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WorkerHost")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WorkerHost")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("76fab21f-d875-451d-abf7-e8c352fc7a9f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
================================================
FILE: Azure/MachineLearning/WorkerHost/SensorDataContract.cs
================================================
using System;
using System.Runtime.Serialization;
namespace WorkerHost
{
public class SensorDataContract
{
[DataMember(Name = "value")]
public double Value { get; set; }
[DataMember(Name = "guid")]
public string Guid { get; set; }
[DataMember(Name = "organization")]
public string Organization { get; set; }
[DataMember(Name = "displayname")]
public string DisplayName { get; set; }
[DataMember(Name = "unitofmeasure")]
public string UnitOfMeasure { get; set; }
[DataMember(Name = "measurename")]
public string MeasureName { get; set; }
[DataMember(Name = "location")]
public string Location { get; set; }
[DataMember(Name = "timecreated")]
public DateTime TimeCreated { get; set; }
public string UniqueId()
{
//we could have devices with same DisplayName but different MeasureName etc..
return DisplayName + Guid + MeasureName;
}
}
}
================================================
FILE: Azure/MachineLearning/WorkerHost/WorkerHost.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{25079398-1602-45EE-837C-D4195A1FBC27}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WorkerHost</RootNamespace>
<AssemblyName>WorkerHost</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
<RoleType>Worker</RoleType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>95CCA3EE94BEF7B07D71337320FD2BBC359DC7C6</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>WorkerHost_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Hyak.Common">
<HintPath>..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common">
<HintPath>..\packages\Microsoft.Azure.Common.2.0.4\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
<HintPath>..\packages\Microsoft.Azure.Common.2.0.4\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.KeyVault.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.OData.5.6.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Services.Client.5.6.4\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.1.203031538-alpha\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform">
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.1.203031538-alpha\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ServiceBus, Version=2.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\WindowsAzure.ServiceBus.2.6.4\lib\net40-full\Microsoft.ServiceBus.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Common">
<HintPath>..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework">
<HintPath>..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.ServiceBus">
<HintPath>..\packages\Microsoft.WindowsAzure.Management.ServiceBus.0.17.1-preview\lib\net40\Microsoft.WindowsAzure.Management.ServiceBus.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=5.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAzure.Storage.5.0.2\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.7.0.1-beta1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Management" />
<Reference Include="System.Management.Instrumentation" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Spatial, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Spatial.5.6.4\lib\net40\System.Spatial.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Analyzer.cs" />
<Compile Include="AnomalyRecord.cs" />
<Compile Include="CircularBuffer.cs" />
<Compile Include="Data.Outputs\BlobWriter.cs" />
<Compile Include="Data.Outputs\SQLOutputRepository.cs" />
<Compile Include="Data.Outputs\Utils\SqlDBReaderSafeParser.cs" />
<Compile Include="SensorDataContract.cs" />
<Compile Include="EventHubReader.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
================================================
FILE: Azure/MachineLearning/WorkerHost/packages.config
================================================
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.0.4" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" />
<package id="Microsoft.Data.Edm" version="5.6.4" targetFramework="net45" />
<package id="Microsoft.Data.OData" version="5.6.4" targetFramework="net45" />
<package id="Microsoft.Data.Services.Client" version="5.6.4" targetFramework="net45" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="3.1.203031538-alpha" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Common" version="1.4.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="9.2.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Libraries" version="2.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.MediaServices" version="4.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Monitoring" version="4.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Network" version="6.1.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Scheduler" version="6.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.ServiceBus" version="0.17.1-preview" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Sql" version="5.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Storage" version="5.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.WebSites" version="4.4.2-prerelease" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1-beta1" targetFramework="net45" />
<package id="System.Spatial" version="5.6.4" targetFramework="net45" />
<package id="WindowsAzure.ServiceBus" version="2.6.4" targetFramework="net45" />
<package id="WindowsAzure.Storage" version="5.0.2" targetFramework="net45" />
</packages>
================================================
FILE: Azure/MachineLearning/WorkerHost.sln
================================================
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkerHost", "WorkerHost\WorkerHost.csproj", "{25079398-1602-45EE-837C-D4195A1FBC27}"
EndProject
Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "WorkerRole", "WorkerRole\WorkerRole.ccproj", "{73173D11-AA67-4089-91D5-BBE0BD4C5444}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SQL", "SQL", "{09DB6871-3FA4-4C09-B41C-CE017586DC5D}"
EndProject
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "SQL", "SQL\SQL.sqlproj", "{37FA4922-AC28-474C-9EB9-1544437997F8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{25079398-1602-45EE-837C-D4195A1FBC27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25079398-1602-45EE-837C-D4195A1FBC27}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25079398-1602-45EE-837C-D4195A1FBC27}.Release|Any CPU.ActiveCfg = Release|Any CPU
{25079398-1602-45EE-837C-D4195A1FBC27}.Release|Any CPU.Build.0 = Release|Any CPU
{73173D11-AA67-4089-91D5-BBE0BD4C5444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73173D11-AA67-4089-91D5-BBE0BD4C5444}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73173D11-AA67-4089-91D5-BBE0BD4C5444}.Release|Any CPU.ActiveCfg = Release|Any CPU
{73173D11-AA67-4089-91D5-BBE0BD4C5444}.Release|Any CPU.Build.0 = Release|Any CPU
{37FA4922-AC28-474C-9EB9-1544437997F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37FA4922-AC28-474C-9EB9-1544437997F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37FA4922-AC28-474C-9EB9-1544437997F8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{37FA4922-AC28-474C-9EB9-1544437997F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37FA4922-AC28-474C-9EB9-1544437997F8}.Release|Any CPU.Build.0 = Release|Any CPU
{37FA4922-AC28-474C-9EB9-1544437997F8}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{37FA4922-AC28-474C-9EB9-1544437997F8} = {09DB6871-3FA4-4C09-B41C-CE017586DC5D}
EndGlobalSection
EndGlobal
================================================
FILE: Azure/MachineLearning/WorkerRole/ServiceConfiguration.Cloud.cscfg
================================================
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WorkerRole" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2015-04.2.6">
<Role name="WorkerHost">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="dinarisio" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="MIIBnQYJKoZIhvcNAQcDoIIBjjCCAYoCAQAxggFOMIIBSgIBADAyMB4xHDAaBgNVBAMME1dpbmRvd3MgQXp1cmUgVG9vbHMCEGnaXUXyxHu5TBpc4wgA+w8wDQYJKoZIhvcNAQEBBQAEggEAbiptdq42Rva6CvHhZSdiE3QJ69cY2S75tWG7YyE/7J+u9j/isNMAKvXV7sU4cp4GUsqXKIRhbhM1ZOn66xjFLb9MD4eZKJxQM35lgo0jpLxxDBAG6sBJsIsgZ3N+Y6xhuTVYaPXacPol/z1deoF8MqDqUjDR8LUrRqZn3I84ZDi5Yy2tq647/dRKiPwCNgtqenVrKjdvKHXEivOhaiWMk67YdkuyvY95amE9L8fpBE8EJnzoA1TgMzPpc9LOh3A1n5tymXv0F3FRlZnH8YXfeuIEWTUFKlIYx6GvAsfxp/+32FYjGrz2nPerjOO0esALEhtvSfrMRJJ+V9HRjukJRzAzBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECO84qgpx32t7gBDFPmdYlNcm3vvXutm0jn3z" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2016-04-23T23:59:59.0000000+03:00" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="DF071A214916A8A039A12B4F4B9F93A9C2B49374" thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
</ServiceConfiguration>
================================================
FILE: Azure/MachineLearning/WorkerRole/ServiceConfiguration.Local.cscfg
================================================
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WorkerRole" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2015-04.2.6">
<Role name="WorkerHost">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="dinarisio" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="MIIBnQYJKoZIhvcNAQcDoIIBjjCCAYoCAQAxggFOMIIBSgIBADAyMB4xHDAaBgNVBAMME1dpbmRvd3MgQXp1cmUgVG9vbHMCEGnaXUXyxHu5TBpc4wgA+w8wDQYJKoZIhvcNAQEBBQAEggEAbiptdq42Rva6CvHhZSdiE3QJ69cY2S75tWG7YyE/7J+u9j/isNMAKvXV7sU4cp4GUsqXKIRhbhM1ZOn66xjFLb9MD4eZKJxQM35lgo0jpLxxDBAG6sBJsIsgZ3N+Y6xhuTVYaPXacPol/z1deoF8MqDqUjDR8LUrRqZn3I84ZDi5Yy2tq647/dRKiPwCNgtqenVrKjdvKHXEivOhaiWMk67YdkuyvY95amE9L8fpBE8EJnzoA1TgMzPpc9LOh3A1n5tymXv0F3FRlZnH8YXfeuIEWTUFKlIYx6GvAsfxp/+32FYjGrz2nPerjOO0esALEhtvSfrMRJJ+V9HRjukJRzAzBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECO84qgpx32t7gBDFPmdYlNcm3vvXutm0jn3z" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2016-04-23T23:59:59.0000000+03:00" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="DF071A214916A8A039A12B4F4B9F93A9C2B49374" thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
</ServiceConfiguration>
================================================
FILE: Azure/MachineLearning/WorkerRole/ServiceDefinition.csdef
================================================
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="WorkerRole" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2015-04.2.6">
<WorkerRole name="WorkerHost" vmsize="Small">
<Imports>
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>
</WorkerRole>
</ServiceDefinition>
================================================
FILE: Azure/MachineLearning/WorkerRole/WorkerHostContent/diagnostics.wadcfgx
================================================
<?xml version="1.0" encoding="utf-8"?>
<DiagnosticsConfiguration xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<PublicConfig>
<WadCfg>
<DiagnosticMonitorConfiguration overallQuotaInMB="4096">
<DiagnosticInfrastructureLogs scheduledTransferLogLevelFilter="Error" />
<Logs scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error" />
<Directories scheduledTransferPeriod="PT1M">
<IISLogs containerName="wad-iis-logfiles" />
<FailedRequestLogs containerName="wad-failedrequestlogs" />
</Directories>
<WindowsEventLog scheduledTransferPeriod="PT1M">
<DataSource name="Application!*" />
</WindowsEventLog>
<CrashDumps containerName="wad-crashdumps" dumpType="Mini">
<CrashDumpConfiguration processName="WaIISHost.exe" />
<CrashDumpConfiguration processName="WaWorkerHost.exe" />
<CrashDumpConfiguration processName="w3wp.exe" />
</CrashDumps>
<PerformanceCounters scheduledTransferPeriod="PT1M">
<PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\ISAPI Extension Requests/sec" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\Bytes Total/Sec" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Requests/Sec" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Errors Total/Sec" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Queued" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Rejected" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time" sampleRate="PT3M" />
</PerformanceCounters>
</DiagnosticMonitorConfiguration>
</WadCfg>
<StorageAccount>
</StorageAccount>
</PublicConfig>
<PrivateConfig>
<StorageAccount name="" key="" endpoint="" />
</PrivateConfig>
<IsEnabled>false</IsEnabled>
</DiagnosticsConfiguration>
================================================
FILE: Azure/MachineLearning/WorkerRole/WorkerRole.ccproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>2.7</ProductVersion>
<ProjectGuid>73173d11-aa67-4089-91d5-bbe0bd4c5444</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WorkerRole</RootNamespace>
<AssemblyName>WorkerRole</AssemblyName>
<StartDevelopmentStorage>True</StartDevelopmentStorage>
<Name>WorkerRole</Name>
<PackageEnableRemoteDebugger>False</PackageEnableRemoteDebugger>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<!-- Items for the project -->
<ItemGroup>
<ServiceDefinition Include="ServiceDefinition.csdef" />
<ServiceConfiguration Include="ServiceConfiguration.Local.cscfg" />
<ServiceConfiguration Include="ServiceConfiguration.Cloud.cscfg" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WorkerHost\WorkerHost.csproj">
<Name>WorkerHost</Name>
<Project>{25079398-1602-45ee-837c-d4195a1fbc27}</Project>
<Private>True</Private>
<RoleType>Worker</RoleType>
<RoleName>WorkerHost</RoleName>
<UpdateDiagnosticsConnectionStringOnPublish>True</UpdateDiagnosticsConnectionStringOnPublish>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Profiles" />
<Folder Include="WorkerHostContent\" />
</ItemGroup>
<ItemGroup>
<DiagnosticsConfiguration Include="WorkerHostContent\diagnostics.wadcfgx" />
</ItemGroup>
<!-- Import the target files for this project template -->
<PropertyGroup>
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.7\</CloudExtensionsDir>
</PropertyGroup>
<Import Project="$(CloudExtensionsDir)Microsoft.WindowsAzure.targets" />
</Project>
================================================
FILE: Azure/PowerBI/PBI_setup.md
================================================
The instructions below will help you setup a Power BI dashboard in the Connect The Dots starter solution, but they can be adapted as necessary for other scenarios. This document assumes you have already deployed the starter solution with at least one device set up pushing data to an Azure IoT Hub. The documentation below uses the names and fields you would have if you had set up the starter solution with simple device connected and sending Temperature and Humidity data, but can be modified as needed if you have a different sensor or named your fields and hubs differently.
## Prerequisites ##
Make sure you have a working starter solution, with data showing in your Azure website. In addition, you will need a Power BI account, for which you can sign up for at [PowerBI.com](http://www.PowerBI.com).
## Create a new Consumer Group in your IoT Hub ##
To make sure you do not exceed the maximum number of readers on your Connect The Dots Event Hub, create a Consumer Group first.
* Open the [Azure Management Portal](https://portal.azure.com), and select the resource group of your Connect The Dots solution.
* Find and select the IoT Hub instance
* In the IoT Hub settings blade, click on Endpoints in the MESSAGING section
* Select the "Events" built-in endpoint
* In the properties blade of this endpoint, add a new Consumer Group called "cg4pbi" (remember to click on "Save" at the top to save the change)
## Create an Azure Stream Analytics (ASA) job ##
* In the [Azure Management Portal](https://portal.azure.com), go back to the resource group for your Connect The Dots solution deployment.
* Click on the "+Add" button on top of the Resource Group view
* Click on "Stream Analytics Job"
* Click on "Create" at the bottom
* Type in the name for the job (we'll assume you used "CTD2PBI" as a name). Ensure you are creating the job in the same resource group (which should be the default and will make it easier to find it in the portal)
* Go back to the resource group view and select the CTD2PBI Stream Analytics job.
* Add IoT Hub as the Input
* Click on the "Inputs" box
* Click on "+Add"
* Input Alias: “DevicesInput”
* Source type: "Data Stream"
* Source: "Iot Huyb"
* Import Option: "Use IoT Hub form current subscription"
* IoT hub: _The name of the IoT hub of your Connect The Dots solution_
* Enpoint: "Messaging"
* Shared access policy name: "iothubowner"
* Consumer Group: "cg4pbi"
* Event Serialization format: JSON
* Encoding: "UTF-8"
* Create a query
* Click on the "Query" box in the Stream Analytics blade
* Copy/paste contents “cg4pbi.sql” found in the ConnectTheDots\Azure\StreamAnalyticsQueries folder of the repository
* Save
* Create an output to send data to PowerBI
* Click on the "Outputs" box
* Click on "+Add"
* Output Alias: "CTDPBI"
* Sink: "Power BI"
* Click on "Authorize" if asked to and enter your Power BI account credentials
* Group Workspace: "My Workspace"
* Dataset Name: "CTDPBIDataSet"
* Table Name: "CTDPBITable"
* Start the Stream Analytics Job
* Go back to the Stream Analytics CTD2PBI job blade
* Click on "Start" (top menu)
* Select "Now" and click on "Start" (bottom button)
## Create a Power BI dashboard ##
###Create a dashboard###
We are going to create a Power BI dashboard for a the data coming from the Connect The Dots starter solution, of a single Arduino UNO + Weather Shield sending data to an Azure Event Hub.
To create this, first create a dashboard:
* Log in to [http://App.PowerBI.com](http://app.powerbi.com)
* Create a Dashboard for your Connect The Dots data
* Click "+" in the left menu under Dashboards
* Enter a name: "ConnectTheDots"
###Create a simple line chart###
The first chart on your dashboard will be a real-time timeline showing the temperature from your sensor. To create this, follow the steps below in order.
Note that you need data flowing from at least one device for the Power BI dataset to be created. Start a device and wait a couple minutes before moving on to make sure you will see the dataset created and fed by the Stream Analytics job.
* In the upper menu of the ConnectTheDots dashboard, click on "+ Add Tile"
* Select "Custom Streaming Data" and click "Next"
* Select CTDPBIDataSet data set and click "Next"
* Select Following settings:
* Visualization Type = "Line Chart"
* Axis : "timecreated"
* Legend : "measurename"
* Values : "value"
* Time window to display : 1 minute
You now have a simple dashboard showing real time data coming from devices in PowerBI.
You can now consider customizing the query in stream analytics and the dashboard to show things like average, alerts,...
Enjoy!
================================================
FILE: Azure/StreamAnalyticsQueries/Aggregates.sql
================================================
/* ---------------------------------------------------------------------------------
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
//
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ---------------------------------------------------------------------------------*/
Select
measurename,
unitofmeasure,
'All Sensors' AS location,
'All Sensors' AS organization,
'ace60e7c-a6aa-4694-ba86-c3b66952558e' AS guid,
'Average' as displayname,
Max(timecreated) as timecreated,
Avg(value) AS value
From
DevicesInput TIMESTAMP BY timecreated
where
measurename = 'temperature' OR measurename='Temperature' OR measurename = 'Humidity' OR measurename='humidity'
Group by
measurename, unitofmeasure,
TumblingWindow(Second, 15)
================================================
FILE: Azure/StreamAnalyticsQueries/Alert.sql
================================================
/* ---------------------------------------------------------------------------------
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
//
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ---------------------------------------------------------------------------------*/
SELECT
'TempSpike' AS alerttype,
'Temperature over 80F' AS message,
displayname,
guid,
measurename,
unitofmeasure,
location,
organization,
MIN(timecreated) AS timecreated,
MAX(value) AS tempMax,
MAX(value) AS value
FROM
DevicesInput TIMESTAMP BY timecreated
WHERE
measurename = 'temperature' OR measurename = 'Temperature'
GROUP BY
displayname, guid, measurename, unitofmeasure, location, organization,
TumblingWindow(Second, 5)
HAVING
tempMax > 80
================================================
FILE: Azure/StreamAnalyticsQueries/HumidityAlert.sql
================================================
/* ---------------------------------------------------------------------------------
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
//
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ---------------------------------------------------------------------------------*/
WITH LongAverage AS
(
SELECT
displayname as dspl,
AVG(value) AS hmdt,
MAX(timecreated) AS time
FROM
StreamInput TIMESTAMP BY timecreated
WHERE
measurename='Humidity'
GROUP BY
HoppingWindow(DURATION(ss, 5), HOP(ss, 2)),
displayname
), ShortAverage AS
(
SELECT
displayname AS dspl,
AVG(value) AS hmdt,
MAX(timecreated) AS time,
guid,
measurename,
unitofmeasure,
location,
organization
FROM
StreamInput TIMESTAMP BY timecreated
WHERE
measurename='Humidity'
GROUP BY
TumblingWindow(ss, 2),
displayname,
guid,
measurename,
unitofmeasure,
location,
organization
), Compare AS
(
SELECT
ShortAverage.dspl AS dspl,
ShortAverage.hmdt AS NewHumidity,
LongAverage.hmdt AS OldHumidity,
((ShortAverage.hmdt - LongAverage.hmdt)/ ShortAverage.hmdt) * 100 AS delta,
ShortAverage.time AS time,
ShortAverage.guid,
ShortAverage.measurename,
ShortAverage.unitofmeasure,
ShortAverage.location,
ShortAverage.organization
FROM
LongAverage
INNER JOIN ShortAverage
On LongAverage.dspl = ShortAverage.dspl
AND DATEDIFF(ss, LongAverage, ShortAverage) > 1
AND DATEDIFF(ss, LongAverage, ShortAverage) < 5
)
SELECT
'HumSpike' AS alerttype,
'Sudden increase in Humidity' AS message,
dspl as displayname,
guid,
measurename,
unitofmeasure,
location,
organization,
NewHumidity as value,
OldHumidity,
delta,
time AS timecreated
FROM
Compare
WHERE
delta >= 20
================================================
FILE: Azure/StreamAnalyticsQueries/LightSensor.sql
================================================
/* ---------------------------------------------------------------------------------
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
//
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ---------------------------------------------------------------------------------*/
SELECT
'LightSensor' as alerttype,
'The Light is turned OFF' as message,
displayname,
guid,
measurename,
unitofmeasure,
location,
organization,
MIN(timecreated) AS timecreated,
max(value) as value
FROM
DevicesInput TIMESTAMP BY timecreated
WHERE
measurename = 'light' OR measurename = 'Light'
GROUP BY
displayname, guid, measurename, unitofmeasure, location, organization,
TumblingWindow(Second, 5)
having avg(value) < 0.02
and count(*) > 3
================================================
FILE: Azure/StreamAnalyticsQueries/SA_setup.md
================================================
# Stream Analytics Setup #
The instructions below will help you setup the Stream Analytics queries in the Connect The Dots getting started project, but they can be adapted as necessary for other scenarios. This document assumes you have all the necessary software and subscriptions and that you cloned or downloaded the ConnectTheDots.io project on your machine.
## Prerequisites ##
Make sure you have all software installed and necessary subscriptions as indicated in the ReadMe.md file for the project. To repeat them here, you need
1. Microsoft Azure subscription ([free trial subscription](http://azure.microsoft.com/en-us/pricing/free-trial/) is sufficient)
1. Visual Studio – [Community Edition](http://www.visualstudio.com/downloads/download-visual-studio-vs)
Note also that these queries are hard-coded to the data streams defined in the getting started walkthrough in this project, meaning the same JSON string contents, etc. Also note that the SQL queries ARE CASE SENSITIVE, so that "temperature" <> "TEMPERATURE". You should make sure that the spelling and case of the incoming measure names are the same as in the SQL queries.
## Create three Azure Stream Analytics (ASA) jobs ##
* If you have used the ARM template to deploy the ConnectTheDots solution, then you can edit the Stream Analytics job directly in the portal, looking for it in the Resource Group created during the deployment of the solution.
* If you are creating a new job, read this:
* Open the [Azure Management Portal](http://portal.azure.com), and create a new job “Aggregates”:
* "+” in top left corner > Internet Of Things > Stream Analytics >
* Job name: “Aggregates”.
* Subscription: same as the one used for the other parts of the solution.
* Resource Group: same as the one used for the other parts of the solution.
* Location: your choice, considering it is always better to have the various services of a solution in the same region.
* Click on Create
* Create an input
* In the Resource Groups list, select your solution's resource group.
* Select the stream analytics job "Aggregates"
* Click on the Inputs tile in the Aggregates job.
* *Inputs blade > Add >*
* Input Alias: “DevicesInput”
* Source Type: "Data Stream"
* Source: "IoT Hub"
* Subscription: pick the current subscription
* IoTHub: pick the IoT Hub named out of your solution name (captured during the deployment of the ARM template)
* Shared access policy name: "iothubowner"
* Event serialization format: "JSON"
* Encoding: "UTF-8"
* Create a query
* Select the Query tile in the Aggregates job blade
* Copy/paste contents `Aggregates.sql` found in the `ConnectTheDots\Azure\StreamAnalyticsQueries` folder in Windows Explorer
* Save
* Create an output
* Select the Output tile in the Aggregates job blade
* *Output tile > Add >*
* Output Alias: your choice
* Sink: "Event Hub"
* Subscription: pick the current subscription
* Service bus namespace: Pick the one named after the solution name you entered during the deployment of the ARM template
* Event Hub Name: "ehalerts"
* Event Hub policy name: "RootManageSharedAccessKey"
* Event Serialization format: "JSON"
* Encoding: "UTF-8"
* Click on Create
* **Note** You will likely get an error just about the same container being used as input and output. This is OK, the job will still work.
* Start the Job
* *Dashboard > Start* on the bottom bar.
* Create a second job “Alerts”: as above, but use `alert.sql` contents for the query, and use *ehalerts* for the Output Event Hub, not *ehdevices*.
* Create a third job “LightSensor”: as above, but use `lightsensor.sql` contents for the query, and use *ehalerts* for the Output Event Hub.
Once all three are running, go check out your site at http://`<yourURL>`.azurewebsites.net/.
### What these streams do ###
Now that you have them set up, a quick explanation of what each one does would be helpful.
**Aggregates** job gets the data from the temperature sensor, and creates the average within a given window. This allows us to chart the rolling average on top of the temperature chart.
**Alerts** keeps tabs on the temperature max, and creates an alert if the temperature rises above 80, on both the raw data and the average coming from the Aggregates stream.
**Light Sensor** issues an alert when the lights are turned off, which in the query we have provided, is when the lumen value is under 0.02.
For more details on the website and what it shows, check out the [Website Details](../WebSite/WebsiteDetails.md).
================================================
FILE: Azure/StreamAnalyticsQueries/cg4pbi.sql
================================================
/* ---------------------------------------------------------------------------------
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
//
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ---------------------------------------------------------------------------------*/
Select
measurename,
displayname,
timecreated,
value
from DevicesInput TIMESTAMP by timecreated
================================================
FILE: Azure/WebSite/WebsiteDetails.md
================================================
# Website details #
Once you have your website running, you'll notice more is being displayed on the charts than just the raw data. Here you'll learn about the features of the website that weren't discussed during setup.

#### Dots on the graph ####
You'll see dots showing up on the graph if you've set up alerts for that data stream. In the getting started project, this was done with the light sensor data to register an alert whenever the light is off, as well as when the temperature rises above 80 degrees. Hovering over that dot shows you the value during the alert, and what that alert is.
#### Secondary line on chart ####
If you have Stream Analytics set up, such as for temperature in our getting started project, you'll see a second line on your chart, along with an added entry in the legend of that chart. If you click on that data stream name on the left, it will toggle the display of that data on the chart.
#### Hover over data streams ####
If you hover over the data stream on the left, you'll be presented with the location of the device. In the case of the getting started project, you'll see both the public and local IP address of your gateway.
#### Alert table ####
Below the charts, you'll see a table listing all the real time alerts, including the message, time, which device, and what alert was fired.

================================================
FILE: Azure/WebSite/WebsitePublish.md
================================================
# Website parameters and re-publish #
This document explains how to build and deploy a sample website that is used to show data and alerts in the Connect The Dots project. It assumes you have all necessary software and subscriptions and that you have cloned or download the ConnectTheDots.io project on your machine.
Since the version 2 of ConnectTheDots, the deployment of the site is primarily done using an ARM template (see [here](../ARMTemplate/Readme.md) for details) and there is no need for manually deploying if you are just using the default dashboard site and solution architecture.
If you want to make changes to the site though or have changed the Azure services architecture (changed Event Hub or IoT Hub) you will need to redeploy the site.
## Web app parameters
In order for the website to connect with the various Azure resources (IoT Hub, Event Hub), it needs to have information about these services such as connection strings and credentials.
The ARM Template used to deploy the Azure services populates these parameters so you don't have to do it manually.
If you are willing to change these parameters (for example if you have decided to use a different IoT Hub), you can find them in the Azure portal:
- Go to [portal.azure.com](http://portal;.azure.com)
- Login using your Azure account credentials
- Find the resource group that was deployed for your ConnectTheDots solution when following the [instructions](../ARMTemplate/Readme.md).
- Once you have selected the resource group:
1. Identify and select the Web App
1. Click on the **settings** button in the Web App blade
1. Select **Application settings**
1. Scroll down to **App settings**

Once you have made your edits in the settings, you can just restart the site, clicking on the **Restart** in the Web App blade
## Modifying the dashboard Website ##
### Prerequisites ###
Make sure you have all software installed and necessary subscriptions as indicated in the ReadMe.md file for the project. To repeat them here, you need
1. Microsoft Azure subscription ([free trial subscription](http://azure.microsoft.com/en-us/pricing/free-trial/) is sufficient)
1. Visual Studio – [Community Edition](http://www.visualstudio.com/downloads/download-visual-studio-vs)
1. Deploy the default dashboard Website a first time using the [ARM Template](../ARMTemplate/readme.md).
## Publish the Azure Website ##
* Open the `ConnectTheDots\Azure\WebSite\source\ConnectTheDotsWebSite.sln` solution in Visual Studio
* In VS, Right-click on the project name and select *Publish*.
* In the Profile tab, select the publish target **Microsoft Azure Web Apps**
* Select your subscription
* Select the resource group for your ConnectTheDots deployment
* Select the Web App below then click **OK**
* Click on **Publish**
##Running the site
* Open the site in a browser to verify it has deployed correctly.
* At the bottom of the page you should see “Connected.”. If you see “ERROR undefined” you likely didn’t enable WebSockets for the Azure Web Site (see above section).
**Note** There is a chance you won't see any data coming into your site when you first stand it up. If that is the case, try rebooting your gateway.

================================================
FILE: Azure/WebSite/site/Default.aspx
================================================
<!--
// ---------------------------------------------------------------------------------
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
//
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ---------------------------------------------------------------------------------
-->
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ConnectTheDotsWebSite.Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Connect The Dots</title>
<!-- general styles -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.9/css/jquery.dataTables.css" />
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="css/connectthedots.css" />
</head>
<body>
<div class="globalSettings" style="display:none">
<div class="ForceSocketCloseOnUserActionsTimeout"><%= ForceSocketCloseOnUserActionsTimeout %></div>
</div>
<div id="loading" style="display: none;">
<div id="loading-inner">
<p id="loading-text">Loading last 10 minutes of data...</p>
<p id="loading-sensor"></p>
<img id="loading-image" src="img/ajax-loader.gif" />
</div>
</div>
<ul id="deviceMenu" style="display:none;">
<li><div>Add a new device</div></li>
<li><div>Remove device</div></li>
<li><div>Get QRCode</div></li>
</ul>
<div id="qrcode">
</div>
<div id="add-device-dialog-form" title="Add new device" style="display: none;">
<p>Type in a unique name for the new device (only characters and numbers).</p>
<form>
<fieldset style="padding:0; border:0; margin-top:25px; ">
<label style="display:block;" for="newdeviceid">Device ID</label>
<input type="text" name="newdeviceid" id="newdeviceid" value="mynewdevice" class="text ui-widget-content ui-corner-all" style="display:block;"/>
<!-- Allow form submission with keyboard without duplicating the dialog button -->
<input class="popup-input" type="submit" tabindex="-1" style="position:absolute; top:-1000px"/>
</fieldset>
</form>
</div>
<div id="delete-device-dialog-confirm" title="Delete device?" style="display: none;">
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:12px 12px 20px 0;"></span>This will permanently remove the device from the IoT Hub device registry. Are you sure?</p>
<div id="devicetodelete"></div>
</div>
<div id="header">
<div>
<img src="img/ConnectTheDotsLogo.png" />
</div>
</div>
<form id="form2" runat="server">
<div id="user" runat="server">
</div>
<asp:ScriptManager ID='ScriptManager1' runat='server' EnablePageMethods='true' />
<a target="_blank" href="http://connectthedots.io"><img style="position: absolute; top: 0; right: 0; border: 0;" src="img/forkme_CTD.png" alt="Fork me on GitHub" /></a>
<div class="big-block">
<h3>Live Sensor Data</h3>
<div style="float: left; width: 200px">
<p><strong>Select Sensor/R-PI:</strong></p>
<div id="controllersContainer">
</div>
</div>
<div id="chartsContainer">
</div>
</div>
<div class="big-block">
<h3>Real Time Events</h3>
<div id="alerts">
<table id="alertTable">
<thead>
<tr>
<th class="timeFromDate">Time</th>
<th>Device</th>
<th>Alert</th>
<th>Message</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="big-block">
<h3>Devices List</h3>
<div id="devices">
<table id="devicesTable">
<thead>
<tr>
<th>Display Name</th>
<th>Location</th>
<th>IP Address</th>
<th>IoTHub Device ID</th>
<th id="cscolumn" runat="server">Connection String</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="big-block">
<h3>Messages</h3>
<div id="messages"></div>
</div>
</form>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.7.1/d3-tip.js"></script>
<script type="text/javascript" src="js/d3utils.js"></script>
<script type="text/javascript" src="js/d3DataFlow.js"></script>
<script type="text/javascript" src="js/d3Chart.js"></script>
<script type="text/javascript" src="js/d3ChartControl.js"></script>
<script type="text/javascript" src="js/d3DataSourceSocket.js"></script>
<script type="text/javascript" src="js/d3CTDDataSourceSocket.js"></script>
<script type="text/javascript" src="js/d3CTDDataSourceFilter.js"></script>
<script type="text/javascript" src="js/jquery.ui-contextmenu.js"></script>
<script type="text/javascript" src="js/devicesList.js"></script>
<script type="text/javascript" src="js/qrcode.js"></script>
<script type="text/javascript" src="js/d3CTD.js"></script>
</body>
</html>
================================================
FILE: Azure/WebSite/site/Docs/license.txt
================================================
Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: Azure/WebSite/site/Global.asax
================================================
<%@ Application Codebehind="Global.asax.cs" Inherits="ConnectTheDotsWebSite.Global" Language="C#" %>
================================================
FILE: Azure/WebSite/site/Web.config
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
Web.config file for WebClient based upon Web.config
The settings that can be used in this file are documented at
http://www.mono-project.com/Config_system.web and
http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
-->
<configuration>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.6.1" />
</system.Web>
-->
<system.web>
<compilation defaultLanguage="C#" targetFramework="4.6.1">
<assemblies>
<add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<customErrors mode="Off" />
<authentication mode="None" />
<authorization>
<allow users="*" />
</authorization>
<httpHandlers />
<trace enabled="false" localOnly="true" pageOutput="false" requestLimit="10" traceMode="SortByTime" />
<sessionState mode="InProc" cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
<pages />
</system.web>
<appSettings>
<!-- The below app settings are set by the ARM template and are here just for reference
<add key="azure.IoT.IoTHub.ConnectionString" value="<IoTHubOwnerConnectionString>"/>
<add key="azure.IoT.IoTHub.EventHub.Name" value="<IoTHubName>"/>
<add key="azure.IoT.IoTHub.EventHub.ConnectionString" value="<IotHubConnectionString>"/>
<add key="azure.IoT.IoTHub.EventHub.ConsumerGroup" value="websitecg"/>
<add key="azure.ServiceBus.EventHub.Name" value="ehalerts"/>
<add key="azure.ServiceBus.EventHub.ConnectionString" value="<EventHubConnectionString>"/>
<add key="azure.ServiceBus.EventHub.ConsumerGroup" value="$Default"/>
<add key="azure.Storage.ConnectionString" value="<StorageAccountConnectionString>"/>
<add key="AdminName" value="<admin@admin.com>" />-->
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.2.1.0" newVersion="7.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.1.0" newVersion="5.8.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.1.0" newVersion="5.8.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.1.0" newVersion="5.8.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Validation" publicKeyToken="2fc06f0d701809a7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
<system.serviceModel>
<extensions>
<!-- In this extension section we are introducing all known service bus extensions. User can remove the ones they don't need. -->
<behaviorExtensions>
<add name="connectionStatusBehavior" type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</behaviorExtensions>
<bindingElementExtensions>
<add name="netMessagingTransport" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingTransportExtensionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="tcpRelayTransport" type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpsRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="onewayRelayTransport" type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingElementExtensions>
<bindingExtensions>
<add name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="webHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ws2007HttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netOnewayRelayBinding" type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netEventRelayBinding" type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingExtensions>
</extensions>
</system.serviceModel>
</configuration>
<!--ProjectGuid: 2E3E7496-59D5-48BC-909E-207120886E3E-->
================================================
FILE: Azure/WebSite/site/css/connectthedots.css
================================================
body {
font: 16px sans-serif;
color: #333;
width: 95%;
}
#header {
width: 100%;
border-bottom: 1px #cdcdcd solid;
}
h3 {
width: 100%;
background-color: #f7f7f7;
border-bottom: 1px #ddd solid;
padding: 10px;
}
h4 {
width: 100%;
background-color: #f7f7f7;
border-bottom: 1px #ddd solid;
margin-top: 0;
}
.big-block {
margin-left: 10px;
}
ul {
list-style-type: none;
padding-left: 0;
font: 12px sans-serif;
color: #666;
left: 0
}
li {
cursor: pointer;
font-weight: normal;
}
.selected {
font-weight: bold;
}
li.selected:before {
content: "\25BA \0020";
}
/*styles for D3 charts*/
.axis {
shape-rendering: crispEdges;
}
.axis text {
font: 10px sans-serif;
font-weight: normal;
fill: #787878;
}
.axis path,
.axis line {
fill: none;
stroke: #787878;
shape-rendering: crispEdges;
}
.y.axis {
}
.x.axis {
}
path.line {
fill: none;
stroke: steelblue;
stroke-width: 1.5px;
}
.legend {
font: 10px sans-serif;
}
/*for "loading" gif */
#loading {
width: 100%;
height: 100%;
top: 0px;
left: 0px;
position: fixed;
display: block;
background-color: #777;
background-color: rgba(155, 155, 155, 0.4);
z-index: 99;
text-align: center;
}
#loading-inner {
background-color: #fff;
border-style: solid;
border-width: 1px;
width: 400px;
height: 200px;
position: absolute;
top: 50%;
left: 50%;
margin-left: -200px;
margin-top: -100px;
}
#loading-image {
position: relative;
top: 10px;
left: 10px;
z-index: 100;
}
#loading-text {
position: relative;
top: 10px;
left: 10px;
z-index: 100;
}
#alerts {
height: 15%;
width: 100%;
}
#devices {
height: 15%;
width: 100%;
}
#Charts {
height: 100%;
position: relative;
}
#Graphics {
height: 80%;
width: 100%;
position: absolute;
}
#controllersContainer {
position: relative;
text-align: center;
}
.controller {
height: 300px;
right : 10px;
position: absolute;
text-align: left;
}
#chartsContainer {
margin-left: 200px;
position: relative;
}
.chart {
height: 300px;
width: 100%;
position: absolute;
}
#chartTwo {
top: 40%;
}
#chartOne {
top: 0;
}
#alertTable td {
font-size: 12px;
text-align: center;
}
#devicesTable td {
font-size: 12px;
text-align: center;
}
.d3-tip {
line-height: 1;
padding: 12px;
background: rgba(255, 255, 255, 0.9);
color: #000;
border-radius: 2px;
}
.d3-tip .time_header {
color: grey;
font-size: 8px;
display: block;
}
.d3-tip .value_circle {
color: #006fc7;
font-size: 20px;
}
.d3-tip .value {
color: black;
font-size: 14px;
margin-left: 5px;
}
.d3-tip .message {
color: black;
font-size: 10px;
display: block;
}
/* Creates a small triangle extender for the tooltip */
.d3-tip:after {
box-sizing: border-box;
display: inline;
font-size: 8px;
width: 100%;
line-height: 1;
color: rgba(255, 255, 255, 0.9);
content: "\25BC";
position: absolute;
text-align: center;
}
/* Style northward tooltips differently */
.d3-tip.n:after {
margin: -1px 0 0 0;
top: 100%;
left: 0;
}
.sensorTip {
z-index: 10000;
position: absolute;
white-space: pre;
overflow: hidden;
margin-top: -22px;
float: right;
margin-left: 200px;
/*background: #eee;*/
color: #000;
padding: 5px;
padding-right: 10px;
padding-left: 10px;
pointer-events:none;
border: solid;
border-width: thin;
border-color: #000;
background: rgba(243, 233, 6, 0.9);
}
================================================
FILE: Azure/WebSite/site/js/d3CTD.js
================================================
// ---------------------------------------------------------------------------------
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
//
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ---------------------------------------------------------------------------------
va
gitextract_ovnh2m6b/ ├── .deployment ├── .gitattributes ├── .gitignore ├── .gitmodules ├── Azure/ │ ├── ARMTemplate/ │ │ ├── CustomizeTemplate.md │ │ ├── Readme.md │ │ └── azuredeploy.json │ ├── EHConsole/ │ │ ├── EHConsole/ │ │ │ ├── App.config │ │ │ ├── Microsoft.ConnectTheDots.EHConsole.csproj │ │ │ ├── Program.cs │ │ │ ├── Properties/ │ │ │ │ └── AssemblyInfo.cs │ │ │ └── packages.config │ │ ├── EHConsole.sln │ │ └── nuget.config │ ├── MachineLearning/ │ │ ├── MachineLearningCloudService.md │ │ ├── SQL/ │ │ │ ├── SQL.sqlproj │ │ │ ├── StoredProcedures/ │ │ │ │ └── InsertAlertsData.sql │ │ │ ├── TableType/ │ │ │ │ └── AlertsDataTableType.sql │ │ │ └── Tables/ │ │ │ └── AlertsData.sql │ │ ├── WorkerHost/ │ │ │ ├── Analyzer.cs │ │ │ ├── AnomalyRecord.cs │ │ │ ├── App.config │ │ │ ├── CircularBuffer.cs │ │ │ ├── Data.Outputs/ │ │ │ │ ├── BlobWriter.cs │ │ │ │ ├── SQLOutputRepository.cs │ │ │ │ └── Utils/ │ │ │ │ └── SqlDBReaderSafeParser.cs │ │ │ ├── EventHubReader.cs │ │ │ ├── Program.cs │ │ │ ├── Properties/ │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── SensorDataContract.cs │ │ │ ├── WorkerHost.csproj │ │ │ └── packages.config │ │ ├── WorkerHost.sln │ │ └── WorkerRole/ │ │ ├── ServiceConfiguration.Cloud.cscfg │ │ ├── ServiceConfiguration.Local.cscfg │ │ ├── ServiceDefinition.csdef │ │ ├── WorkerHostContent/ │ │ │ └── diagnostics.wadcfgx │ │ └── WorkerRole.ccproj │ ├── PowerBI/ │ │ └── PBI_setup.md │ ├── StreamAnalyticsQueries/ │ │ ├── Aggregates.sql │ │ ├── Alert.sql │ │ ├── HumidityAlert.sql │ │ ├── LightSensor.sql │ │ ├── SA_setup.md │ │ └── cg4pbi.sql │ └── WebSite/ │ ├── WebsiteDetails.md │ ├── WebsitePublish.md │ ├── site/ │ │ ├── Default.aspx │ │ ├── Docs/ │ │ │ └── license.txt │ │ ├── Global.asax │ │ ├── Web.config │ │ ├── css/ │ │ │ └── connectthedots.css │ │ ├── js/ │ │ │ ├── d3CTD.js │ │ │ ├── d3CTDDataSourceFilter.js │ │ │ ├── d3CTDDataSourceSocket.js │ │ │ ├── d3Chart.js │ │ │ ├── d3ChartControl.js │ │ │ ├── d3DataFlow.js │ │ │ ├── d3DataSourceSocket.js │ │ │ ├── d3utils.js │ │ │ ├── devicesList.js │ │ │ ├── jquery.ui-contextmenu.js │ │ │ └── qrcode.js │ │ └── packages.config │ └── source/ │ ├── ConnectTheDotsWebSite/ │ │ ├── ConnectTheDotsWebSite.csproj │ │ ├── Default.aspx │ │ ├── Default.aspx.cs │ │ ├── Default.aspx.designer.cs │ │ ├── Docs/ │ │ │ └── license.txt │ │ ├── Global.asax │ │ ├── Global.asax.cs │ │ ├── Helpers/ │ │ │ ├── BlobHelper.cs │ │ │ └── IoTHubHelper.cs │ │ ├── Properties/ │ │ │ ├── AssemblyInfo.cs │ │ │ └── PublishProfiles/ │ │ │ └── LocalDeploy.pubxml │ │ ├── SensorInventory.cs │ │ ├── Web.Debug.config │ │ ├── Web.PublishTemplate.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ ├── WebSocketEventProcessor.cs │ │ ├── WebSocketHandler.cs │ │ ├── css/ │ │ │ └── connectthedots.css │ │ ├── js/ │ │ │ ├── d3CTD.js │ │ │ ├── d3CTDDataSourceFilter.js │ │ │ ├── d3CTDDataSourceSocket.js │ │ │ ├── d3Chart.js │ │ │ ├── d3ChartControl.js │ │ │ ├── d3DataFlow.js │ │ │ ├── d3DataSourceSocket.js │ │ │ ├── d3utils.js │ │ │ ├── devicesList.js │ │ │ ├── jquery.ui-contextmenu.js │ │ │ └── qrcode.js │ │ └── packages.config │ └── ConnectTheDotsWebSite.sln ├── Contribute.md ├── Devices/ │ ├── DirectlyConnectedDevices/ │ │ ├── Common/ │ │ │ ├── csharp/ │ │ │ │ └── ConnectTheDotsHelper.cs │ │ │ └── javascript/ │ │ │ ├── connectthedots.js │ │ │ ├── package.json │ │ │ └── readme.md │ │ ├── ESP8266/ │ │ │ ├── ESP8266_setup.md │ │ │ └── connect_the_dots/ │ │ │ ├── connect_the_dots.cpp │ │ │ ├── connect_the_dots.h │ │ │ └── connect_the_dots.ino │ │ ├── NodeJS/ │ │ │ ├── BeagleBoneBlack/ │ │ │ │ ├── BeagleBone_Black_setup.md │ │ │ │ ├── Hardware.md │ │ │ │ ├── beagleboneblackctd.js │ │ │ │ ├── package.json │ │ │ │ └── settings.json │ │ │ ├── Desktop/ │ │ │ │ ├── Desktop_setup.md │ │ │ │ ├── desktop.js │ │ │ │ ├── package.json │ │ │ │ └── settings.json │ │ │ ├── IntelEdisonGrove/ │ │ │ │ ├── Hardware.md │ │ │ │ ├── Intel_Edison_setup.md │ │ │ │ ├── inteledisonctd.js │ │ │ │ ├── package.json │ │ │ │ └── settings.json │ │ │ ├── IntelEdisonSensorTag/ │ │ │ │ ├── Hardware.md │ │ │ │ ├── Intel_Edison_setup.md │ │ │ │ ├── inteledisonsensortagctd.js │ │ │ │ ├── lib/ │ │ │ │ │ ├── cc2540.js │ │ │ │ │ ├── cc2650.js │ │ │ │ │ ├── common.js │ │ │ │ │ └── sensortag.js │ │ │ │ ├── package.json │ │ │ │ └── settings.json │ │ │ ├── IntelEdisonXadow/ │ │ │ │ ├── Hardware.md │ │ │ │ ├── Intel_Edison_setup.md │ │ │ │ ├── inteledisonctd.js │ │ │ │ ├── package.json │ │ │ │ └── settings.json │ │ │ ├── SensorTag/ │ │ │ │ ├── Setup.md │ │ │ │ ├── index.js │ │ │ │ ├── package.json │ │ │ │ ├── sensorWorker.js │ │ │ │ └── settings.json │ │ │ └── Tessel2/ │ │ │ ├── Hardware.md │ │ │ ├── Tessel2_setup.md │ │ │ ├── package.json │ │ │ ├── settings.json │ │ │ └── tessel2ctd.js │ │ ├── UWPMSBand/ │ │ │ ├── UWPMSBand/ │ │ │ │ ├── App.xaml │ │ │ │ ├── App.xaml.cs │ │ │ │ ├── MainPage.xaml │ │ │ │ ├── MainPage.xaml.cs │ │ │ │ ├── Package.appxmanifest │ │ │ │ ├── Properties/ │ │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ │ └── Default.rd.xml │ │ │ │ ├── UWPMSBand.csproj │ │ │ │ ├── UWPMSBand_TemporaryKey.pfx │ │ │ │ ├── project.json │ │ │ │ └── project.lock.json │ │ │ └── UWPMSBand.sln │ │ ├── UWPSimulatedSensors/ │ │ │ ├── UWPSimulatedSensors/ │ │ │ │ ├── App.xaml │ │ │ │ ├── App.xaml.cs │ │ │ │ ├── ApplicationInsights.config │ │ │ │ ├── MainPage.xaml │ │ │ │ ├── MainPage.xaml.cs │ │ │ │ ├── Package.appxmanifest │ │ │ │ ├── Properties/ │ │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ │ └── Default.rd.xml │ │ │ │ ├── UWPSimulatedSensors.csproj │ │ │ │ ├── UWPSimulatedSensors_TemporaryKey.pfx │ │ │ │ ├── project.json │ │ │ │ └── project.lock.json │ │ │ └── UWPSimulatedSensors.sln │ │ └── XamarinSimulatedSensors/ │ │ ├── XamarinSimulatedSensors/ │ │ │ ├── XamarinSimulatedSensors/ │ │ │ │ ├── Helpers/ │ │ │ │ │ └── Settings.cs │ │ │ │ ├── MyClass.cs │ │ │ │ ├── Properties/ │ │ │ │ │ └── AssemblyInfo.cs │ │ │ │ ├── XamarinSimulatedSensors.csproj │ │ │ │ ├── app.config │ │ │ │ └── packages.config │ │ │ ├── XamarinSimulatedSensors.Droid/ │ │ │ │ ├── Assets/ │ │ │ │ │ └── AboutAssets.txt │ │ │ │ ├── Helpers/ │ │ │ │ │ └── Settings.cs │ │ │ │ ├── MainActivity.cs │ │ │ │ ├── Properties/ │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ └── AssemblyInfo.cs │ │ │ │ ├── Resources/ │ │ │ │ │ ├── AboutResources.txt │ │ │ │ │ ├── Resource.designer.cs │ │ │ │ │ ├── layout/ │ │ │ │ │ │ └── Main.axml │ │ │ │ │ └── values/ │ │ │ │ │ └── Strings.xml │ │ │ │ ├── XamarinSimulatedSensors.Droid.csproj │ │ │ │ ├── app.config │ │ │ │ └── packages.config │ │ │ ├── XamarinSimulatedSensors.Windows/ │ │ │ │ ├── App.config │ │ │ │ ├── Form1.Designer.cs │ │ │ │ ├── Form1.cs │ │ │ │ ├── Form1.resx │ │ │ │ ├── Helpers/ │ │ │ │ │ └── Settings.cs │ │ │ │ ├── Program.cs │ │ │ │ ├── Properties/ │ │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ │ ├── Resources.Designer.cs │ │ │ │ │ ├── Resources.resx │ │ │ │ │ ├── Settings.Designer.cs │ │ │ │ │ └── Settings.settings │ │ │ │ ├── XamarinSimulatedSensors.Windows.csproj │ │ │ │ └── packages.config │ │ │ └── XamarinSimulatedSensors.iOS/ │ │ │ ├── AppDelegate.cs │ │ │ ├── Entitlements.plist │ │ │ ├── Helpers/ │ │ │ │ └── Settings.cs │ │ │ ├── Info.plist │ │ │ ├── Main.cs │ │ │ ├── Main.storyboard │ │ │ ├── Resources/ │ │ │ │ ├── ITunesArtwork │ │ │ │ ├── ITunesArtwork@2x │ │ │ │ ├── Images.xcassets/ │ │ │ │ │ ├── AppIcons.appiconset/ │ │ │ │ │ │ └── Contents.json │ │ │ │ │ ├── Images.imageset/ │ │ │ │ │ │ └── Contents.json │ │ │ │ │ └── LaunchImage.launchimage/ │ │ │ │ │ └── Contents.json │ │ │ │ └── LaunchScreen.storyboard │ │ │ ├── ViewController.cs │ │ │ ├── ViewController.designer.cs │ │ │ ├── XamarinSimulatedSensors.iOS.csproj │ │ │ ├── app.config │ │ │ └── packages.config │ │ └── XamarinSimulatedSensors.sln │ ├── GatewayConnectedDevices/ │ │ ├── Arduino DUE/ │ │ │ └── Temperature/ │ │ │ └── DS18B20/ │ │ │ ├── DS18B20.ino │ │ │ └── Libraries.md │ │ ├── Arduino UNO/ │ │ │ ├── Accelerometer/ │ │ │ │ └── Memsic2125Json/ │ │ │ │ ├── Libraries.md │ │ │ │ └── Memsic2125Json.ino │ │ │ ├── AnalogReadSerial/ │ │ │ │ └── AnalogReadSerial.ino │ │ │ ├── Combo_accelerometer_and_temperature/ │ │ │ │ └── Memsic2125_plus_DS18B20/ │ │ │ │ ├── Libraries.md │ │ │ │ └── Memsic2125_plus_DS18B20.ino │ │ │ ├── Sound/ │ │ │ │ └── SimpleSoundSensor/ │ │ │ │ └── SimpleSoundSensor.ino │ │ │ ├── Temperature/ │ │ │ │ └── DS18B20/ │ │ │ │ ├── DS18B20.ino │ │ │ │ └── Libraries.md │ │ │ └── Weather/ │ │ │ └── WeatherShieldJson/ │ │ │ ├── Arduino-and-Weather-Shield-setup.md │ │ │ ├── Hardware.md │ │ │ ├── Libraries.md │ │ │ ├── SCPRPI.cmd │ │ │ └── WeatherShieldJson.ino │ │ ├── Arduino Zero/ │ │ │ └── Weather/ │ │ │ └── SeeedGroveJson/ │ │ │ ├── SeeedGroveJson.ino │ │ │ └── readme.md │ │ ├── BLEMoisture/ │ │ │ ├── BLEMoistureSensor.py │ │ │ ├── DeviceConfig.csv │ │ │ ├── RedBear_BLE_nano/ │ │ │ │ ├── Configure.md │ │ │ │ └── main.cpp │ │ │ ├── SensorAgent.py │ │ │ ├── SensorAgentConfig.csv │ │ │ ├── autorun2.sh │ │ │ ├── configuration.md │ │ │ └── deploy_next.cmd │ │ ├── BluetoothUARTExample/ │ │ │ ├── BluetoothUARTExample.py │ │ │ ├── SetupSerialBaudRate.py │ │ │ └── readme │ │ ├── BtUSB_2_BtUART_Example/ │ │ │ ├── ArduinoSensorMock/ │ │ │ │ └── ArduinoSensorMock.ino │ │ │ ├── BtUSB_2_BtUART_Example.py │ │ │ ├── TestServer.py │ │ │ └── readme │ │ ├── Hydrology/ │ │ │ ├── DO2Sensor.py │ │ │ ├── Documentation/ │ │ │ │ └── DeviceSetup.md │ │ │ ├── ECSensor.py │ │ │ ├── MoistureSensor.py │ │ │ ├── SensorAgent.py │ │ │ ├── autorun2.sh │ │ │ └── deploy_next.cmd │ │ └── WensnSoundLevelMeter/ │ │ └── WensnPiVS01/ │ │ ├── WensnPiVS01.py │ │ ├── autorun2.sh │ │ └── deploy_next.cmd │ ├── Gateways/ │ │ └── GatewayService/ │ │ ├── Common/ │ │ │ ├── Adapter/ │ │ │ │ └── SensorEndpoint.cs │ │ │ ├── ILogger.cs │ │ │ ├── IPAddressHelper.cs │ │ │ ├── Logger/ │ │ │ │ ├── NLogEventLogger.cs │ │ │ │ ├── SafeLogger.cs │ │ │ │ └── TunableLogger.cs │ │ │ ├── Microsoft.ConnectTheDots.Common.csproj │ │ │ ├── Platform.cs │ │ │ ├── Properties/ │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── SafeAction.cs │ │ │ ├── SafeFunction.cs │ │ │ ├── Threading/ │ │ │ │ └── TaskWrapper.cs │ │ │ ├── Utils/ │ │ │ │ └── Loader.cs │ │ │ └── packages.config │ │ ├── DeviceAdapters/ │ │ │ ├── Bluetooth/ │ │ │ │ ├── BluetoothUARTAdapter.cs │ │ │ │ ├── BluetoothUARTAdapter.csproj │ │ │ │ └── Properties/ │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── SerialPort/ │ │ │ │ ├── Properties/ │ │ │ │ │ └── AssemblyInfo.cs │ │ │ │ ├── SerialPortAdapter.cs │ │ │ │ └── SerialPortAdapter.csproj │ │ │ └── Socket/ │ │ │ ├── Properties/ │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── SocketAdapter.cs │ │ │ └── SocketAdapter.csproj │ │ ├── Gateway/ │ │ │ ├── Adapter/ │ │ │ │ ├── DeviceAdapter.cs │ │ │ │ └── IDeviceAdapter.cs │ │ │ ├── App.config │ │ │ ├── Constants.cs │ │ │ ├── DeviceAdapter/ │ │ │ │ ├── DeviceAdapter.cs │ │ │ │ ├── IDeviceAdapter.cs │ │ │ │ └── SensorEndpoint.cs │ │ │ ├── EventProcessor.cs │ │ │ ├── GatewayService.cs │ │ │ ├── GatewayService.csproj │ │ │ ├── IGatewayService.cs │ │ │ ├── Microsoft.ConnectTheDots.Gateway.csproj │ │ │ ├── Models/ │ │ │ │ ├── QueuedItem.cs │ │ │ │ └── SensorDataContract.cs │ │ │ ├── Properties/ │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── ServiceInstantiation/ │ │ │ │ ├── IService.cs │ │ │ │ ├── ServiceBehavior.cs │ │ │ │ └── ServiceInstanceProvider.cs │ │ │ ├── Utils/ │ │ │ │ ├── Loader/ │ │ │ │ │ └── DataIntakeLoader.cs │ │ │ │ ├── MessageSender/ │ │ │ │ │ ├── IMessageSender.cs │ │ │ │ │ └── MessageSender.cs │ │ │ │ ├── OperationStatus/ │ │ │ │ │ ├── ErrorCode.cs │ │ │ │ │ ├── OperationStatus.cs │ │ │ │ │ └── OperationStatusFactory.cs │ │ │ │ └── Queue/ │ │ │ │ ├── BatchSenderThread.cs │ │ │ │ ├── GatewayQueue.cs │ │ │ │ └── IAsyncQueue.cs │ │ │ └── packages.config │ │ ├── GatewayService.sln │ │ ├── Hardware.md │ │ ├── RaspberryPi-Gateway-setup.md │ │ ├── Scripts/ │ │ │ ├── RaspberryPi/ │ │ │ │ ├── GetLogFile.cmd │ │ │ │ ├── Modified/ │ │ │ │ │ ├── autorun_install.sh │ │ │ │ │ ├── certificate_update.sh │ │ │ │ │ ├── deploy_and_start_ctd_on_boot.sh │ │ │ │ │ └── kill_all.sh │ │ │ │ ├── autorunUart2UsbBt.sh │ │ │ │ ├── autorunUartBT.sh │ │ │ │ ├── autorunWensnSoundSensor.sh │ │ │ │ ├── autorun_install.sh │ │ │ │ ├── certificate_update.sh │ │ │ │ ├── deploy.cmd │ │ │ │ ├── deploy_and_start_ctd_on_boot.sh │ │ │ │ ├── deploy_next.cmd │ │ │ │ ├── kill_all.sh │ │ │ │ ├── setupWifi.py │ │ │ │ └── setup_autostart.sh │ │ │ └── ScriptConverter/ │ │ │ ├── App.config │ │ │ ├── Program.cs │ │ │ ├── Properties/ │ │ │ │ └── AssemblyInfo.cs │ │ │ └── ScriptConverter.csproj │ │ ├── ServiceMonitor/ │ │ │ ├── App.config │ │ │ ├── IMonitor.cs │ │ │ ├── Microsoft.ConnectTheDots.ServiceMonitor.csproj │ │ │ ├── Monitor.cs │ │ │ ├── MonitorProgram.cs │ │ │ ├── NLog.config │ │ │ ├── NLog.xsd │ │ │ ├── ProcessMonitor.cs │ │ │ ├── Properties/ │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── ServiceMonitor.cs │ │ │ ├── Utils/ │ │ │ │ └── Logger/ │ │ │ │ └── Logger.cs │ │ │ └── packages.config │ │ ├── Setup/ │ │ │ ├── WindowsExeSetup/ │ │ │ │ ├── Product.wxs │ │ │ │ └── WindowsExeSetup.wixproj │ │ │ └── WindowsServiceSetup/ │ │ │ ├── Product.wxs │ │ │ └── WindowsServiceSetup.wixproj │ │ ├── Tests/ │ │ │ ├── BatchSenderThreadTest/ │ │ │ │ ├── App.config │ │ │ │ ├── BatchSenderThreadTest.cs │ │ │ │ ├── BatchSenderThreadTest.csproj │ │ │ │ ├── Properties/ │ │ │ │ │ └── AssemblyInfo.cs │ │ │ │ ├── TestRunner.cs │ │ │ │ └── Utils/ │ │ │ │ └── MessageSender/ │ │ │ │ ├── MockSenderAsyncQueue.cs │ │ │ │ └── MockSenderMap.cs │ │ │ ├── CoreTest/ │ │ │ │ ├── App.config │ │ │ │ ├── CoreTest.cs │ │ │ │ ├── CoreTest.csproj │ │ │ │ ├── Devices/ │ │ │ │ │ ├── SocketClientTestDevice.cs │ │ │ │ │ └── SocketServiceTestDevice.cs │ │ │ │ ├── ITest.cs │ │ │ │ ├── Properties/ │ │ │ │ │ └── AssemblyInfo.cs │ │ │ │ ├── RealDataTest.cs │ │ │ │ ├── SocketTest.cs │ │ │ │ ├── TestRunner.cs │ │ │ │ ├── Utils/ │ │ │ │ │ ├── Generators/ │ │ │ │ │ │ └── RandomSensorDataGenerator.cs │ │ │ │ │ ├── Loader/ │ │ │ │ │ │ └── Loader.cs │ │ │ │ │ ├── Logger/ │ │ │ │ │ │ └── TestLogger.cs │ │ │ │ │ └── MessageSender/ │ │ │ │ │ └── MockSender.cs │ │ │ │ ├── WebServiceTest.cs │ │ │ │ └── packages.config │ │ │ ├── DeviceAdapterTestMock/ │ │ │ │ ├── DeviceAdapterTestMock.cs │ │ │ │ ├── DeviceAdapterTestMock.csproj │ │ │ │ ├── Properties/ │ │ │ │ │ └── AssemblyInfo.cs │ │ │ │ └── packages.config │ │ │ └── SocketServiceDeviceMock/ │ │ │ ├── App.config │ │ │ ├── Properties/ │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── SocketServiceDeviceMock.cs │ │ │ ├── SocketServiceDeviceMock.csproj │ │ │ ├── Utils/ │ │ │ │ └── Logger/ │ │ │ │ └── ConsoleLogger.cs │ │ │ └── packages.config │ │ ├── UpgradeLog.htm │ │ ├── WiFi-Configuration.md │ │ ├── WindowsEXE/ │ │ │ ├── App.config │ │ │ ├── Microsoft.ConnectTheDots.GatewayExe.csproj │ │ │ ├── NLog.config │ │ │ ├── NLog.xsd │ │ │ ├── Program.cs │ │ │ ├── Properties/ │ │ │ │ └── AssemblyInfo.cs │ │ │ └── packages.config │ │ └── WindowsService/ │ │ ├── App.config │ │ ├── Microsoft.ConnectTheDots.GatewayService.csproj │ │ ├── NLog.config │ │ ├── NLog.xsd │ │ ├── ProjectInstaller.cs │ │ ├── Properties/ │ │ │ └── AssemblyInfo.cs │ │ ├── Utils/ │ │ │ └── Logger/ │ │ │ └── EventLogger.cs │ │ ├── WindowsService.cs │ │ └── packages.config │ └── readme.md ├── GettingStarted.md ├── SupportedDevices.md ├── license.txt ├── notice.txt └── readme.md
SYMBOL INDEX (791 symbols across 141 files)
FILE: Azure/EHConsole/EHConsole/Program.cs
class Program (line 48) | class Program
class CloudWebDeployInputs (line 50) | internal class CloudWebDeployInputs
method GetInputs (line 70) | public bool GetInputs( out CloudWebDeployInputs result )
method Run (line 102) | bool Run( )
method Main (line 241) | static int Main( string[] args )
FILE: Azure/MachineLearning/SQL/Tables/AlertsData.sql
type dbo (line 1) | CREATE TABLE [dbo].[AlertsData]
FILE: Azure/MachineLearning/WorkerHost/Analyzer.cs
class ADResult (line 17) | class ADResult
method GetADResults (line 22) | public List<AnomalyRecord> GetADResults()
class Analyzer (line 44) | class Analyzer
method Analyzer (line 52) | public Analyzer(string anomalyDetectionApiUrl, string anomalyDetection...
method Analyze (line 63) | public Task<AnomalyRecord[]> Analyze(SensorDataContract[] data)
method GetTimeseriesData (line 77) | private static string GetTimeseriesData(SensorDataContract[] data)
method FindMaxValue (line 109) | public static double FindMaxValue(IEnumerable<double> values)
method filterAnomaly (line 116) | private AnomalyRecord[] filterAnomaly(IEnumerable<AnomalyRecord> analy...
method GetAlertsFromAnomalyDetectionAPI (line 122) | public AnomalyRecord[] GetAlertsFromAnomalyDetectionAPI(string timeSer...
method GetAlertsFromRRS (line 144) | private Task<AnomalyRecord[]> GetAlertsFromRRS(string timeSeriesData)
FILE: Azure/MachineLearning/WorkerHost/AnomalyRecord.cs
class AnomalyRecord (line 5) | public class AnomalyRecord
method Parse (line 16) | public static AnomalyRecord Parse(string[] values)
method ToString (line 34) | public override string ToString()
FILE: Azure/MachineLearning/WorkerHost/CircularBuffer.cs
class CircularBuffer (line 5) | public class CircularBuffer<T>
method CircularBuffer (line 10) | public CircularBuffer(int size)
method Add (line 21) | public void Add(T obj)
method GetAll (line 31) | public T[] GetAll()
FILE: Azure/MachineLearning/WorkerHost/Data.Outputs/BlobWriter.cs
class BlobWriter (line 9) | public class BlobWriter
method Connect (line 15) | public bool Connect(string blobNamePrefix, string containerName, strin...
method WriteLine (line 32) | public void WriteLine(string line)
method Flush (line 48) | public void Flush()
method SetUpContainer (line 59) | private CloudBlobContainer SetUpContainer(string storageConnectionString,
FILE: Azure/MachineLearning/WorkerHost/Data.Outputs/SQLOutputRepository.cs
class SQLOutputRepository (line 8) | public class SQLOutputRepository
method SQLOutputRepository (line 26) | public SQLOutputRepository(string sqlDatabaseConnectionString)
method ProcessEvents (line 31) | public void ProcessEvents(IList<SensorDataContract> eventDataList)
FILE: Azure/MachineLearning/WorkerHost/Data.Outputs/Utils/SqlDBReaderSafeParser.cs
class SqlDBReaderSafeParser (line 7) | public static class SqlDBReaderSafeParser
method SafeParse (line 9) | public static T SafeParse<T>(this SqlDataReader reader, string columnN...
method SafeParse (line 17) | public static T SafeParse<T>(this object dataValue, T defaultValue)
FILE: Azure/MachineLearning/WorkerHost/EventHubReader.cs
class EventHubReader (line 17) | class EventHubReader
method EventHubReader (line 35) | public EventHubReader(int messagesBufferSize, string consumerGroupPref...
method Close (line 49) | public void Close()
method Run (line 60) | public void Run(string connectionString, string hubName, string measur...
method Process (line 109) | void Process(int iPart, bool firstReport, IEnumerable<EventData> batch)
method GetHistoricData (line 172) | public Dictionary<string, SensorDataContract[]> GetHistoricData()
method OnTaskComplete (line 181) | void OnTaskComplete(Task<IEnumerable<EventData>> task, int iPart)
FILE: Azure/MachineLearning/WorkerHost/Program.cs
class WorkerHost (line 19) | public class WorkerHost : RoleEntryPoint
class Configuration (line 21) | public class Configuration
method Main (line 52) | static void Main()
method Run (line 57) | public override void Run()
method StartHost (line 62) | private static void StartHost(string consumerGroupPrefix)
method Process (line 115) | public static void Process(Configuration config)
method Batch (line 217) | public static IEnumerable<IEnumerable<T>> Batch<T>(IEnumerable<T> coll...
method OutputResults (line 233) | private static string OutputResults(string from, SensorDataContract se...
FILE: Azure/MachineLearning/WorkerHost/SensorDataContract.cs
class SensorDataContract (line 6) | public class SensorDataContract
method UniqueId (line 32) | public string UniqueId()
FILE: Azure/WebSite/site/js/d3CTD.js
function clearData (line 39) | function clearData() {
function onChangeSensors (line 59) | function onChangeSensors(isAll) {
function onLoading (line 79) | function onLoading(evt) {
function onLoaded (line 86) | function onLoaded(evt) {
function onError (line 90) | function onError(evt) {
function onOpen (line 94) | function onOpen(evt) {
function addNewDataFlow (line 98) | function addNewDataFlow(eventObject) {
function addNewSensorOption (line 139) | function addNewSensorOption(newFlow, eventObject) {
function checkBulkMode (line 175) | function checkBulkMode(evt) {
function onNewEvent (line 186) | function onNewEvent(evt) {
function addOutputToConsole (line 246) | function addOutputToConsole(text) {
function onUserAction (line 252) | function onUserAction(e) {
function timerIncrement (line 256) | function timerIncrement() {
function displayQRCode (line 267) | function displayQRCode(title, URI) {
FILE: Azure/WebSite/site/js/d3CTDDataSourceFilter.js
function d3CTDDataSourceFilter (line 26) | function d3CTDDataSourceFilter(dataSource, filter) {
FILE: Azure/WebSite/site/js/d3CTDDataSourceSocket.js
function d3CTDDataSourceSocket (line 26) | function d3CTDDataSourceSocket(uri, handlers) {
FILE: Azure/WebSite/site/js/d3Chart.js
function d3Chart (line 28) | function d3Chart(containerId) {
FILE: Azure/WebSite/site/js/d3ChartControl.js
function d3ChartControl (line 25) | function d3ChartControl(containerId) {
FILE: Azure/WebSite/site/js/d3DataFlow.js
function d3DataFlow (line 36) | function d3DataFlow(flowGUID, params) {
FILE: Azure/WebSite/site/js/d3DataSourceSocket.js
function d3DataSourceSocket (line 26) | function d3DataSourceSocket(uri, handlers) {
FILE: Azure/WebSite/site/js/d3utils.js
function extendClass (line 24) | function extendClass(Child, Parent) {
function deepCopy (line 36) | function deepCopy(obj) {
function baseClass (line 54) | function baseClass() {
FILE: Azure/WebSite/site/js/devicesList.js
function updateDevicesList (line 1) | function updateDevicesList() {
function addNewDevice (line 8) | function addNewDevice()
function deleteDevice (line 15) | function deleteDevice(deviceID)
function ListSuccess (line 73) | function ListSuccess(result) {
function AddSuccess (line 151) | function AddSuccess(result) {
function DeleteSuccess (line 168) | function DeleteSuccess(result) {
function Failure (line 184) | function Failure(error) {
FILE: Azure/WebSite/site/js/qrcode.js
function QR8bitByte (line 29) | function QR8bitByte(data) {
function QRCodeModel (line 78) | function QRCodeModel(typeNumber, errorCorrectLevel) {
function QRPolynomial (line 139) | function QRPolynomial(num,shift){if(num.length==undefined){throw new Err...
function QRRSBlock (line 146) | function QRRSBlock(totalCount,dataCount){this.totalCount=totalCount;this...
function QRBitBuffer (line 149) | function QRBitBuffer(){this.buffer=[];this.length=0;}
function _isSupportCanvas (line 154) | function _isSupportCanvas() {
function _getAndroid (line 159) | function _getAndroid() {
function makeSVG (line 191) | function makeSVG(tag, attrs) {
function _onMakeImage (line 276) | function _onMakeImage() {
function _safeSetDataURI (line 310) | function _safeSetDataURI(fSuccess, fFail) {
function _getTypeNumber (line 469) | function _getTypeNumber(sText, nCorrectLevel) {
function _getUTF8Length (line 505) | function _getUTF8Length(sText) {
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/Default.aspx.cs
class Default (line 34) | public partial class Default : System.Web.UI.Page
method IsUserAuthenticated (line 38) | protected static bool IsUserAuthenticated()
method IsUserAdmin (line 45) | protected static bool IsUserAdmin()
method Page_Load (line 60) | protected void Page_Load(object sender, EventArgs e)
method GetDevicesList (line 87) | [WebMethod]
method AddDevice (line 108) | [WebMethod]
method DeleteDevice (line 135) | [WebMethod]
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/Default.aspx.designer.cs
class Default (line 13) | public partial class Default {
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/Global.asax.cs
type EventHubSettings (line 38) | public struct EventHubSettings
type GlobalSettings (line 50) | public struct GlobalSettings
class DeviceDetails (line 67) | public class DeviceDetails
method DeviceDetails (line 75) | public DeviceDetails(IDictionary<string, object> deviceInfo)
class Global (line 86) | public class Global : System.Web.HttpApplication
method AddToDeviceList (line 96) | public static void AddToDeviceList(IDictionary<string, object> deviceI...
method UpdateDeviceListFromIoTHub (line 132) | private static void UpdateDeviceListFromIoTHub()
method TriggerAndWaitDeviceListRefresh (line 149) | public static bool TriggerAndWaitDeviceListRefresh(int timeout)
method TriggerAndWaitAddDevice (line 164) | public static IoTHubHelper.AddDeviceResult TriggerAndWaitAddDevice(int...
method TriggerAndWaitDeleteDevice (line 179) | public static IoTHubHelper.DeleteDeviceResult TriggerAndWaitDeleteDevi...
method Application_Start (line 195) | protected void Application_Start(Object sender, EventArgs e)
method PingIoTHubTimer_Elapsed (line 220) | private void PingIoTHubTimer_Elapsed(object sender, System.Timers.Elap...
method Application_End (line 247) | protected void Application_End(Object sender, EventArgs e)
method CreateEventProcessorHostClient (line 256) | private void CreateEventProcessorHostClient(ref EventHubSettings event...
method GetAppSettings (line 299) | private void GetAppSettings()
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/Helpers/BlobHelper.cs
class BlobHelper (line 6) | public static class BlobHelper
method SetUpContainer (line 8) | public static CloudBlobContainer SetUpContainer(string storageConnecti...
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/Helpers/IoTHubHelper.cs
class IoTHubHelper (line 11) | public static class IoTHubHelper
method SendMessage (line 13) | public static void SendMessage(string deviceId, string messageText)
type DeleteDeviceResult (line 20) | public enum DeleteDeviceResult
method DeleteDevice (line 27) | public static DeleteDeviceResult DeleteDevice(string deviceId)
type AddDeviceResult (line 45) | public enum AddDeviceResult
method AddDevice (line 52) | public static AddDeviceResult AddDevice(string deviceId)
method ListDevices (line 71) | public static List<IDictionary<string, object>> ListDevices(int count)
method CreateDeviceConnectionString (line 102) | private static String CreateDeviceConnectionString(Device device, stri...
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/SensorInventory.cs
class SensorInventory (line 32) | public class SensorInventory
method GetSensorList (line 34) | public static ICollection<string> GetSensorList()
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/WebSocketEventProcessor.cs
class WebSocketEventProcessor (line 41) | class WebSocketEventProcessor : IEventProcessor
type MinMax (line 57) | struct MinMax { public double min; public double max;};
method ProcessEventsAsync (line 60) | public async Task ProcessEventsAsync(PartitionContext context, IEnumer...
method OpenAsync (line 289) | public Task OpenAsync(PartitionContext context)
method CloseAsync (line 314) | public async Task CloseAsync(PartitionContext context, CloseReason rea...
method ExceptionReceived (line 340) | public static void ExceptionReceived(object sender, ExceptionReceivedE...
method GetAllBufferedMessages (line 350) | public static SortedList<DateTime, List<IDictionary<string, object>>> ...
class SearchHelper (line 374) | public static class SearchHelper
method BinarySearch (line 376) | private static int BinarySearch<T>(IList<T> list, T value)
method FindFirstIndexGreaterThanOrEqualTo (line 392) | public static int FindFirstIndexGreaterThanOrEqualTo<T, U>
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/WebSocketHandler.cs
class WebSocketConnectController (line 40) | public class WebSocketConnectController : ApiController
method Get (line 43) | public HttpResponseMessage Get(string clientId)
class MyWebSocketHandler (line 50) | sealed class MyWebSocketHandler : WebSocketHandler
method MyWebSocketHandler (line 56) | public MyWebSocketHandler()
method OnOpen (line 60) | public override void OnOpen()
method OnClose (line 69) | public override void OnClose()
method OnMessage (line 78) | public override void OnMessage(string message)
method ResendDataToClient (line 141) | private void ResendDataToClient()
method Filter (line 194) | private bool Filter(IDictionary<string, object> message)
method SendToClients (line 225) | public static void SendToClients(IDictionary<string, object> message)
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/js/d3CTD.js
function clearData (line 39) | function clearData() {
function onChangeSensors (line 59) | function onChangeSensors(isAll) {
function onLoading (line 79) | function onLoading(evt) {
function onLoaded (line 86) | function onLoaded(evt) {
function onError (line 90) | function onError(evt) {
function onOpen (line 94) | function onOpen(evt) {
function addNewDataFlow (line 98) | function addNewDataFlow(eventObject) {
function addNewSensorOption (line 139) | function addNewSensorOption(newFlow, eventObject) {
function checkBulkMode (line 175) | function checkBulkMode(evt) {
function onNewEvent (line 186) | function onNewEvent(evt) {
function addOutputToConsole (line 246) | function addOutputToConsole(text) {
function onUserAction (line 252) | function onUserAction(e) {
function timerIncrement (line 256) | function timerIncrement() {
function displayQRCode (line 267) | function displayQRCode(title, URI) {
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/js/d3CTDDataSourceFilter.js
function d3CTDDataSourceFilter (line 26) | function d3CTDDataSourceFilter(dataSource, filter) {
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/js/d3CTDDataSourceSocket.js
function d3CTDDataSourceSocket (line 26) | function d3CTDDataSourceSocket(uri, handlers) {
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/js/d3Chart.js
function d3Chart (line 28) | function d3Chart(containerId) {
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/js/d3ChartControl.js
function d3ChartControl (line 25) | function d3ChartControl(containerId) {
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/js/d3DataFlow.js
function d3DataFlow (line 36) | function d3DataFlow(flowGUID, params) {
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/js/d3DataSourceSocket.js
function d3DataSourceSocket (line 26) | function d3DataSourceSocket(uri, handlers) {
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/js/d3utils.js
function extendClass (line 24) | function extendClass(Child, Parent) {
function deepCopy (line 36) | function deepCopy(obj) {
function baseClass (line 54) | function baseClass() {
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/js/devicesList.js
function updateDevicesList (line 1) | function updateDevicesList() {
function addNewDevice (line 8) | function addNewDevice()
function deleteDevice (line 15) | function deleteDevice(deviceID)
function ListSuccess (line 73) | function ListSuccess(result) {
function AddSuccess (line 151) | function AddSuccess(result) {
function DeleteSuccess (line 168) | function DeleteSuccess(result) {
function Failure (line 184) | function Failure(error) {
FILE: Azure/WebSite/source/ConnectTheDotsWebSite/js/qrcode.js
function QR8bitByte (line 29) | function QR8bitByte(data) {
function QRCodeModel (line 78) | function QRCodeModel(typeNumber, errorCorrectLevel) {
function QRPolynomial (line 139) | function QRPolynomial(num,shift){if(num.length==undefined){throw new Err...
function QRRSBlock (line 146) | function QRRSBlock(totalCount,dataCount){this.totalCount=totalCount;this...
function QRBitBuffer (line 149) | function QRBitBuffer(){this.buffer=[];this.length=0;}
function _isSupportCanvas (line 154) | function _isSupportCanvas() {
function _getAndroid (line 159) | function _getAndroid() {
function makeSVG (line 191) | function makeSVG(tag, attrs) {
function _onMakeImage (line 276) | function _onMakeImage() {
function _safeSetDataURI (line 310) | function _safeSetDataURI(fSuccess, fFail) {
function _getTypeNumber (line 469) | function _getTypeNumber(sText, nCorrectLevel) {
function _getUTF8Length (line 505) | function _getUTF8Length(sText) {
FILE: Devices/DirectlyConnectedDevices/Common/csharp/ConnectTheDotsHelper.cs
class D2CMessage (line 17) | [DataContract]
class CTDSensor (line 45) | [DataContract]
class C2DMessage (line 56) | [DataContract]
class ConnectTheDots (line 95) | public class ConnectTheDots
method AddSensor (line 102) | public void AddSensor(string MeasureName, string UnitOfMeasure, bool s...
method setSensorStreaming (line 120) | public void setSensorStreaming(string MeasureName, bool on)
class ReceivedMessageEventArgs (line 159) | public class ReceivedMessageEventArgs : System.EventArgs
method ReceivedMessageEventArgs (line 165) | public ReceivedMessageEventArgs(C2DMessage message)
method OnReceivedMessage (line 172) | protected virtual void OnReceivedMessage(ReceivedMessageEventArgs e)
method Serialize (line 181) | private byte[] Serialize(object obj)
method DeSerialize (line 191) | private C2DMessage DeSerialize(byte[] data)
method sendDeviceTelemetryData (line 200) | public async void sendDeviceTelemetryData(D2CMessage[] data)
method ExtractDeviceIdFromConnectionString (line 225) | public string ExtractDeviceIdFromConnectionString(string connectionStr...
method Connect (line 237) | public bool Connect()
method Disconnect (line 348) | public bool Disconnect()
FILE: Devices/DirectlyConnectedDevices/Common/javascript/connectthedots.js
function validate_settings (line 40) | function validate_settings(settings, options) {
function format_sensor_data (line 55) | function format_sensor_data(deviceid, displayname, organization, locatio...
function send_raw_message (line 127) | function send_raw_message(raw_message)
function printResultFor (line 168) | function printResultFor(op) {
FILE: Devices/DirectlyConnectedDevices/ESP8266/connect_the_dots/connect_the_dots.cpp
function sendMessage (line 30) | static void sendMessage(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, cons...
function IOTHUBMESSAGE_DISPOSITION_RESULT (line 53) | static IOTHUBMESSAGE_DISPOSITION_RESULT IoTHubMessage(IOTHUB_MESSAGE_HAN...
function connect_the_dots_run (line 85) | void connect_the_dots_run(void)
FILE: Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonGrove/inteledisonctd.js
function linear (line 33) | function linear(start, end, step, steps) {
FILE: Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonSensorTag/inteledisonsensortagctd.js
function onDiscover (line 42) | function onDiscover(sensorTag) {
FILE: Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonSensorTag/lib/common.js
function SensorTagCommon (line 46) | function SensorTagCommon() {
FILE: Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonXadow/inteledisonctd.js
function connect_the_dots (line 34) | function connect_the_dots()
FILE: Devices/DirectlyConnectedDevices/NodeJS/SensorTag/sensorWorker.js
function onErrorRestart (line 8) | function onErrorRestart(){
function onDiscover (line 13) | function onDiscover(sensorTag) {
FILE: Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/App.xaml.cs
class App (line 13) | sealed partial class App : Application
method App (line 19) | public App()
method OnLaunched (line 30) | protected override void OnLaunched(LaunchActivatedEventArgs e)
method OnNavigationFailed (line 76) | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
method OnSuspending (line 88) | private void OnSuspending(object sender, SuspendingEventArgs e)
FILE: Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/MainPage.xaml.cs
class MainPage (line 18) | public sealed partial class MainPage : Page
method MainPage (line 29) | public MainPage()
method CTD_ReceivedMessage (line 77) | private void CTD_ReceivedMessage(object sender, EventArgs e)
method checkConfig (line 94) | private bool checkConfig()
method updateLocation (line 105) | private async Task updateLocation()
method toggleButton_Checked (line 130) | private void toggleButton_Checked(object sender, RoutedEventArgs e)
method toggleButton_Unchecked (line 141) | private void toggleButton_Unchecked(object sender, RoutedEventArgs e)
method TBDeviceName_TextChanged (line 152) | private void TBDeviceName_TextChanged(object sender, TextChangedEventA...
method TBConnectionString_TextChanged (line 165) | private void TBConnectionString_TextChanged(object sender, TextChanged...
method ConnectToggle_Checked (line 177) | private void ConnectToggle_Checked(object sender, RoutedEventArgs e)
method ConnectToggle_Unchecked (line 193) | private void ConnectToggle_Unchecked(object sender, RoutedEventArgs e)
method SkinTemperature_ReadingChanged (line 206) | private async void SkinTemperature_ReadingChanged(object sender, BandS...
method HeartRate_ReadingChanged (line 219) | private async void HeartRate_ReadingChanged(object sender, BandSensorR...
method Accelerometer_ReadingChanged (line 232) | private async void Accelerometer_ReadingChanged(object sender, BandSen...
method AddBandSensor (line 245) | private async void AddBandSensor<T>(IBandSensor<T> sensor,
method connectToBand (line 271) | private async Task connectToBand()
method cbHeartRate_Checked (line 302) | private void cbHeartRate_Checked(object sender, RoutedEventArgs e)
method cbHeartRate_Unchecked (line 308) | private void cbHeartRate_Unchecked(object sender, RoutedEventArgs e)
method cbSkinTemperature_Checked (line 314) | private void cbSkinTemperature_Checked(object sender, RoutedEventArgs e)
method cbSkinTemperature_Unchecked (line 320) | private void cbSkinTemperature_Unchecked(object sender, RoutedEventArg...
method cbSAccelerometer_Unchecked (line 326) | private void cbSAccelerometer_Unchecked(object sender, RoutedEventArgs e)
method cbSAccelerometer_Checked (line 332) | private void cbSAccelerometer_Checked(object sender, RoutedEventArgs e)
FILE: Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/App.xaml.cs
class App (line 13) | sealed partial class App : Application
method App (line 19) | public App()
method OnLaunched (line 33) | protected override void OnLaunched(LaunchActivatedEventArgs e)
method OnNavigationFailed (line 79) | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
method OnSuspending (line 91) | private void OnSuspending(object sender, SuspendingEventArgs e)
FILE: Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/MainPage.xaml.cs
class MainPage (line 19) | public sealed partial class MainPage : Page
method MainPage (line 26) | public MainPage()
method CTD_ReceivedMessage (line 84) | private async void CTD_ReceivedMessage(object sender, EventArgs e)
method checkConfig (line 100) | private bool checkConfig()
method updateLocation (line 111) | private async Task updateLocation()
method toggleButton_Checked (line 136) | private void toggleButton_Checked(object sender, RoutedEventArgs e)
method toggleButton_Unchecked (line 146) | private void toggleButton_Unchecked(object sender, RoutedEventArgs e)
method TempSlider_ValueChanged (line 156) | private void TempSlider_ValueChanged(object sender, RangeBaseValueChan...
method HmdtSlider_ValueChanged (line 166) | private void HmdtSlider_ValueChanged(object sender, RangeBaseValueChan...
method TBDeviceName_TextChanged (line 176) | private void TBDeviceName_TextChanged(object sender, TextChangedEventA...
method TBConnectionString_TextChanged (line 188) | private void TBConnectionString_TextChanged(object sender, TextChanged...
method ConnectToggle_Checked (line 203) | private void ConnectToggle_Checked(object sender, RoutedEventArgs e)
method ConnectToggle_Unchecked (line 220) | private void ConnectToggle_Unchecked(object sender, RoutedEventArgs e)
method ScanCode (line 239) | private async Task ScanCode()
method buttonScanCode_Tapped (line 271) | private async void buttonScanCode_Tapped(object sender, Windows.UI.Xam...
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/MainActivity.cs
class MainActivity (line 15) | [Activity (Label = "XamarinSimulatedSensors.Droid", MainLauncher = true,...
method OnCreate (line 31) | protected override void OnCreate (Bundle bundle)
method ScanCode (line 90) | private async Task ScanCode()
method ButtonScan_Click (line 119) | private async void ButtonScan_Click(object sender, EventArgs e)
method Device_ReceivedMessage (line 127) | private void Device_ReceivedMessage(object sender, EventArgs e)
method SeekHumidity_ProgressChanged (line 135) | private void SeekHumidity_ProgressChanged(object sender, SeekBar.Progr...
method SeekTemperature_ProgressChanged (line 141) | private void SeekTemperature_ProgressChanged(object sender, SeekBar.Pr...
method ButtonSend_Click (line 147) | private void ButtonSend_Click(object sender, EventArgs e)
method ButtonConnect_Click (line 162) | private void ButtonConnect_Click(object sender, EventArgs e)
method TextConnectionString_TextChanged (line 192) | private void TextConnectionString_TextChanged(object sender, Android.T...
method TextDeviceName_TextChanged (line 198) | private void TextDeviceName_TextChanged(object sender, Android.Text.Te...
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/Resources/Resource.designer.cs
class Resource (line 18) | [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.T...
method Resource (line 22) | static Resource()
method UpdateIdValues (line 27) | public static void UpdateIdValues()
class Attribute (line 36) | public partial class Attribute
method Attribute (line 39) | static Attribute()
method Attribute (line 44) | private Attribute()
class Drawable (line 49) | public partial class Drawable
method Drawable (line 58) | static Drawable()
method Drawable (line 63) | private Drawable()
class Id (line 68) | public partial class Id
method Id (line 113) | static Id()
method Id (line 118) | private Id()
class Layout (line 123) | public partial class Layout
method Layout (line 135) | static Layout()
method Layout (line 140) | private Layout()
class String (line 145) | public partial class String
method String (line 160) | static String()
method String (line 165) | private String()
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Form1.Designer.cs
class Form1 (line 3) | partial class Form1
method Dispose (line 14) | protected override void Dispose(bool disposing)
method InitializeComponent (line 29) | private void InitializeComponent()
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Form1.cs
class Form1 (line 14) | public partial class Form1 : Form
method Form1 (line 20) | public Form1()
method Device_ReceivedMessage (line 51) | private void Device_ReceivedMessage(object sender, EventArgs e)
method TrackBarHumidity_ValueChanged (line 58) | private void TrackBarHumidity_ValueChanged(object sender, EventArgs e)
method TrackBarTemperature_ValueChanged (line 64) | private void TrackBarTemperature_ValueChanged(object sender, EventArgs e)
method TextConnectionString_TextChanged (line 70) | private void TextConnectionString_TextChanged(object sender, EventArgs e)
method TextDeviceName_TextChanged (line 76) | private void TextDeviceName_TextChanged(object sender, EventArgs e)
method ButtonSend_Click (line 82) | private void ButtonSend_Click(object sender, EventArgs e)
method ButtonConnect_Click (line 97) | private void ButtonConnect_Click(object sender, EventArgs e)
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Program.cs
class Program (line 9) | static class Program
method Main (line 14) | [STAThread]
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Properties/Resources.Designer.cs
class Resources (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Resources (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Properties/Settings.Designer.cs
class Settings (line 15) | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.iOS/AppDelegate.cs
class AppDelegate (line 8) | [Register ("AppDelegate")]
method FinishedLaunching (line 18) | public override bool FinishedLaunching (UIApplication application, NSD...
method OnResignActivation (line 25) | public override void OnResignActivation (UIApplication application)
method DidEnterBackground (line 33) | public override void DidEnterBackground (UIApplication application)
method WillEnterForeground (line 39) | public override void WillEnterForeground (UIApplication application)
method OnActivated (line 45) | public override void OnActivated (UIApplication application)
method WillTerminate (line 51) | public override void WillTerminate (UIApplication application)
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.iOS/Main.cs
class Application (line 10) | public class Application
method Main (line 13) | static void Main (string[] args)
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.iOS/ViewController.cs
class ViewController (line 7) | public partial class ViewController : UIViewController
method ViewController (line 11) | public ViewController (IntPtr handle) : base (handle)
method ViewDidLoad (line 15) | public override void ViewDidLoad ()
method SliderHumidity_ValueChanged (line 53) | private void SliderHumidity_ValueChanged(object sender, EventArgs e)
method SliderTemperature_ValueChanged (line 59) | private void SliderTemperature_ValueChanged(object sender, EventArgs e)
method TextConnectionString_EditingDidEnd (line 65) | private void TextConnectionString_EditingDidEnd(object sender, EventAr...
method TextDisplayName_EditingDidEnd (line 71) | private void TextDisplayName_EditingDidEnd(object sender, EventArgs e)
method ButtonSend_TouchUpInside (line 77) | private void ButtonSend_TouchUpInside(object sender, EventArgs e)
method ButtonConnect_TouchUpInside (line 91) | private void ButtonConnect_TouchUpInside(object sender, EventArgs e)
method DidReceiveMemoryWarning (line 118) | public override void DidReceiveMemoryWarning ()
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.iOS/ViewController.designer.cs
class ViewController (line 14) | [Register ("ViewController")]
method ReleaseDesignerOutlets (line 53) | void ReleaseDesignerOutlets ()
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors/Helpers/Settings.cs
class Settings (line 12) | public static class Settings
FILE: Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors/MyClass.cs
class MyClass (line 9) | public class MyClass:ConnectTheDots
method MyClass (line 11) | public MyClass()
method checkConfig (line 22) | public bool checkConfig()
method UpdateSensorData (line 37) | public void UpdateSensorData(string SensorName, double value)
FILE: Devices/GatewayConnectedDevices/BLEMoisture/BLEMoistureSensor.py
function eventHandler (line 57) | def eventHandler(macAddress, value):
class BLEMoistureSensor (line 60) | class BLEMoistureSensor:
method __init__ (line 66) | def __init__(self) :
method printpacket (line 78) | def printpacket(self, pkt):
method packed_bdaddr_to_string (line 83) | def packed_bdaddr_to_string(self, bdaddr_packed):
method setSensorDataAvailableEvent (line 87) | def setSensorDataAvailableEvent(self, func):
method Listen (line 90) | def Listen(self):
FILE: Devices/GatewayConnectedDevices/BLEMoisture/RedBear_BLE_nano/main.cpp
function nrf_gpio_cfg__high_current_output (line 40) | void nrf_gpio_cfg__high_current_output(uint32_t pin_number)
function MeasureMoisture (line 51) | void MeasureMoisture()
function Advertise (line 87) | void Advertise()
function periodicCallback (line 92) | void periodicCallback(void)
function main (line 98) | int main(void)
FILE: Devices/GatewayConnectedDevices/BLEMoisture/SensorAgent.py
function processSensorData (line 45) | def processSensorData(macAddress, value) :
function main (line 85) | def main() :
FILE: Devices/GatewayConnectedDevices/BluetoothUARTExample/SetupSerialBaudRate.py
function fixEtcInittab (line 26) | def fixEtcInittab(baudrate):
function fixBootCmdLine (line 49) | def fixBootCmdLine(baudrate):
function main (line 73) | def main(arguments):
FILE: Devices/GatewayConnectedDevices/BtUSB_2_BtUART_Example/BtUSB_2_BtUART_Example.py
function connectSockets (line 46) | def connectSockets(bt, gatewaySock):
function recvDataFromBT (line 71) | def recvDataFromBT(bt, packetLen):
FILE: Devices/GatewayConnectedDevices/Hydrology/DO2Sensor.py
class DO2Sensor (line 24) | class DO2Sensor(object):
method __init__ (line 28) | def __init__(self, device = default_device):
method GetDataSample (line 32) | def GetDataSample(self) :
function main (line 42) | def main() :
FILE: Devices/GatewayConnectedDevices/Hydrology/ECSensor.py
class ECSensor (line 30) | class ECSensor:
method __init__ (line 36) | def __init__(self, address = default_address, bus = default_bus):
method set_i2c_address (line 47) | def set_i2c_address(self, addr):
method write (line 55) | def write(self, string):
method read (line 60) | def read(self, num_of_bytes = 31):
method query (line 71) | def query(self, string):
method close (line 84) | def close(self):
function main (line 88) | def main () :
FILE: Devices/GatewayConnectedDevices/Hydrology/MoistureSensor.py
class Adafruit_I2C (line 34) | class Adafruit_I2C:
method getPiRevision (line 37) | def getPiRevision():
method getPiI2CBusNumber (line 58) | def getPiI2CBusNumber():
method __init__ (line 62) | def __init__(self, address, busnum=-1, debug=False):
method reverseByteOrder (line 71) | def reverseByteOrder(self, data):
method errMsg (line 81) | def errMsg(self):
method write8 (line 85) | def write8(self, reg, value):
method write16 (line 94) | def write16(self, reg, value):
method writeRaw8 (line 104) | def writeRaw8(self, value):
method writeList (line 113) | def writeList(self, reg, list):
method readList (line 123) | def readList(self, reg, length):
method readU8 (line 135) | def readU8(self, reg):
method readS8 (line 146) | def readS8(self, reg):
method readU16 (line 158) | def readU16(self, reg, little_endian=True):
method readS16 (line 172) | def readS16(self, reg, little_endian=True):
class ADS1x15 (line 202) | class ADS1x15:
method __init__ (line 314) | def __init__(self, address=0x48, ic=__IC_ADS1015, debug=False):
method readADCSingleEnded (line 337) | def readADCSingleEnded(self, channel=0, pga=6144, sps=250):
method readADCDifferential (line 412) | def readADCDifferential(self, chP=0, chN=1, pga=6144, sps=250):
method readADCDifferential01 (line 489) | def readADCDifferential01(self, pga=6144, sps=250):
method readADCDifferential03 (line 498) | def readADCDifferential03(self, pga=6144, sps=250):
method readADCDifferential13 (line 507) | def readADCDifferential13(self, pga=6144, sps=250):
method readADCDifferential23 (line 516) | def readADCDifferential23(self, pga=6144, sps=250):
method startContinuousConversion (line 525) | def startContinuousConversion(self, channel=0, pga=6144, sps=250):
method startContinuousDifferentialConversion (line 604) | def startContinuousDifferentialConversion(self, chP=0, chN=1, pga=6144...
method stopContinuousConversion (line 682) | def stopContinuousConversion(self):
method getLastConversionResults (line 693) | def getLastConversionResults(self):
method startSingleEndedComparator (line 710) | def startSingleEndedComparator(self, channel, thresholdHigh, threshold...
method startDifferentialComparator (line 811) | def startDifferentialComparator(self, chP, chN, thresholdHigh, thresho...
class MoistureSensor (line 916) | class MoistureSensor:
method __init__ (line 919) | def __init__(self) :
method GetDataSample (line 922) | def GetDataSample(self) :
function main (line 930) | def main() :
FILE: Devices/GatewayConnectedDevices/Hydrology/SensorAgent.py
class SensorAgent (line 48) | class SensorAgent:
method __init__ (line 55) | def __init__(self) :
method connectToServer (line 60) | def connectToServer(self) :
method close (line 74) | def close(self) :
method sendMessage (line 77) | def sendMessage(self, measureName, value) :
method processSensorData (line 84) | def processSensorData(self) :
function main (line 102) | def main() :
FILE: Devices/Gateways/GatewayService/Common/Adapter/SensorEndpoint.cs
class SensorEndpoint (line 29) | public class SensorEndpoint
FILE: Devices/Gateways/GatewayService/Common/ILogger.cs
type ILogger (line 27) | public interface ILogger
method Flush (line 29) | void Flush( );
method LogError (line 31) | void LogError( string logMessage );
method LogInfo (line 33) | void LogInfo( string logMessage );
FILE: Devices/Gateways/GatewayService/Common/IPAddressHelper.cs
class IPAddressHelper (line 34) | public static class IPAddressHelper
method GetIPAddressString (line 36) | public static void GetIPAddressString( ref string IPString )
method GetLocalIPAddressList (line 75) | public static IEnumerable<IPAddress> GetLocalIPAddressList( )
method GetIPAddressByPing (line 86) | public static IPAddress GetIPAddressByPing( string hostName, int timeo...
FILE: Devices/Gateways/GatewayService/Common/Logger/NLogEventLogger.cs
class NLogEventLogger (line 29) | public class NLogEventLogger : ILogger
method NLogEventLogger (line 61) | private NLogEventLogger( )
method Flush (line 68) | public void Flush( )
method LogError (line 73) | public void LogError( string logMessage )
method LogInfo (line 78) | public void LogInfo( string logMessage )
FILE: Devices/Gateways/GatewayService/Common/Logger/SafeLogger.cs
class SafeLogger (line 28) | public class SafeLogger : ILogger
method SafeLogger (line 34) | protected SafeLogger( ILogger logger )
method FromLogger (line 39) | static public SafeLogger FromLogger( ILogger logger )
method Flush (line 49) | public void Flush( )
method LogError (line 57) | public void LogError( string logMessage )
method LogInfo (line 65) | public void LogInfo( string logMessage )
FILE: Devices/Gateways/GatewayService/Common/Logger/TunableLogger.cs
class TunableLogger (line 31) | public class TunableLogger : ILogger
type LoggingLevel (line 33) | public enum LoggingLevel
method TunableLogger (line 51) | protected TunableLogger( ILogger logger )
method LevelFromString (line 59) | public static LoggingLevel LevelFromString( string value )
method FromLogger (line 80) | public static TunableLogger FromLogger( ILogger logger )
method Flush (line 92) | public void Flush( )
method LogError (line 100) | public void LogError( string logMessage )
method LogInfo (line 108) | public void LogInfo( string logMessage )
FILE: Devices/Gateways/GatewayService/Common/Platform.cs
class Platform (line 29) | public static class Platform
FILE: Devices/Gateways/GatewayService/Common/SafeAction.cs
class SafeAction (line 31) | public class SafeAction<TParam>
method SafeAction (line 38) | public SafeAction( Action<TParam> action, ILogger logger )
method SafeInvoke (line 44) | public void SafeInvoke( TParam obj )
method SafeAction (line 65) | public SafeAction( Action action, ILogger logger )
method SafeInvoke (line 71) | public void SafeInvoke( )
class SafeAction (line 58) | public class SafeAction
method SafeAction (line 38) | public SafeAction( Action<TParam> action, ILogger logger )
method SafeInvoke (line 44) | public void SafeInvoke( TParam obj )
method SafeAction (line 65) | public SafeAction( Action action, ILogger logger )
method SafeInvoke (line 71) | public void SafeInvoke( )
FILE: Devices/Gateways/GatewayService/Common/SafeFunction.cs
class SafeFunc (line 31) | public class SafeFunc<TResult>
method SafeFunc (line 38) | public SafeFunc( Func<TResult> function, ILogger logger )
method SafeInvoke (line 44) | public TResult SafeInvoke( )
FILE: Devices/Gateways/GatewayService/Common/Threading/TaskWrapper.cs
class TaskWrapper (line 41) | public class TaskWrapper
method Run (line 47) | public static TaskWrapper Run( Action action )
method WaitAll (line 56) | public static void WaitAll( params TaskWrapper[] tasks )
method BatchWaitAll (line 68) | public static void BatchWaitAll( params TaskWrapper[] tasks )
method TaskWrapper (line 108) | protected TaskWrapper( )
method TaskWrapper (line 112) | protected TaskWrapper( Action action )
method TaskWrapper (line 117) | protected TaskWrapper( _THREADING.Task t )
method Start (line 123) | public void Start()
method Wait (line 128) | public void Wait()
method Run (line 168) | public static TaskWrapper<TResult> Run( Func<TResult> function )
method MakeDefault (line 179) | private static Action MakeDefault<T>( Func<T> function )
method TaskWrapper (line 184) | public TaskWrapper( Func<TResult> function )
method TaskWrapper (line 192) | private TaskWrapper( _THREADING.Task<TResult> t )
method ContinueWith (line 197) | public TaskWrapper<TNewResult> ContinueWith<TNewResult>( Func<_THREADI...
method Run (line 228) | public static TaskWrapper Run( Action action )
method BatchWaitAll (line 237) | public static void BatchWaitAll( params TaskWrapper[] tasks )
method TaskWrapper (line 277) | protected TaskWrapper( )
method TaskWrapper (line 284) | protected TaskWrapper( Action action )
method Start (line 290) | public virtual void Start( )
method Wait (line 295) | public void Wait( )
method SetStatus (line 316) | protected void SetStatus( _THREADING.TaskStatus status )
method IsRunningOrDone (line 321) | protected bool IsRunningOrDone( )
method SetCompleted (line 329) | protected void SetCompleted( )
method WaitCompleted (line 334) | protected void WaitCompleted( )
method Execute (line 339) | private void Execute( object state )
method Run (line 367) | public static TaskWrapper<TResult> Run( Func<TResult> function )
method TaskWrapper (line 378) | private TaskWrapper( Func<TResult> func )
method Start (line 384) | public override void Start( )
method MakeTask (line 389) | private TaskWrapper<TOutput> MakeTask<TInput, TOutput>( Func<TaskWrapp...
method ContinueWith (line 397) | public TaskWrapper<TNewResult> ContinueWith<TNewResult>( Func<TaskWrap...
method Execute (line 422) | private void Execute( object state )
class TaskWrapper (line 162) | public class TaskWrapper<TResult> : TaskWrapper
method Run (line 47) | public static TaskWrapper Run( Action action )
method WaitAll (line 56) | public static void WaitAll( params TaskWrapper[] tasks )
method BatchWaitAll (line 68) | public static void BatchWaitAll( params TaskWrapper[] tasks )
method TaskWrapper (line 108) | protected TaskWrapper( )
method TaskWrapper (line 112) | protected TaskWrapper( Action action )
method TaskWrapper (line 117) | protected TaskWrapper( _THREADING.Task t )
method Start (line 123) | public void Start()
method Wait (line 128) | public void Wait()
method Run (line 168) | public static TaskWrapper<TResult> Run( Func<TResult> function )
method MakeDefault (line 179) | private static Action MakeDefault<T>( Func<T> function )
method TaskWrapper (line 184) | public TaskWrapper( Func<TResult> function )
method TaskWrapper (line 192) | private TaskWrapper( _THREADING.Task<TResult> t )
method ContinueWith (line 197) | public TaskWrapper<TNewResult> ContinueWith<TNewResult>( Func<_THREADI...
method Run (line 228) | public static TaskWrapper Run( Action action )
method BatchWaitAll (line 237) | public static void BatchWaitAll( params TaskWrapper[] tasks )
method TaskWrapper (line 277) | protected TaskWrapper( )
method TaskWrapper (line 284) | protected TaskWrapper( Action action )
method Start (line 290) | public virtual void Start( )
method Wait (line 295) | public void Wait( )
method SetStatus (line 316) | protected void SetStatus( _THREADING.TaskStatus status )
method IsRunningOrDone (line 321) | protected bool IsRunningOrDone( )
method SetCompleted (line 329) | protected void SetCompleted( )
method WaitCompleted (line 334) | protected void WaitCompleted( )
method Execute (line 339) | private void Execute( object state )
method Run (line 367) | public static TaskWrapper<TResult> Run( Func<TResult> function )
method TaskWrapper (line 378) | private TaskWrapper( Func<TResult> func )
method Start (line 384) | public override void Start( )
method MakeTask (line 389) | private TaskWrapper<TOutput> MakeTask<TInput, TOutput>( Func<TaskWrapp...
method ContinueWith (line 397) | public TaskWrapper<TNewResult> ContinueWith<TNewResult>( Func<TaskWrap...
method Execute (line 422) | private void Execute( object state )
class TaskWrapper (line 212) | public class TaskWrapper
method Run (line 47) | public static TaskWrapper Run( Action action )
method WaitAll (line 56) | public static void WaitAll( params TaskWrapper[] tasks )
method BatchWaitAll (line 68) | public static void BatchWaitAll( params TaskWrapper[] tasks )
method TaskWrapper (line 108) | protected TaskWrapper( )
method TaskWrapper (line 112) | protected TaskWrapper( Action action )
method TaskWrapper (line 117) | protected TaskWrapper( _THREADING.Task t )
method Start (line 123) | public void Start()
method Wait (line 128) | public void Wait()
method Run (line 168) | public static TaskWrapper<TResult> Run( Func<TResult> function )
method MakeDefault (line 179) | private static Action MakeDefault<T>( Func<T> function )
method TaskWrapper (line 184) | public TaskWrapper( Func<TResult> function )
method TaskWrapper (line 192) | private TaskWrapper( _THREADING.Task<TResult> t )
method ContinueWith (line 197) | public TaskWrapper<TNewResult> ContinueWith<TNewResult>( Func<_THREADI...
method Run (line 228) | public static TaskWrapper Run( Action action )
method BatchWaitAll (line 237) | public static void BatchWaitAll( params TaskWrapper[] tasks )
method TaskWrapper (line 277) | protected TaskWrapper( )
method TaskWrapper (line 284) | protected TaskWrapper( Action action )
method Start (line 290) | public virtual void Start( )
method Wait (line 295) | public void Wait( )
method SetStatus (line 316) | protected void SetStatus( _THREADING.TaskStatus status )
method IsRunningOrDone (line 321) | protected bool IsRunningOrDone( )
method SetCompleted (line 329) | protected void SetCompleted( )
method WaitCompleted (line 334) | protected void WaitCompleted( )
method Execute (line 339) | private void Execute( object state )
method Run (line 367) | public static TaskWrapper<TResult> Run( Func<TResult> function )
method TaskWrapper (line 378) | private TaskWrapper( Func<TResult> func )
method Start (line 384) | public override void Start( )
method MakeTask (line 389) | private TaskWrapper<TOutput> MakeTask<TInput, TOutput>( Func<TaskWrapp...
method ContinueWith (line 397) | public TaskWrapper<TNewResult> ContinueWith<TNewResult>( Func<TaskWrap...
method Execute (line 422) | private void Execute( object state )
class TaskWrapper (line 358) | public class TaskWrapper<TResult> : TaskWrapper
method Run (line 47) | public static TaskWrapper Run( Action action )
method WaitAll (line 56) | public static void WaitAll( params TaskWrapper[] tasks )
method BatchWaitAll (line 68) | public static void BatchWaitAll( params TaskWrapper[] tasks )
method TaskWrapper (line 108) | protected TaskWrapper( )
method TaskWrapper (line 112) | protected TaskWrapper( Action action )
method TaskWrapper (line 117) | protected TaskWrapper( _THREADING.Task t )
method Start (line 123) | public void Start()
method Wait (line 128) | public void Wait()
method Run (line 168) | public static TaskWrapper<TResult> Run( Func<TResult> function )
method MakeDefault (line 179) | private static Action MakeDefault<T>( Func<T> function )
method TaskWrapper (line 184) | public TaskWrapper( Func<TResult> function )
method TaskWrapper (line 192) | private TaskWrapper( _THREADING.Task<TResult> t )
method ContinueWith (line 197) | public TaskWrapper<TNewResult> ContinueWith<TNewResult>( Func<_THREADI...
method Run (line 228) | public static TaskWrapper Run( Action action )
method BatchWaitAll (line 237) | public static void BatchWaitAll( params TaskWrapper[] tasks )
method TaskWrapper (line 277) | protected TaskWrapper( )
method TaskWrapper (line 284) | protected TaskWrapper( Action action )
method Start (line 290) | public virtual void Start( )
method Wait (line 295) | public void Wait( )
method SetStatus (line 316) | protected void SetStatus( _THREADING.TaskStatus status )
method IsRunningOrDone (line 321) | protected bool IsRunningOrDone( )
method SetCompleted (line 329) | protected void SetCompleted( )
method WaitCompleted (line 334) | protected void WaitCompleted( )
method Execute (line 339) | private void Execute( object state )
method Run (line 367) | public static TaskWrapper<TResult> Run( Func<TResult> function )
method TaskWrapper (line 378) | private TaskWrapper( Func<TResult> func )
method Start (line 384) | public override void Start( )
method MakeTask (line 389) | private TaskWrapper<TOutput> MakeTask<TInput, TOutput>( Func<TaskWrapp...
method ContinueWith (line 397) | public TaskWrapper<TNewResult> ContinueWith<TNewResult>( Func<TaskWrap...
method Execute (line 422) | private void Execute( object state )
FILE: Devices/Gateways/GatewayService/Common/Utils/Loader.cs
class IotHubConfig (line 33) | public class IotHubConfig
class DataTransformsConfig (line 39) | public class DataTransformsConfig
class Loader (line 45) | public static class Loader
method GetSources (line 47) | public static IList<String> GetSources( )
method GetEndpoints (line 64) | public static IList<SensorEndpoint> GetEndpoints( )
method GetIotHubConfig (line 86) | public static IotHubConfig GetIotHubConfig( )
method GetDataTransformsConfig (line 102) | public static DataTransformsConfig GetDataTransformsConfig( )
class IotHubConfigSection (line 128) | internal class IotHubConfigSection : ConfigurationSection
class DataTransformsConfigSection (line 144) | internal class DataTransformsConfigSection : ConfigurationSection
class DeviceAdapterConfigSection (line 173) | public class DeviceAdapterConfigSection : ConfigurationSection
class DeviceAdapterConfigInstanceCollection (line 183) | public class DeviceAdapterConfigInstanceCollection : ConfigurationElemen...
method CreateNewElement (line 185) | protected override ConfigurationElement CreateNewElement( )
method GetElementKey (line 190) | protected override object GetElementKey( ConfigurationElement element )
class DeviceAdapterConfigInstanceElement (line 196) | public class DeviceAdapterConfigInstanceElement : ConfigurationElement
class SensorEndpointConfigSection (line 226) | public class SensorEndpointConfigSection : ConfigurationSection
class SensorEndpointConfigInstanceCollection (line 236) | public class SensorEndpointConfigInstanceCollection : ConfigurationEleme...
method CreateNewElement (line 238) | protected override ConfigurationElement CreateNewElement( )
method GetElementKey (line 243) | protected override object GetElementKey( ConfigurationElement element )
class SensorEndpointConfigInstanceElement (line 249) | public class SensorEndpointConfigInstanceElement : ConfigurationElement
FILE: Devices/Gateways/GatewayService/DeviceAdapters/Bluetooth/BluetoothUARTAdapter.cs
class BluetoothUARTAdapter (line 36) | public class BluetoothUARTAdapter : DeviceAdapterAbstract
method BluetoothUARTAdapter (line 48) | public BluetoothUARTAdapter( ILogger logger )
method Start (line 54) | public override bool Start( Func<string, int> enqueue )
method Stop (line 67) | public override bool Stop( )
method SetEndpoint (line 74) | public override bool SetEndpoint( SensorEndpoint endpoint = null )
method Listen (line 83) | private void Listen( string port, int baudRate )
FILE: Devices/Gateways/GatewayService/DeviceAdapters/SerialPort/SerialPortAdapter.cs
class SerialPortAdapter (line 40) | public class SerialPortAdapter : DeviceAdapterAbstract
class SerialPortListeningThread (line 42) | private class SerialPortListeningThread
method SerialPortListeningThread (line 44) | public SerialPortListeningThread( string name, Thread thread )
method SerialPortAdapter (line 65) | public SerialPortAdapter( ILogger logger )
method Start (line 71) | public override bool Start( Func<string, int> enqueue )
method Stop (line 84) | public override bool Stop( )
method SetEndpoint (line 91) | public override bool SetEndpoint( SensorEndpoint endpoint = null )
method RunForSerial (line 100) | public int RunForSerial( int scanPeriod )
method ListeningForSensors (line 173) | public void ListeningForSensors( string port )
method GetPortNames (line 268) | private static string[] GetPortNames( )
FILE: Devices/Gateways/GatewayService/DeviceAdapters/Socket/SocketAdapter.cs
class SocketAdapter (line 41) | public class SocketAdapter : DeviceAdapterAbstract
method SocketAdapter (line 59) | public SocketAdapter( ILogger logger )
method Start (line 64) | public override bool Start( Func<string, int> enqueue )
method Stop (line 78) | public override bool Stop( )
method SetEndpoint (line 93) | public override bool SetEndpoint( SensorEndpoint endpoint = null )
method RunSocketServer (line 107) | private void RunSocketServer( )
method ProcessClient (line 137) | private void ProcessClient( TcpClient clientSocket )
method RunSocketAsClient (line 202) | private int RunSocketAsClient( int retries )
method SensorDataClient (line 244) | private void SensorDataClient( Socket client )
FILE: Devices/Gateways/GatewayService/Gateway/Adapter/DeviceAdapter.cs
class DeviceAdapterAbstract (line 34) | public abstract class DeviceAdapterAbstract : IDeviceAdapter
method DeviceAdapterAbstract (line 40) | protected DeviceAdapterAbstract( ILogger logger )
method Start (line 45) | public abstract bool Start( Func<string, int> enqueue );
method Stop (line 47) | public abstract bool Stop( );
method SetEndpoint (line 49) | public abstract bool SetEndpoint( SensorEndpoint endpoint = null );
FILE: Devices/Gateways/GatewayService/Gateway/Adapter/IDeviceAdapter.cs
type IDeviceAdapter (line 32) | public interface IDeviceAdapter
method Start (line 34) | bool Start( Func<string, int> enqueue );
method Stop (line 36) | bool Stop( );
method SetEndpoint (line 39) | bool SetEndpoint( SensorEndpoint endpoint = null );
FILE: Devices/Gateways/GatewayService/Gateway/Constants.cs
class Constants (line 27) | public static class Constants
class ResponseStatusCodes (line 31) | public static class ResponseStatusCodes
FILE: Devices/Gateways/GatewayService/Gateway/DeviceAdapter/DeviceAdapter.cs
class DeviceAdapterAbstract (line 34) | public abstract class DeviceAdapterAbstract : IDeviceAdapter
method DeviceAdapterAbstract (line 40) | protected DeviceAdapterAbstract( ILogger logger )
method Start (line 45) | public abstract bool Start( Func<string, int> enqueue );
method Stop (line 47) | public abstract bool Stop( );
method SetEndpoint (line 49) | public abstract bool SetEndpoint( SensorEndpoint endpoint = null );
FILE: Devices/Gateways/GatewayService/Gateway/DeviceAdapter/IDeviceAdapter.cs
type IDeviceAdapter (line 31) | public interface IDeviceAdapter
method Start (line 33) | bool Start( Func<string, int> enqueue );
method Stop (line 35) | bool Stop( );
method SetEndpoint (line 38) | bool SetEndpoint( SensorEndpoint endpoint = null );
FILE: Devices/Gateways/GatewayService/Gateway/DeviceAdapter/SensorEndpoint.cs
class SensorEndpoint (line 30) | public class SensorEndpoint
FILE: Devices/Gateways/GatewayService/Gateway/EventProcessor.cs
class EventProcessor (line 33) | public abstract class EventProcessor
method EventProcessor (line 39) | protected EventProcessor( ILogger logger )
method Start (line 46) | public abstract bool Start( );
method Stop (line 48) | public abstract bool Stop( int timeout );
method Process (line 50) | public abstract void Process( );
FILE: Devices/Gateways/GatewayService/Gateway/GatewayService.cs
class GatewayService (line 37) | public class GatewayService : IGatewayService
method GatewayService (line 49) | public GatewayService( IAsyncQueue<QueuedItem> queue, EventProcessor p...
method Enqueue (line 74) | public int Enqueue( string jsonData )
method DataInQueue (line 94) | protected virtual void DataInQueue( QueuedItem data )
method LogMessageReceived (line 116) | private void LogMessageReceived( )
FILE: Devices/Gateways/GatewayService/Gateway/IGatewayService.cs
type IGatewayService (line 32) | [ServiceContract( Namespace = "GatewayService" )]
method Enqueue (line 35) | [WebGet( )]
FILE: Devices/Gateways/GatewayService/Gateway/Models/QueuedItem.cs
class QueuedItem (line 34) | [DataContract]
class DataTransforms (line 41) | public static class DataTransforms
method QueuedItemFromSensorDataContract (line 43) | public static QueuedItem QueuedItemFromSensorDataContract( SensorDataC...
method SensorDataContractFromString (line 68) | public static SensorDataContract SensorDataContractFromString( string ...
method SensorDataContractFromQueuedItem (line 88) | public static SensorDataContract SensorDataContractFromQueuedItem( Que...
method AddTimeCreated (line 99) | public static SensorDataContract AddTimeCreated( SensorDataContract da...
method AddIPToLocation (line 116) | public static SensorDataContract AddIPToLocation( SensorDataContract d...
FILE: Devices/Gateways/GatewayService/Gateway/Models/SensorDataContract.cs
class SensorDataContract (line 32) | [DataContract]
FILE: Devices/Gateways/GatewayService/Gateway/ServiceInstantiation/IService.cs
type IService (line 27) | public interface IService
FILE: Devices/Gateways/GatewayService/Gateway/ServiceInstantiation/ServiceBehavior.cs
class ServiceBehavior (line 36) | public class ServiceBehavior : IServiceBehavior
method ServiceBehavior (line 42) | public ServiceBehavior( Func<IService> serviceCreator )
method AddBindingParameters (line 47) | public void AddBindingParameters( ServiceDescription serviceDescriptio...
method ApplyDispatchBehavior (line 51) | public void ApplyDispatchBehavior( ServiceDescription serviceDescripti...
method Validate (line 62) | public void Validate( ServiceDescription serviceDescription, ServiceHo...
FILE: Devices/Gateways/GatewayService/Gateway/ServiceInstantiation/ServiceInstanceProvider.cs
class ServiceInstanceProvider (line 34) | class ServiceInstanceProvider : IInstanceProvider
method ServiceInstanceProvider (line 40) | public ServiceInstanceProvider( Func<IService> serviceCreator )
method GetInstance (line 45) | public object GetInstance( InstanceContext instanceContext, Message me...
method GetInstance (line 50) | public object GetInstance( InstanceContext instanceContext )
method ReleaseInstance (line 55) | public void ReleaseInstance( InstanceContext instanceContext, object i...
FILE: Devices/Gateways/GatewayService/Gateway/Utils/Loader/DataIntakeLoader.cs
class DeviceAdapterLoader (line 40) | public class DeviceAdapterLoader
method DeviceAdapterLoader (line 55) | public DeviceAdapterLoader( IList<String> sources, IList<SensorEndpoin...
method StartAll (line 270) | public void StartAll( Func<string, int> enqueue, DataArrivalEventHandl...
method StopAll (line 302) | public void StopAll( )
FILE: Devices/Gateways/GatewayService/Gateway/Utils/MessageSender/IMessageSender.cs
type IMessageSender (line 31) | public interface IMessageSender<in T>
method SendMessage (line 33) | TaskWrapper SendMessage( T data );
method SendSerialized (line 34) | TaskWrapper SendSerialized( string jsonData );
method Close (line 36) | void Close( );
FILE: Devices/Gateways/GatewayService/Gateway/Utils/MessageSender/MessageSender.cs
class MessageSender (line 40) | public class MessageSender<T> : IMessageSender<T>
method MessageSender (line 58) | public MessageSender( string gatewayIotHubConnectionString, ILogger lo...
method SendMessage (line 69) | public TaskWrapper SendMessage( T data )
method SendSerialized (line 92) | public TaskWrapper SendSerialized( string jsonData )
method Close (line 113) | public void Close()
method PrepareAndSend (line 118) | private TaskWrapper PrepareAndSend( string jsonData )
method PrepareMessage (line 127) | protected Message PrepareMessage( string serializedData, string subjec...
FILE: Devices/Gateways/GatewayService/Gateway/Utils/OperationStatus/ErrorCode.cs
type ErrorCode (line 27) | public enum ErrorCode
FILE: Devices/Gateways/GatewayService/Gateway/Utils/OperationStatus/OperationStatus.cs
class OperationStatus (line 31) | [DebuggerDisplay( "OperationCode = {OperationCode}" )]
method OperationStatus (line 34) | internal OperationStatus( ) { }
method OperationStatus (line 49) | internal OperationStatus( ) { }
class OperationStatus (line 46) | [DebuggerDisplay( "OperationCode = {OperationCode}, Result = {Result}" )]
method OperationStatus (line 34) | internal OperationStatus( ) { }
method OperationStatus (line 49) | internal OperationStatus( ) { }
FILE: Devices/Gateways/GatewayService/Gateway/Utils/OperationStatus/OperationStatusFactory.cs
class OperationStatusFactory (line 31) | public static class OperationStatusFactory
method CreateSuccess (line 37) | public static OperationStatus CreateSuccess( )
method CreateSuccess (line 42) | public static OperationStatus<T> CreateSuccess<T>( T result )
method CreateError (line 47) | public static OperationStatus CreateError( ErrorCode errorCode )
method CreateError (line 52) | public static OperationStatus CreateError( ErrorCode errorCode, string...
method CreateError (line 57) | public static OperationStatus CreateError( ErrorCode errorCode, Except...
method CreateError (line 62) | public static OperationStatus<T> CreateError<T>( ErrorCode errorCode )
method CreateError (line 67) | public static OperationStatus<T> CreateError<T>( ErrorCode errorCode, ...
method CreateError (line 72) | public static OperationStatus<T> CreateError<T>( ErrorCode errorCode, ...
method CreateError (line 77) | public static OperationStatus<T> CreateError<T>( ErrorCode errorCode, ...
method CopyFrom (line 82) | public static OperationStatus CopyFrom( OperationStatus source )
method CopyFrom (line 87) | public static OperationStatus CopyFrom<T>( OperationStatus<T> source )
method CopyFrom (line 92) | public static OperationStatus<TOut> CopyFrom<TOut>( OperationStatus so...
method CopyFrom (line 97) | public static OperationStatus<TOut> CopyFrom<TIn, TOut>( OperationStat...
FILE: Devices/Gateways/GatewayService/Gateway/Utils/Queue/BatchSenderThread.cs
class BatchSenderThread (line 36) | public class BatchSenderThread<TQueueItem, TMessage> : EventProcessor
method BatchSenderThread (line 53) | public BatchSenderThread( IAsyncQueue<TQueueItem> dataSource, IMessage...
method Start (line 72) | public override bool Start( )
method Stop (line 95) | public override bool Stop( int timeout )
method Process (line 130) | public override void Process( )
method ThreadJob (line 137) | private void ThreadJob( )
method AddToProcessed (line 277) | private void AddToProcessed( List<TaskWrapper> tasks, TaskWrapper<Oper...
FILE: Devices/Gateways/GatewayService/Gateway/Utils/Queue/GatewayQueue.cs
class GatewayQueue (line 34) | public class GatewayQueue<T> : IAsyncQueue<T>
method Push (line 40) | async public void Push( T item )
method TryPop (line 45) | public TaskWrapper<OperationStatus<T>> TryPop( )
FILE: Devices/Gateways/GatewayService/Gateway/Utils/Queue/IAsyncQueue.cs
type IAsyncQueue (line 31) | public interface IAsyncQueue<T>
method Push (line 33) | void Push( T item );
method TryPop (line 35) | TaskWrapper<OperationStatus<T>> TryPop( );
FILE: Devices/Gateways/GatewayService/Scripts/RaspberryPi/setupWifi.py
function main (line 9) | def main(argv):
FILE: Devices/Gateways/GatewayService/Scripts/ScriptConverter/Program.cs
class Program (line 32) | class Program
method Main (line 39) | static void Main( string[] args )
method Dos2Unix (line 65) | private static void Dos2Unix( string inputFileName, string outputFileN...
FILE: Devices/Gateways/GatewayService/ServiceMonitor/IMonitor.cs
type IMonitor (line 30) | interface IMonitor
method Lock (line 32) | bool Lock( string monitoringTarget );
method Monitor (line 34) | void Monitor( );
method QuitMonitor (line 36) | void QuitMonitor( );
FILE: Devices/Gateways/GatewayService/ServiceMonitor/Monitor.cs
class AbstractMonitor (line 35) | internal abstract class AbstractMonitor : IMonitor
method AbstractMonitor (line 42) | protected AbstractMonitor( ILogger logger )
method Lock (line 51) | public abstract bool Lock( string monitoringTarget );
method Monitor (line 53) | public abstract void Monitor();
method QuitMonitor (line 55) | public abstract void QuitMonitor();
FILE: Devices/Gateways/GatewayService/ServiceMonitor/MonitorProgram.cs
class MonitorProgram (line 33) | class MonitorProgram
method Main (line 39) | static void Main( string[] args )
FILE: Devices/Gateways/GatewayService/ServiceMonitor/ProcessMonitor.cs
class ProcessMonitor (line 36) | internal class ProcessMonitor : AbstractMonitor
method ProcessMonitor (line 44) | public ProcessMonitor( string executableName, ILogger logger ) : base(...
method Lock (line 61) | public override bool Lock( string monitoringTarget )
method Monitor (line 96) | public override void Monitor()
method QuitMonitor (line 112) | public override void QuitMonitor()
method CreateProcess (line 117) | private Process CreateProcess( string monitoringExecutable )
method Restart (line 135) | private void Restart( object sender, EventArgs e )
FILE: Devices/Gateways/GatewayService/ServiceMonitor/ServiceMonitor.cs
class ServiceMonitor (line 36) | internal class ServiceMonitor : AbstractMonitor
method ServiceMonitor (line 44) | public ServiceMonitor( string serviceName, ILogger logger ) : base( lo...
method Lock (line 69) | public override bool Lock( string monitoringTarget )
method Monitor (line 85) | public override void Monitor()
method QuitMonitor (line 106) | public override void QuitMonitor()
method Restart (line 111) | private void Restart( )
FILE: Devices/Gateways/GatewayService/ServiceMonitor/Utils/Logger/Logger.cs
class MonitorLogger (line 34) | public class MonitorLogger : ILogger
method MonitorLogger (line 63) | private MonitorLogger( )
method Flush (line 70) | public void Flush( )
method LogError (line 75) | public void LogError( string logMessage )
method LogInfo (line 80) | public void LogInfo( string logMessage )
FILE: Devices/Gateways/GatewayService/Tests/BatchSenderThreadTest/BatchSenderThreadTest.cs
class BatchSenderThreadTest (line 34) | public class BatchSenderThreadTest
method BatchSenderThreadTest (line 41) | public BatchSenderThreadTest( ILogger logger )
method Run (line 53) | public void Run( )
method TestMessagesGoFromSourceToTarget (line 58) | private void TestMessagesGoFromSourceToTarget( )
method TestMessagesGoFromSourceToTargetWithTwoBatchSenderThreads (line 100) | private void TestMessagesGoFromSourceToTargetWithTwoBatchSenderThreads( )
FILE: Devices/Gateways/GatewayService/Tests/BatchSenderThreadTest/TestRunner.cs
class TestRunner (line 32) | class TestRunner
method Main (line 34) | static void Main( string[] args )
FILE: Devices/Gateways/GatewayService/Tests/BatchSenderThreadTest/Utils/MessageSender/MockSenderAsyncQueue.cs
class MockSenderAsyncQueue (line 35) | internal class MockSenderAsyncQueue<T> : IMessageSender<T>
method SendMessage (line 41) | public TaskWrapper SendMessage( T data )
method SendSerialized (line 48) | public TaskWrapper SendSerialized( string jsonData )
method ToMockSenderMap (line 53) | public MockSenderMap<T> ToMockSenderMap( )
method Close (line 72) | public void Close( )
FILE: Devices/Gateways/GatewayService/Tests/BatchSenderThreadTest/Utils/MessageSender/MockSenderMap.cs
class MockSenderMap (line 36) | internal class MockSenderMap<T> : IMessageSender<T>
method SendMessage (line 42) | public TaskWrapper SendMessage( T data )
method SendSerialized (line 59) | public TaskWrapper SendSerialized( string jsonData )
method Contains (line 64) | public bool Contains( T data )
method ContainsOthersItems (line 72) | public bool ContainsOthersItems( MockSenderMap<T> other )
method Close (line 84) | public void Close( )
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/CoreTest.cs
class CoreTest (line 41) | public class CoreTest : ITest
method CoreTest (line 65) | public CoreTest( ILogger logger )
method Run (line 122) | public void Run( )
method TestRepeatSend (line 128) | public void TestRepeatSend( )
method TestDeviceAdapter (line 204) | public void TestDeviceAdapter( )
method Completed (line 249) | public void Completed( )
method PrepareGatewayService (line 256) | private GatewayService PrepareGatewayService( )
method DataArrived (line 274) | protected void DataArrived( string data )
method DataInQueue (line 279) | protected virtual void DataInQueue( QueuedItem data )
method EventBatchProcessed (line 287) | protected virtual void EventBatchProcessed( List<TaskWrapper> messages )
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/Devices/SocketClientTestDevice.cs
class SocketClientTestDevice (line 40) | public class SocketClientTestDevice
method SocketClientTestDevice (line 65) | public SocketClientTestDevice( ILogger logger )
method Stop (line 75) | public void Stop( )
method Start (line 79) | public void Start( SensorEndpoint endpoint, int messagesToSend )
method RunSocketAsClient (line 90) | private int RunSocketAsClient( int retries )
method StartDataFlow (line 130) | private void StartDataFlow( Socket client )
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/Devices/SocketServiceTestDevice.cs
class SocketServiceTestDevice (line 39) | public class SocketServiceTestDevice
method SocketServiceTestDevice (line 49) | public SocketServiceTestDevice( ILogger logger )
method Start (line 60) | public void Start( SensorEndpoint endpoint )
method RunSocketServer (line 67) | public void RunSocketServer( SensorEndpoint endpoint )
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/ITest.cs
type ITest (line 27) | interface ITest
method Run (line 29) | void Run( );
method Completed (line 30) | void Completed( );
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/RealDataTest.cs
class RealDataTest (line 37) | public class RealDataTest : ITest
method RealDataTest (line 49) | public RealDataTest(ILogger logger)
method Run (line 69) | public void Run( )
method TestRealTimeData (line 74) | public void TestRealTimeData( )
method Completed (line 138) | public void Completed( )
method PrepareGatewayService (line 145) | private GatewayService PrepareGatewayService( )
method DataArrived (line 159) | protected void DataArrived( string data )
method DataInQueue (line 171) | protected virtual void DataInQueue( QueuedItem data )
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/SocketTest.cs
class SocketTest (line 37) | public class SocketTest : ITest
method SocketTest (line 58) | public SocketTest( ILogger logger )
method Run (line 83) | public void Run( )
method TestReceiveMessagesFromSocketDevice (line 88) | public void TestReceiveMessagesFromSocketDevice( )
method Completed (line 152) | public void Completed( )
method PrepareGatewayService (line 159) | private GatewayService PrepareGatewayService( )
method DataArrived (line 175) | protected void DataArrived( string data )
method DataInQueue (line 180) | protected virtual void DataInQueue( QueuedItem data )
method EventBatchProcessed (line 188) | protected virtual void EventBatchProcessed( List<TaskWrapper> messages )
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/TestRunner.cs
class TestRunner (line 35) | public class TestRunner
method TestMockData (line 38) | private static void TestMockData( ILogger logger )
method TestWebService (line 48) | private static void TestWebService( ILogger logger )
method TestSocket (line 61) | private static void TestSocket( ILogger logger )
method TestRealData (line 71) | private static void TestRealData( ILogger logger )
method Main (line 81) | static void Main( string[] args )
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/Utils/Generators/RandomSensorDataGenerator.cs
class RandomSensorDataGenerator (line 32) | public static class RandomSensorDataGenerator
method RandomSensorDataGenerator (line 46) | static RandomSensorDataGenerator( )
method Generate (line 59) | public static SensorDataContract Generate( )
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/Utils/Loader/Loader.cs
class DataTransformsConfig (line 34) | internal class DataTransformsConfig
class Loader (line 40) | internal static class Loader
method GetSources (line 42) | internal static IList<String> GetSources( )
method GetEndpoints (line 59) | internal static IList<SensorEndpoint> GetEndpoints( )
method GetIotHubConfig (line 82) | internal static IotHubConfig GetIotHubConfig( )
class IotHubConfigSection (line 98) | internal class IotHubConfigSection : ConfigurationSection
method GetDataTransformsConfig (line 114) | internal static DataTransformsConfig GetDataTransformsConfig( )
class DataTransformsConfigSection (line 140) | internal class DataTransformsConfigSection : ConfigurationSection
class DeviceAdapterConfigSection (line 169) | public class DeviceAdapterConfigSection : ConfigurationSection
class DeviceAdapterConfigInstanceCollection (line 179) | public class DeviceAdapterConfigInstanceCollection : ConfigurationElemen...
method CreateNewElement (line 181) | protected override ConfigurationElement CreateNewElement( )
method GetElementKey (line 186) | protected override object GetElementKey( ConfigurationElement element )
class DeviceAdapterConfigInstanceElement (line 192) | public class DeviceAdapterConfigInstanceElement : ConfigurationElement
class SensorEndpointConfigSection (line 222) | public class SensorEndpointConfigSection : ConfigurationSection
class SensorEndpointConfigInstanceCollection (line 232) | public class SensorEndpointConfigInstanceCollection : ConfigurationEleme...
method CreateNewElement (line 234) | protected override ConfigurationElement CreateNewElement( )
method GetElementKey (line 239) | protected override object GetElementKey( ConfigurationElement element )
class SensorEndpointConfigInstanceElement (line 245) | public class SensorEndpointConfigInstanceElement : ConfigurationElement
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/Utils/Logger/TestLogger.cs
class TestLogger (line 32) | public class TestLogger : ILogger
method TestLogger (line 58) | private TestLogger( )
method Flush (line 64) | public void Flush( )
method LogError (line 68) | public void LogError( string logMessage )
method LogInfo (line 73) | public void LogInfo( string logMessage )
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/Utils/MessageSender/MockSender.cs
class MockSender (line 34) | internal class MockSender<T> : IMessageSender<T>
method MockSender (line 46) | internal MockSender( ITest test )
method SendMessage (line 53) | public TaskWrapper SendMessage( T data )
method SendSerialized (line 59) | public TaskWrapper SendSerialized( string jsonData )
method Close (line 65) | public void Close( )
method SimulateSend (line 69) | private void SimulateSend( )
FILE: Devices/Gateways/GatewayService/Tests/CoreTest/WebServiceTest.cs
class WebServiceTest (line 35) | public class WebServiceTest : ITest
method WebServiceTest (line 56) | public WebServiceTest( string url, ILogger logger )
method Run (line 71) | public void Run( )
method Completed (line 112) | public void Completed( )
method SignalError (line 133) | protected void SignalError( HttpStatusCode code )
FILE: Devices/Gateways/GatewayService/Tests/DeviceAdapterTestMock/DeviceAdapterTestMock.cs
class DeviceAdapterTestMock (line 36) | public class DeviceAdapterTestMock : DeviceAdapterAbstract
method DeviceAdapterTestMock (line 48) | public DeviceAdapterTestMock( ILogger logger )
method Start (line 53) | public override bool Start( Func<string, int> enqueue )
method Stop (line 66) | public override bool Stop( )
method SetEndpoint (line 73) | public override bool SetEndpoint( SensorEndpoint endpoint = null )
method TestRun (line 82) | public void TestRun( int sleepTime )
FILE: Devices/Gateways/GatewayService/Tests/SocketServiceDeviceMock/SocketServiceDeviceMock.cs
class SocketServiceDeviceMock (line 31) | class SocketServiceDeviceMock
method Main (line 33) | static void Main( string[] args )
FILE: Devices/Gateways/GatewayService/Tests/SocketServiceDeviceMock/Utils/Logger/ConsoleLogger.cs
class ConsoleLogger (line 32) | public class ConsoleLogger : ILogger
method Flush (line 34) | public void Flush( )
method LogError (line 38) | public void LogError( string logMessage )
method LogInfo (line 43) | public void LogInfo( string logMessage )
FILE: Devices/Gateways/GatewayService/WindowsEXE/Program.cs
class Program (line 36) | class Program
method InitGateway (line 56) | private static void InitGateway( ILogger logger )
method Start (line 125) | private static void Start( )
method Stop (line 155) | private void Stop( )
method OnData (line 180) | private static void OnData( QueuedItem data )
method OnUnobservedTaskException (line 186) | private static void OnUnobservedTaskException( object sender, System.T...
method Main (line 194) | static void Main( string[] args )
FILE: Devices/Gateways/GatewayService/WindowsService/ProjectInstaller.cs
class ProjectInstaller (line 34) | [RunInstaller( true )]
method ProjectInstaller (line 42) | public ProjectInstaller( )
FILE: Devices/Gateways/GatewayService/WindowsService/Utils/Logger/EventLogger.cs
class WindowsEventLogger (line 34) | public class WindowsEventLogger : ILogger
method WindowsEventLogger (line 66) | private WindowsEventLogger( )
method Flush (line 84) | public void Flush( )
method LogError (line 88) | public void LogError( string logMessage )
method LogInfo (line 93) | public void LogInfo( string logMessage )
class EventLogger (line 99) | public static class EventLogger
FILE: Devices/Gateways/GatewayService/WindowsService/WindowsService.cs
class WindowsService (line 40) | public class WindowsService : ServiceBase
method WindowsService (line 65) | public WindowsService( ILogger logger )
method OnStart (line 135) | protected override void OnStart( string[] args )
method OnStop (line 165) | protected override void OnStop( )
method OnData (line 190) | protected virtual void OnData( QueuedItem data )
method Main (line 198) | static void Main( string[] args )
method OnUnobservedTaskException (line 221) | private void OnUnobservedTaskException( object sender, _THREADING.Unob...
Condensed preview — 407 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4,006K chars).
[
{
"path": ".deployment",
"chars": 37,
"preview": "[config]\nproject = Azure/WebSite/site"
},
{
"path": ".gitattributes",
"chars": 3394,
"preview": "###############################################################################\n# Set default behavior to automatically "
},
{
"path": ".gitignore",
"chars": 1849,
"preview": "# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)\n[Bb]in/\n[Oo]bj/\n\n# mstest test results\nTestResu"
},
{
"path": ".gitmodules",
"chars": 232,
"preview": "[submodule \"Devices/DirectlyConnectedDevices/WindowsIoTCorePi2WeatherShield\"]\n\tpath = Devices/DirectlyConnectedDevices/W"
},
{
"path": "Azure/ARMTemplate/CustomizeTemplate.md",
"chars": 7494,
"preview": "You can adapt the deployment of services in order to extend, optimize and customize your own ConnectTheDots solution.\nTh"
},
{
"path": "Azure/ARMTemplate/Readme.md",
"chars": 9581,
"preview": "## How to deploy Azure services for ConnectTheDots.io\nTo deploy the ConnectTheDots solution to your Azure subscription y"
},
{
"path": "Azure/ARMTemplate/azuredeploy.json",
"chars": 16236,
"preview": "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n \"contentVersion\": "
},
{
"path": "Azure/EHConsole/EHConsole/App.config",
"chars": 4123,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <startup>\n <supportedRuntime version=\"v4.0\" sku=\".NETFramew"
},
{
"path": "Azure/EHConsole/EHConsole/Microsoft.ConnectTheDots.EHConsole.csproj",
"chars": 9712,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Azure/EHConsole/EHConsole/Program.cs",
"chars": 10077,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/EHConsole/EHConsole/Properties/AssemblyInfo.cs",
"chars": 1391,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Azure/EHConsole/EHConsole/packages.config",
"chars": 2342,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"Hyak.Common\" version=\"1.0.2\" targetFramework=\"net45\" /"
},
{
"path": "Azure/EHConsole/EHConsole.sln",
"chars": 1575,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2013\nVisualStudioVersion = 12.0.30723.0\nMi"
},
{
"path": "Azure/EHConsole/nuget.config",
"chars": 277,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <config>\n <add key=\"repositorypath\" value=\"..\\AzurePrep\\pac"
},
{
"path": "Azure/MachineLearning/MachineLearningCloudService.md",
"chars": 4986,
"preview": "Once you have setup devices and Azure Event Hubs to receive data from your devices, you can do some analytics on the dat"
},
{
"path": "Azure/MachineLearning/SQL/SQL.sqlproj",
"chars": 3491,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/ms"
},
{
"path": "Azure/MachineLearning/SQL/StoredProcedures/InsertAlertsData.sql",
"chars": 373,
"preview": "CREATE PROCEDURE [dbo].[InsertAlertsData]\n\t@dataList [dbo].[AlertsDataTableType] READONLY\nAS\n\tinsert into [dbo].[Alerts"
},
{
"path": "Azure/MachineLearning/SQL/TableType/AlertsDataTableType.sql",
"chars": 302,
"preview": "CREATE TYPE [dbo].[AlertsDataTableType] AS TABLE( \n\t[value] FLOAT NULL, \n\t[guid] VARCHAR(40) NULL, \n\t[organization] VAR"
},
{
"path": "Azure/MachineLearning/SQL/Tables/AlertsData.sql",
"chars": 326,
"preview": "CREATE TABLE [dbo].[AlertsData]\n(\n\t[Id] INT NOT NULL PRIMARY KEY IDENTITY,\n\t[value] FLOAT NULL, \n\t[guid] VARCHAR(40) NU"
},
{
"path": "Azure/MachineLearning/WorkerHost/Analyzer.cs",
"chars": 6686,
"preview": "//#define DEBUG_LOG\n\nusing System;\nusing System.Collections.Generic;\nusing System.Data.Services.Client;\nusing System.Dia"
},
{
"path": "Azure/MachineLearning/WorkerHost/AnomalyRecord.cs",
"chars": 1341,
"preview": "using System;\n\nnamespace WorkerHost\n{\n public class AnomalyRecord\n {\n public DateTime Time { get; set; }\n "
},
{
"path": "Azure/MachineLearning/WorkerHost/App.config",
"chars": 6464,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <startup> \n <supportedRuntime version=\"v4.0\" sku=\".NE"
},
{
"path": "Azure/MachineLearning/WorkerHost/CircularBuffer.cs",
"chars": 674,
"preview": "using System.Collections.Generic;\n\nnamespace WorkerHost\n{\n public class CircularBuffer<T>\n {\n private read"
},
{
"path": "Azure/MachineLearning/WorkerHost/Data.Outputs/BlobWriter.cs",
"chars": 2009,
"preview": "using System;\nusing System.IO;\nusing System.Text;\nusing Microsoft.WindowsAzure.Storage;\nusing Microsoft.WindowsAzure.St"
},
{
"path": "Azure/MachineLearning/WorkerHost/Data.Outputs/SQLOutputRepository.cs",
"chars": 3577,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.Data.SqlClient;\n\nnamespace WorkerHost.D"
},
{
"path": "Azure/MachineLearning/WorkerHost/Data.Outputs/Utils/SqlDBReaderSafeParser.cs",
"chars": 1210,
"preview": "using System;\nusing System.Data.SqlClient;\nusing System.Reflection;\n\nnamespace WorkerHost.Data.Outputs.Utils\n{\n publ"
},
{
"path": "Azure/MachineLearning/WorkerHost/EventHubReader.cs",
"chars": 8308,
"preview": "//#define DEBUG_LOG\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing"
},
{
"path": "Azure/MachineLearning/WorkerHost/Program.cs",
"chars": 10099,
"preview": "//#define DEBUG_LOG\nusing System;\nusing System.Collections.Generic;\nusing System.Configuration;\nusing System.Diagnostic"
},
{
"path": "Azure/MachineLearning/WorkerHost/Properties/AssemblyInfo.cs",
"chars": 1393,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Azure/MachineLearning/WorkerHost/SensorDataContract.cs",
"chars": 1033,
"preview": "using System;\nusing System.Runtime.Serialization;\n\nnamespace WorkerHost\n{\n public class SensorDataContract\n {\n "
},
{
"path": "Azure/MachineLearning/WorkerHost/WorkerHost.csproj",
"chars": 11070,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Azure/MachineLearning/WorkerHost/packages.config",
"chars": 2830,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"Hyak.Common\" version=\"1.0.2\" targetFramework=\"net45\" /"
},
{
"path": "Azure/MachineLearning/WorkerHost.sln",
"chars": 2336,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.23107.0\nMini"
},
{
"path": "Azure/MachineLearning/WorkerRole/ServiceConfiguration.Cloud.cscfg",
"chars": 1655,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ServiceConfiguration serviceName=\"WorkerRole\" xmlns=\"http://schemas.microsoft.c"
},
{
"path": "Azure/MachineLearning/WorkerRole/ServiceConfiguration.Local.cscfg",
"chars": 1655,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ServiceConfiguration serviceName=\"WorkerRole\" xmlns=\"http://schemas.microsoft.c"
},
{
"path": "Azure/MachineLearning/WorkerRole/ServiceDefinition.csdef",
"chars": 387,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ServiceDefinition name=\"WorkerRole\" xmlns=\"http://schemas.microsoft.com/Service"
},
{
"path": "Azure/MachineLearning/WorkerRole/WorkerHostContent/diagnostics.wadcfgx",
"chars": 2340,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<DiagnosticsConfiguration xmlns=\"http://schemas.microsoft.com/ServiceHosting/201"
},
{
"path": "Azure/MachineLearning/WorkerRole/WorkerRole.ccproj",
"chars": 3025,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Azure/PowerBI/PBI_setup.md",
"chars": 4673,
"preview": "The instructions below will help you setup a Power BI dashboard in the Connect The Dots starter solution, but they can b"
},
{
"path": "Azure/StreamAnalyticsQueries/Aggregates.sql",
"chars": 1865,
"preview": "/* ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open T"
},
{
"path": "Azure/StreamAnalyticsQueries/Alert.sql",
"chars": 1892,
"preview": "/* ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/StreamAnalyticsQueries/HumidityAlert.sql",
"chars": 2892,
"preview": "/* ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/StreamAnalyticsQueries/LightSensor.sql",
"chars": 1876,
"preview": "/* ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open T"
},
{
"path": "Azure/StreamAnalyticsQueries/SA_setup.md",
"chars": 4868,
"preview": "# Stream Analytics Setup #\nThe instructions below will help you setup the Stream Analytics queries in the Connect The Do"
},
{
"path": "Azure/StreamAnalyticsQueries/cg4pbi.sql",
"chars": 1470,
"preview": "/* ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/WebsiteDetails.md",
"chars": 1385,
"preview": "# Website details #\n\nOnce you have your website running, you'll notice more is being displayed on the charts than just t"
},
{
"path": "Azure/WebSite/WebsitePublish.md",
"chars": 3256,
"preview": "# Website parameters and re-publish #\nThis document explains how to build and deploy a sample website that is used to sh"
},
{
"path": "Azure/WebSite/site/Default.aspx",
"chars": 7191,
"preview": "<!--\n// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft "
},
{
"path": "Azure/WebSite/site/Docs/license.txt",
"chars": 1121,
"preview": "Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.\n \nThe MIT License (MIT)\n \nPermission is hereby gra"
},
{
"path": "Azure/WebSite/site/Global.asax",
"chars": 102,
"preview": "<%@ Application Codebehind=\"Global.asax.cs\" Inherits=\"ConnectTheDotsWebSite.Global\" Language=\"C#\" %>\n"
},
{
"path": "Azure/WebSite/site/Web.config",
"chars": 8302,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nWeb.config file for WebClient based upon Web.config\n\nThe settings that can "
},
{
"path": "Azure/WebSite/site/css/connectthedots.css",
"chars": 3914,
"preview": "body {\n font: 16px sans-serif;\n color: #333;\n width: 95%;\n}\n\n#header {\n width: 100%;\n border-bottom: 1px "
},
{
"path": "Azure/WebSite/site/js/d3CTD.js",
"chars": 13584,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/site/js/d3CTDDataSourceFilter.js",
"chars": 2161,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/site/js/d3CTDDataSourceSocket.js",
"chars": 3371,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/site/js/d3Chart.js",
"chars": 21038,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/site/js/d3ChartControl.js",
"chars": 5120,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/site/js/d3DataFlow.js",
"chars": 5433,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/site/js/d3DataSourceSocket.js",
"chars": 2384,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/site/js/d3utils.js",
"chars": 3758,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/site/js/devicesList.js",
"chars": 6178,
"preview": "function updateDevicesList() {\n // Get the devices list from the server\n PageMethods.GetDevicesList(ListSuccess, "
},
{
"path": "Azure/WebSite/site/js/jquery.ui-contextmenu.js",
"chars": 15535,
"preview": "/*******************************************************************************\n * jquery.ui-contextmenu.js plugin.\n *\n"
},
{
"path": "Azure/WebSite/site/js/qrcode.js",
"chars": 33148,
"preview": "/**\n * @fileoverview\n * - Using the 'QRCode for Javascript library'\n * - Fixed dataset of 'QRCode for Javascript library"
},
{
"path": "Azure/WebSite/site/packages.config",
"chars": 2083,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"Microsoft.AspNet.WebApi.Client\" version=\"5.2.3\" target"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/ConnectTheDotsWebSite.csproj",
"chars": 13734,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Default.aspx",
"chars": 7191,
"preview": "<!--\n// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Default.aspx.cs",
"chars": 6150,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Default.aspx.designer.cs",
"chars": 1732,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// This code w"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Docs/license.txt",
"chars": 1121,
"preview": "Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.\n \nThe MIT License (MIT)\n \nPermission is hereby gra"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Global.asax",
"chars": 102,
"preview": "<%@ Application Codebehind=\"Global.asax.cs\" Inherits=\"ConnectTheDotsWebSite.Global\" Language=\"C#\" %>\n"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Global.asax.cs",
"chars": 15752,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Helpers/BlobHelper.cs",
"chars": 657,
"preview": "using Microsoft.WindowsAzure.Storage;\nusing Microsoft.WindowsAzure.Storage.Blob;\n\nnamespace ConnectTheDotsWebSite.Helpe"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Helpers/IoTHubHelper.cs",
"chars": 5194,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing Microsoft.Azure.Devices;\nusi"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Properties/AssemblyInfo.cs",
"chars": 1375,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Properties/PublishProfiles/LocalDeploy.pubxml",
"chars": 858,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nThis file is used by the publish/package process of your Web project. You c"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/SensorInventory.cs",
"chars": 1805,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Web.Debug.config",
"chars": 1270,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!-- For more information on using web.config transformation visit http://go.mic"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Web.PublishTemplate.config",
"chars": 8026,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nWeb.config file for WebClient based upon Web.PublishTemplate.config\n\nThe se"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Web.Release.config",
"chars": 1330,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!-- For more information on using web.config transformation visit http://go.mic"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/Web.config",
"chars": 8257,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nWeb.config file for WebClient based upon Web.config\n\nThe settings that can "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/WebSocketEventProcessor.cs",
"chars": 15861,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/WebSocketHandler.cs",
"chars": 6824,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/css/connectthedots.css",
"chars": 3914,
"preview": "body {\n font: 16px sans-serif;\n color: #333;\n width: 95%;\n}\n\n#header {\n width: 100%;\n border-bottom: 1px "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/js/d3CTD.js",
"chars": 13584,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/js/d3CTDDataSourceFilter.js",
"chars": 2161,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/js/d3CTDDataSourceSocket.js",
"chars": 3371,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/js/d3Chart.js",
"chars": 21038,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/js/d3ChartControl.js",
"chars": 5120,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/js/d3DataFlow.js",
"chars": 5433,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/js/d3DataSourceSocket.js",
"chars": 2384,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/js/d3utils.js",
"chars": 3758,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/js/devicesList.js",
"chars": 6178,
"preview": "function updateDevicesList() {\n // Get the devices list from the server\n PageMethods.GetDevicesList(ListSuccess, "
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/js/jquery.ui-contextmenu.js",
"chars": 15535,
"preview": "/*******************************************************************************\n * jquery.ui-contextmenu.js plugin.\n *\n"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/js/qrcode.js",
"chars": 33148,
"preview": "/**\n * @fileoverview\n * - Using the 'QRCode for Javascript library'\n * - Fixed dataset of 'QRCode for Javascript library"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite/packages.config",
"chars": 2083,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"Microsoft.AspNet.WebApi.Client\" version=\"5.2.3\" target"
},
{
"path": "Azure/WebSite/source/ConnectTheDotsWebSite.sln",
"chars": 1006,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.25420.1\nMini"
},
{
"path": "Contribute.md",
"chars": 1503,
"preview": "## How to contribute\nThere are many ways that you can contribute to the ConnectTheDots project:\n\n* Submit a bug\n* Submit"
},
{
"path": "Devices/DirectlyConnectedDevices/Common/csharp/ConnectTheDotsHelper.cs",
"chars": 12506,
"preview": "using Microsoft.Azure.Devices.Client;\nusing Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing Syst"
},
{
"path": "Devices/DirectlyConnectedDevices/Common/javascript/connectthedots.js",
"chars": 6269,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open T"
},
{
"path": "Devices/DirectlyConnectedDevices/Common/javascript/package.json",
"chars": 480,
"preview": "{\n \"name\": \"connectthedots\",\n \"version\": \"1.0.3\",\n \"description\": \"Simple library to connect a node app to Azure IoT "
},
{
"path": "Devices/DirectlyConnectedDevices/Common/javascript/readme.md",
"chars": 511,
"preview": "[ConnectTheDots.io](http://connectthedots.io) is an open source project created by Microsoft to help you get tiny device"
},
{
"path": "Devices/DirectlyConnectedDevices/ESP8266/ESP8266_setup.md",
"chars": 6082,
"preview": "This document explains how to connect a ESP8266 Adafruit Huzzah device to ConnectTheDots\n\n##Prerequisites ##\n\n### Requir"
},
{
"path": "Devices/DirectlyConnectedDevices/ESP8266/connect_the_dots/connect_the_dots.cpp",
"chars": 6577,
"preview": "// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root"
},
{
"path": "Devices/DirectlyConnectedDevices/ESP8266/connect_the_dots/connect_the_dots.h",
"chars": 350,
"preview": "// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root"
},
{
"path": "Devices/DirectlyConnectedDevices/ESP8266/connect_the_dots/connect_the_dots.ino",
"chars": 4662,
"preview": "// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/BeagleBoneBlack/BeagleBone_Black_setup.md",
"chars": 3554,
"preview": "This document explains how to set up a BeagleBone Black board to send data to Azure IoT services Hub using the REST inte"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/BeagleBoneBlack/Hardware.md",
"chars": 506,
"preview": "# Hardware requirements for BeagleBone Black & Grove sensors #\n\n - [BeagleBone Black][1]\n\n##Supported Sensors\n\n- [Seeed "
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/BeagleBoneBlack/beagleboneblackctd.js",
"chars": 3443,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open T"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/BeagleBoneBlack/package.json",
"chars": 442,
"preview": "{\n \"name\": \"ConnectTheDotsBeagleBoneBlack\",\n \"version\": \"1.0.1\",\n \"description\": \"Simple Node app sending data from B"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/BeagleBoneBlack/settings.json",
"chars": 186,
"preview": "{\n \"iothubconnectionstring\": \"<connectionstring>\",\n \"deviceid\": \"<deviceid>\",\n \"displayname\": \"BeagleBoneBlack"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/Desktop/Desktop_setup.md",
"chars": 1406,
"preview": "This document explains how to run a simple node sample on a desktop machine (Windows, Linux, OSX)\n\n##Prerequisites ##\n\nT"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/Desktop/desktop.js",
"chars": 2724,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open T"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/Desktop/package.json",
"chars": 394,
"preview": "{\n \"name\": \"ConnectTheDotsDesktop\",\n \"version\": \"1.0.2\",\n \"description\": \"Simple Node app sending fake data from desk"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/Desktop/settings.json",
"chars": 177,
"preview": "{\n \"iothubconnectionstring\": \"<connection-string>\",\n \"deviceid\": \"<deviceid>\",\n \"displayname\": \"My PC\",\n \"o"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonGrove/Hardware.md",
"chars": 561,
"preview": "# Hardware requirements for Intel Edison + Seeed Xadow wearable kit #\n\n - [Intel Edison kit for Arduino][1]\n\n##Supported"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonGrove/Intel_Edison_setup.md",
"chars": 4132,
"preview": "This document explains how to set up an Intel Edison board to send data to AzureIoT services using the REST interface. \n"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonGrove/inteledisonctd.js",
"chars": 6014,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open T"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonGrove/package.json",
"chars": 430,
"preview": "{\n \"name\": \"ConnectTheDotsIntelEdison\",\n \"version\": \"1.0.1\",\n \"description\": \"Simple Node app sending data from senso"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonGrove/settings.json",
"chars": 182,
"preview": "{\n \"iothubconnectionstring\": \"<connectionstring>\",\n \"deviceid\": \"<deviceid>\",\n \"displayname\": \"IntelEdison\",\n "
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonSensorTag/Hardware.md",
"chars": 333,
"preview": "# Hardware requirements for Intel Edison + TI SensorTag project #\n\n - [Intel Edison with the board for Arduino][1]\n\n##Su"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonSensorTag/Intel_Edison_setup.md",
"chars": 5050,
"preview": "This document explains how to set up an Intel Edison board to send data to Azure Event Hub using the REST interface. \nIt"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonSensorTag/inteledisonsensortagctd.js",
"chars": 5654,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open T"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonSensorTag/lib/cc2540.js",
"chars": 12144,
"preview": "\n// Copyright(c) 2013 Sandeep Mistry\n// from project https://github.com/sandeepmistry/node-sensortag\n//\n// The MIT Licen"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonSensorTag/lib/cc2650.js",
"chars": 11502,
"preview": "// Copyright(c) 2013 Sandeep Mistry\n// from project https://github.com/sandeepmistry/node-sensortag\n//\n// The MIT Licens"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonSensorTag/lib/common.js",
"chars": 9037,
"preview": "\n// Copyright(c) 2013 Sandeep Mistry\n// from project https://github.com/sandeepmistry/node-sensortag\n//\n// The MIT Licen"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonSensorTag/lib/sensortag.js",
"chars": 2184,
"preview": "// Copyright(c) 2013 Sandeep Mistry\n// from project https://github.com/sandeepmistry/node-sensortag\n//\n// The MIT Licens"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonSensorTag/package.json",
"chars": 510,
"preview": "{\n \"name\": \"ConnectTheDotsIntelEdison\",\n \"version\": \"1.0.0\",\n \"description\": \"Simple Node app sending data from Ardui"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonSensorTag/settings.json",
"chars": 186,
"preview": "{\n \"iothubconnectionstring\": \"<connectionstring>\",\n \"deviceid\": \"<deviceid>\",\n \"displayname\": \"EdisonSensorTag"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonXadow/Hardware.md",
"chars": 361,
"preview": "# Hardware requirements for Intel Edison + Seeed Xadow wearable kit #\n\n - [Intel Edison kit for Arduino][1]\n\n##Supported"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonXadow/Intel_Edison_setup.md",
"chars": 3459,
"preview": "This document explains how to set up an Intel Edison board to send data to AzureIoT services using the REST interface. \n"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonXadow/inteledisonctd.js",
"chars": 4807,
"preview": "// ---------------------------------------------------------------------------------\n// Copyright (c) Microsoft Open T"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonXadow/package.json",
"chars": 406,
"preview": "{\n \"name\": \"ConnectTheDotsIntelEdison\",\n \"version\": \"1.0.1\",\n \"description\": \"Simple Node app sending data from senso"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/IntelEdisonXadow/settings.json",
"chars": 182,
"preview": "{\n \"iothubconnectionstring\": \"<connectionstring>\",\n \"deviceid\": \"<deviceid>\",\n \"displayname\": \"IntelEdison\",\n "
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/SensorTag/Setup.md",
"chars": 316,
"preview": "### Generic SensorTag connection using a Raspberry PI, Linux, Mac OS and other Unix/Linux.\n\n### Raspberry Pi requirement"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/SensorTag/index.js",
"chars": 641,
"preview": "'use strict'\n\n// Common logic\nvar connectthedots = require('connectthedots');\n// Settings\nvar devicesettings = require('"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/SensorTag/package.json",
"chars": 442,
"preview": "{\n \"name\": \"SensorTag\",\n \"version\": \"1.0.0\",\n \"description\": \"SensorTag connection to Connect The Dots\",\n \"main\": \"i"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/SensorTag/sensorWorker.js",
"chars": 2855,
"preview": "var SensorTag = require('sensortag');\nvar async = require('async');\n\nvar lastSensorTag;\nvar keepWorking = false;\nvar dat"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/SensorTag/settings.json",
"chars": 178,
"preview": "{\n \"iothubconnectionstring\": \"<connectionstring>\",\n \"deviceid\": \"<deviceid>\",\n \"displayname\": \"SensorTag\",\n "
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/Tessel2/Hardware.md",
"chars": 202,
"preview": "# Hardware requirements for Tessel 2 and modules #\n\n - [Tessel 2][1]\n\n## Supported Sensors ##\n\n- [Tessel 2 Ambient Modul"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/Tessel2/Tessel2_setup.md",
"chars": 2458,
"preview": "This document explains how to set up a Tessel 2 board to send data to Azure IoT services Hub using the AMQP interface.\n\n"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/Tessel2/package.json",
"chars": 418,
"preview": "{\n \"name\": \"ConnectTheDotsTessel2\",\n \"version\": \"1.0.0\",\n \"description\": \"Simple Node app sending data from a Tessel "
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/Tessel2/settings.json",
"chars": 183,
"preview": "{\n \"iothubconnectionstring\": \"<connection-string>\",\n \"deviceid\": \"<deviceid>\",\n \"displayname\": \"My Tessel 2\",\n"
},
{
"path": "Devices/DirectlyConnectedDevices/NodeJS/Tessel2/tessel2ctd.js",
"chars": 3033,
"preview": "// ---------------------------------------------------------------------------------\r\n// Copyright (c) Microsoft Open "
},
{
"path": "Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/App.xaml",
"chars": 249,
"preview": "<Application\n x:Class=\"UWPMSBand.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmln"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/App.xaml.cs",
"chars": 3663,
"preview": "using System;\nusing Windows.ApplicationModel;\nusing Windows.ApplicationModel.Activation;\nusing Windows.UI.Xaml;\nusing W"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/MainPage.xaml",
"chars": 3554,
"preview": "<Page\n x:Class=\"UWPMSBand.MainPage\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/MainPage.xaml.cs",
"chars": 13195,
"preview": "using System;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing Windows.UI.Popups;\nusing Windows.Devices.Ge"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/Package.appxmanifest",
"chars": 1606,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Package xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\""
},
{
"path": "Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/Properties/AssemblyInfo.cs",
"chars": 1035,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/Properties/Default.rd.xml",
"chars": 1241,
"preview": "<!--\n This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most\n develope"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/UWPMSBand.csproj",
"chars": 6589,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/project.json",
"chars": 446,
"preview": "{\n \"dependencies\": {\n \"Microsoft.Azure.Devices.Client\": \"1.1.1\",\n \"Microsoft.Azure.Devices.Shared\": \"1.0.2\",\n "
},
{
"path": "Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand/project.lock.json",
"chars": 877760,
"preview": "{\n \"locked\": false,\n \"version\": 2,\n \"targets\": {\n \"UAP,Version=v10.0\": {\n \"Microsoft.AspNet.WebApi.Client/5.2"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPMSBand/UWPMSBand.sln",
"chars": 2062,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.24720.0\nMini"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/App.xaml",
"chars": 269,
"preview": "<Application\n x:Class=\"UWPSimulatedSensors.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/App.xaml.cs",
"chars": 3903,
"preview": "using System;\nusing Windows.ApplicationModel;\nusing Windows.ApplicationModel.Activation;\nusing Windows.UI.Xaml;\nusing W"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/ApplicationInsights.config",
"chars": 157,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ApplicationInsights xmlns = \"http://schemas.microsoft.com/ApplicationInsights/20"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/MainPage.xaml",
"chars": 3026,
"preview": "<Page\n x:Class=\"UWPSimulatedSensors.MainPage\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/MainPage.xaml.cs",
"chars": 10100,
"preview": "using System;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing Windows.Devices.Geolocation;\nusing Windows."
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/Package.appxmanifest",
"chars": 1643,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Package xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\""
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/Properties/AssemblyInfo.cs",
"chars": 1055,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/Properties/Default.rd.xml",
"chars": 1241,
"preview": "<!--\n This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most\n develope"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/UWPSimulatedSensors.csproj",
"chars": 6763,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/project.json",
"chars": 614,
"preview": "{\n \"dependencies\": {\n \"Microsoft.ApplicationInsights\": \"2.1.0\",\n \"Microsoft.ApplicationInsights.PersistenceChann"
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors/project.lock.json",
"chars": 899476,
"preview": "{\n \"locked\": false,\n \"version\": 2,\n \"targets\": {\n \"UAP,Version=v10.0\": {\n \"Microsoft.ApplicationInsights/2.1."
},
{
"path": "Devices/DirectlyConnectedDevices/UWPSimulatedSensors/UWPSimulatedSensors.sln",
"chars": 2092,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.24720.0\nMini"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors/Helpers/Settings.cs",
"chars": 1316,
"preview": "// Helpers/Settings.cs\nusing Plugin.Settings;\nusing Plugin.Settings.Abstractions;\n\nnamespace XamarinSimulatedSensors.Hel"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors/MyClass.cs",
"chars": 1248,
"preview": "using System;\nusing System.Text;\nusing System.Diagnostics;\nusing ConnectTheDotsHelper;\nusing XamarinSimulatedSensors.He"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors/Properties/AssemblyInfo.cs",
"chars": 991,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\n\n// Information about this assembly is defined by the f"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.csproj",
"chars": 6683,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microso"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors/app.config",
"chars": 877,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <runtime>\n <assemblyBinding xmlns=\"urn:schemas-microsoft-co"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors/packages.config",
"chars": 1171,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"Microsoft.Azure.Devices.Client\" version=\"1.1.4\" target"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/Assets/AboutAssets.txt",
"chars": 604,
"preview": "Any raw assets you want to be deployed with your application can be placed in\nthis directory (and child directories) and"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/Helpers/Settings.cs",
"chars": 1101,
"preview": "/*\n// Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/MainActivity.cs",
"chars": 7412,
"preview": "using System;\nusing System.Threading.Tasks;\n\nusing Android.App;\nusing Android.Content;\nusing Android.Runtime;\nusing And"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/Properties/AndroidManifest.xml",
"chars": 238,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<uses-sdk"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/Properties/AssemblyInfo.cs",
"chars": 1025,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing Android.App;\n\n// Information about this assembly "
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/Resources/AboutResources.txt",
"chars": 1694,
"preview": "Images, layout descriptions, binary blobs and string dictionaries can be included \nin your application as resource files"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/Resources/Resource.designer.cs",
"chars": 4469,
"preview": "#pragma warning disable 1591\n//------------------------------------------------------------------------------\n// <auto-g"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/Resources/layout/Main.axml",
"chars": 3388,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/Resources/values/Strings.xml",
"chars": 183,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\t<string name=\"hello\">Hello World, Click Me!</string>\n\t<string name="
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/XamarinSimulatedSensors.Droid.csproj",
"chars": 7471,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microso"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/app.config",
"chars": 1319,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <runtime>\n <assemblyBinding xmlns=\"urn:schemas-microsoft-co"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Droid/packages.config",
"chars": 933,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"Microsoft.Azure.Devices.Client\" version=\"1.1.4\" target"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/App.config",
"chars": 2213,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <startup> \n <supportedRuntime version=\"v4.0\" sku=\".NE"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Form1.Designer.cs",
"chars": 11852,
"preview": "namespace XamarinSimulatedSensors.Windows\n{\n partial class Form1\n {\n /// <summary>\n /// Required de"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Form1.cs",
"chars": 4264,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nu"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Form1.resx",
"chars": 5696,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Helpers/Settings.cs",
"chars": 1103,
"preview": "/*\n// Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Program.cs",
"chars": 530,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows.F"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Properties/AssemblyInfo.cs",
"chars": 1435,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Properties/Resources.Designer.cs",
"chars": 3203,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// This code w"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Properties/Resources.resx",
"chars": 6088,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Properties/Settings.Designer.cs",
"chars": 1086,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// This code w"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/Properties/Settings.settings",
"chars": 240,
"preview": "<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\""
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/XamarinSimulatedSensors.Windows.csproj",
"chars": 13182,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.Windows/packages.config",
"chars": 2300,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"DotNetty.Buffers-signed\" version=\"0.3.2\" targetFramewo"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.iOS/AppDelegate.cs",
"chars": 2156,
"preview": "using Foundation;\nusing UIKit;\n\nnamespace XamarinSimulatedSensors.iOS\n{\n\t// The UIApplicationDelegate for the applicati"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.iOS/Entitlements.plist",
"chars": 190,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs"
},
{
"path": "Devices/DirectlyConnectedDevices/XamarinSimulatedSensors/XamarinSimulatedSensors/XamarinSimulatedSensors.iOS/Helpers/Settings.cs",
"chars": 1099,
"preview": "/*\n// Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using"
}
]
// ... and 207 more files (download for full content)
About this extraction
This page contains the full source code of the MSOpenTech/connectthedots GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 407 files (3.5 MB), approximately 956.0k tokens, and a symbol index with 791 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.