示例#1
0
 /// <summary>
 /// constructor
 /// </summary>
 public PhoneService(string server, string credential)
 {
     Accelerometer = AccelerometerService.CreateStaticInstance(this);
     AddNode(Accelerometer);
     Barometer = BarometerService.CreateStaticInstance(this);
     AddNode(Barometer);
     Compass = CompassService.CreateStaticInstance(this);
     AddNode(Compass);
     GpsLocation = new GpsLocationService(this);
     AddNode(GpsLocation);
     Gyroscope = GyroscopeService.CreateStaticInstance(this);
     AddNode(Gyroscope);
     Magnetometer = MagnetometerService.CreateStaticInstance(this);
     AddNode(Magnetometer);
     OrientationSensor = OrientationSensorService.CreateStaticInstance(this);
     AddNode(OrientationSensor);
     TextToSpeechService = new TextToSpeechService(this);
     AddNode(TextToSpeechService);
     Sms = new SmsActionService(this);
     AddNode(Sms);
     VibrateAction = new VibrateActionService(this);
     AddNode(VibrateAction);
     CaptureAction = new CaptureActionService(this);
     AddNode(CaptureAction);
     Email = new EmailActionService(this);
     AddNode(Email);
     Battery = new BatteryService(this);
     AddNode(Battery);
     // device data
     DeviceInfo = new DeviceInfoData(nameof(DeviceInfo), this);
 }
示例#2
0
 /// <summary>
 /// Internal method to create singleton instance must be called once during initialization
 /// </summary>
 internal static GyroscopeService CreateStaticInstance(IotNode parent)
 {
     if (s_instance == null)
     {
         s_instance = new GyroscopeService(parent);
     }
     return(s_instance);
 }