@@ -29,11 +29,42 @@ public partial class DevicePortal
2929 /// </summary>
3030 public static readonly string HolographicWebManagementHttpSettingsApi = "api/holographic/os/webmanagement/settings/https" ;
3131
32+ /// <summary>
33+ /// Enumeration describing the status of a process
34+ /// </summary>
35+ public enum ProcessStatus
36+ {
37+ /// <summary>
38+ /// The process is running
39+ /// </summary>
40+ Running = 0 ,
41+
42+ /// <summary>
43+ /// The process is stopped
44+ /// </summary>
45+ Stopped
46+ }
47+
48+ /// <summary>
49+ /// Gets the status of the Holographic Services on this HoloLens.
50+ /// </summary>
51+ /// <returns>HolographicServices object describing the state of the Holographic services.</returns>
52+ /// <remarks>This method is only supported on HoloLens.</remarks>
53+ public async Task < HolographicServices > GetHolographicServiceState ( )
54+ {
55+ if ( ! Utilities . IsHoloLens ( this . Platform , this . DeviceFamily ) )
56+ {
57+ throw new NotSupportedException ( "This method is only supported on HoloLens." ) ;
58+ }
59+
60+ return await this . GetAsync < HolographicServices > ( HolographicServicesApi ) ;
61+ }
62+
3263 /// <summary>
3364 /// Gets the interpupilary distance registered on the device.
3465 /// </summary>
3566 /// <returns>Interpupilary distance, in millimeters.</returns>
36- /// <remarks>This method is only supported on HoloLens devices .</remarks>
67+ /// <remarks>This method is only supported on HoloLens.</remarks>
3768 public async Task < float > GetInterPupilaryDistanceAsync ( )
3869 {
3970 if ( ! Utilities . IsHoloLens ( this . Platform , this . DeviceFamily ) )
@@ -50,7 +81,7 @@ public async Task<float> GetInterPupilaryDistanceAsync()
5081 /// </summary>
5182 /// <param name="httpsRequired">Desired value for HTTPS communication</param>
5283 /// <returns>True if WiFi based communication requires a secure connection, false otherwise.</returns>
53- /// <remarks>This method is only supported on HoloLens devices .</remarks>
84+ /// <remarks>This method is only supported on HoloLens.</remarks>
5485 public async Task SetIsHttpsRequiredAsync ( bool httpsRequired )
5586 {
5687 if ( ! Utilities . IsHoloLens ( this . Platform , this . DeviceFamily ) )
@@ -70,7 +101,7 @@ await this.PostAsync(
70101 /// </summary>
71102 /// <param name="ipd">Interpupilary distance, in millimeters.</param>
72103 /// <returns>Task for tracking the POST call</returns>
73- /// <remarks>This method is only supported on HoloLens devices .</remarks>
104+ /// <remarks>This method is only supported on HoloLens.</remarks>
74105 public async Task SetInterPupilaryDistanceAsync ( float ipd )
75106 {
76107 if ( ! Utilities . IsHoloLens ( this . Platform , this . DeviceFamily ) )
@@ -89,7 +120,7 @@ await this.PostAsync(
89120 /// Gets the WiFi http security requirements for communication with the device.
90121 /// </summary>
91122 /// <returns>True if WiFi based communication requires a secure connection, false otherwise.</returns>
92- /// <remarks>This method is only supported on HoloLens devices .</remarks>
123+ /// <remarks>This method is only supported on HoloLens.</remarks>
93124 public async Task < bool > GetIsHttpsRequiredAsync ( )
94125 {
95126 if ( ! Utilities . IsHoloLens ( this . Platform , this . DeviceFamily ) )
@@ -103,16 +134,59 @@ public async Task<bool> GetIsHttpsRequiredAsync()
103134
104135 #region Data contract
105136 /// <summary>
106- /// Object representation for HTTP settings
137+ /// Object reporesentation of the status of the Holographic services
107138 /// </summary>
108139 [ DataContract ]
109- public class WebManagementHttpSettings
140+ public class HolographicServices
110141 {
111142 /// <summary>
112- /// Gets a value indicating whether HTTPS is required
143+ /// Gets the status for the collection of holographic services
113144 /// </summary>
114- [ DataMember ( Name = "httpsRequired" ) ]
115- public bool IsHttpsRequired { get ; private set ; }
145+ [ DataMember ( Name = "SoftwareStatus" ) ]
146+ public HolographicSoftwareStatus Status { get ; private set ; }
147+ }
148+
149+ /// <summary>
150+ /// Object representation of the collection of holographic services.
151+ /// </summary>
152+ [ DataContract ]
153+ public class HolographicSoftwareStatus
154+ {
155+ /// <summary>
156+ /// Gets the status of dwm.exe
157+ /// </summary>
158+ [ DataMember ( Name = "dwm.exe" ) ]
159+ public ServiceStatus Dwm { get ; private set ; }
160+
161+ /// <summary>
162+ /// Gets the status of holoshellapp.exe
163+ /// </summary>
164+ [ DataMember ( Name = "holoshellapp.exe" ) ]
165+ public ServiceStatus HoloShellApp { get ; private set ; }
166+
167+ /// <summary>
168+ /// Gets the status of holosi.exe
169+ /// </summary>
170+ [ DataMember ( Name = "holosi.exe" ) ]
171+ public ServiceStatus HoloSi { get ; private set ; }
172+
173+ /// <summary>
174+ /// Gets the status of mixedrealitycapture.exe
175+ /// </summary>
176+ [ DataMember ( Name = "mixedrealitycapture.exe" ) ]
177+ public ServiceStatus MixedRealitytCapture { get ; private set ; }
178+
179+ /// <summary>
180+ /// Gets the status of sihost.exe
181+ /// </summary>
182+ [ DataMember ( Name = "sihost.exe" ) ]
183+ public ServiceStatus SiHost { get ; private set ; }
184+
185+ /// <summary>
186+ /// Gets the status of spectrum.exe
187+ /// </summary>
188+ [ DataMember ( Name = "spectrum.exe" ) ]
189+ public ServiceStatus Spectrum { get ; private set ; }
116190 }
117191
118192 /// <summary>
@@ -136,6 +210,61 @@ public float Ipd
136210 set { this . IpdRaw = ( int ) ( value * 1000 ) ; }
137211 }
138212 }
213+
214+ /// <summary>
215+ /// Object representation of the status of a service
216+ /// </summary>
217+ [ DataContract ]
218+ public class ServiceStatus
219+ {
220+ /// <summary>
221+ /// Gets the raw value returned for the expected service status
222+ /// </summary>
223+ [ DataMember ( Name = "Expected" ) ]
224+ public string ExpectedRaw { get ; private set ; }
225+
226+ /// <summary>
227+ /// Gets the raw value returned for the observed service status
228+ /// </summary>
229+ [ DataMember ( Name = "Observed" ) ]
230+ public string ObservedRaw { get ; private set ; }
231+
232+ /// <summary>
233+ /// Gets the the expected service status
234+ /// </summary>
235+ public ProcessStatus Expected
236+ {
237+ get
238+ {
239+ return ( this . ExpectedRaw == "Running" ) ? ProcessStatus . Running : ProcessStatus . Stopped ;
240+ }
241+ }
242+
243+ /// <summary>
244+ /// Gets the the observed service status
245+ /// </summary>
246+ public ProcessStatus Observed
247+ {
248+ get
249+ {
250+ return ( this . ObservedRaw == "Running" ) ? ProcessStatus . Running : ProcessStatus . Stopped ;
251+ }
252+ }
253+ }
254+
255+ /// <summary>
256+ /// Object representation for HTTP settings
257+ /// </summary>
258+ [ DataContract ]
259+ public class WebManagementHttpSettings
260+ {
261+ /// <summary>
262+ /// Gets a value indicating whether HTTPS is required
263+ /// </summary>
264+ [ DataMember ( Name = "httpsRequired" ) ]
265+ public bool IsHttpsRequired { get ; private set ; }
266+ }
267+
139268 #endregion // Data contract
140269 }
141270}
0 commit comments