PXR_Enterprise.cs 96 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012
  1. /*******************************************************************************
  2. Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
  3. NOTICE:All information contained herein is, and remains the property of
  4. PICO Technology Co., Ltd. The intellectual and technical concepts
  5. contained herein are proprietary to PICO Technology Co., Ltd. and may be
  6. covered by patents, patents in process, and are protected by trade secret or
  7. copyright law. Dissemination of this information or reproduction of this
  8. material is strictly forbidden unless prior written permission is obtained from
  9. PICO Technology Co., Ltd.
  10. *******************************************************************************/
  11. using System;
  12. using System.Collections.Generic;
  13. using UnityEngine.XR;
  14. namespace Unity.XR.PICO.TOBSupport
  15. {
  16. /**
  17. * Enterprise APIs are only supported by enterprise devices, including PICO Neo2, Neo2 Eye, Neo3 Pro、Neo3 Pro Eye, G2 4K/4K E/4K Plus (system version 4.0.3 or later), and PICO 4 Enterprise.
  18. * Do not use them on consumer devices.
  19. */
  20. public class PXR_Enterprise
  21. {
  22. /// <summary>
  23. /// Initializes the enterprise service for a specified object. Must be called before calling other enterprise APIs.
  24. /// </summary>
  25. /// <returns>Whether the enterprise service has been initialized:
  26. /// * `true`: success
  27. /// * `false`: failure
  28. /// @note OpenXR does not support the returns. The returns belong to EasyAR initialization.
  29. public static bool InitEnterpriseService()
  30. {
  31. PXR_EnterpriseTools.Instance.StartUp();
  32. bool result = PXR_EnterprisePlugin.UPxr_InitEnterpriseService();
  33. return result;
  34. }
  35. /// <summary>
  36. /// Binds the enterprise service. Must be called before calling other system related functions.
  37. /// </summary>
  38. /// <param name="callback">
  39. /// Service-binding result callback that allows for bool values:
  40. /// * `true`: success
  41. /// * `false`: failure
  42. /// If no callback is specified, the parameter will default to null.
  43. /// </param>
  44. public static void BindEnterpriseService(Action<bool> callback=null)
  45. {
  46. PXR_EnterprisePlugin.UPxr_BindEnterpriseService(callback);
  47. }
  48. /// <summary>
  49. /// Unbinds the enterprise service.
  50. /// </summary>
  51. public static void UnBindEnterpriseService()
  52. {
  53. PXR_EnterprisePlugin.UPxr_UnBindEnterpriseService();
  54. }
  55. /// <summary>
  56. /// Gets the specified type of device information.
  57. /// </summary>
  58. /// <param name="type">The target information type. Enumerations:
  59. /// * `ELECTRIC_QUANTITY`: battery
  60. /// * `PUI_VERSION`: system version
  61. /// * `EQUIPMENT_MODEL`: device model
  62. /// * `EQUIPMENT_SN`: device SN code
  63. /// * `CUSTOMER_SN`: customer SN code
  64. /// * `INTERNAL_STORAGE_SPACE_OF_THE_DEVICE`: device storage
  65. /// * `DEVICE_BLUETOOTH_STATUS`: bluetooth status
  66. /// * `BLUETOOTH_NAME_CONNECTED`: bluetooth name
  67. /// * `BLUETOOTH_MAC_ADDRESS`: bluetooth MAC address
  68. /// * `DEVICE_WIFI_STATUS`: Wi-Fi connection status
  69. /// * `WIFI_NAME_CONNECTED`: connected Wi-Fi name
  70. /// * `WLAN_MAC_ADDRESS`: WLAN MAC address
  71. /// * `DEVICE_IP`: device IP address
  72. /// * `CHARGING_STATUS`: device charging status
  73. /// </param>
  74. /// <returns>The specified type of device information. For `CHARGING_STATUS`, an int value will be returned: `2`-charging; `3`-not charging.</returns>
  75. public static string StateGetDeviceInfo(SystemInfoEnum type)
  76. {
  77. return PXR_EnterprisePlugin.UPxr_StateGetDeviceInfo(type);
  78. }
  79. /// <summary>
  80. /// Shuts down or reboots the device.
  81. /// @note This is a protected API. You need to add `<meta-data android:name="pico_advance_interface" android:value="0"/>`
  82. /// to the app's AndroidManifest.xml file for calling this API, after which the app is unable to be published on the PICO Store.
  83. /// </summary>
  84. /// <param name="deviceControl">Device action. Enumerations:
  85. /// * `DEVICE_CONTROL_REBOOT`
  86. /// * `DEVICE_CONTROL_SHUTDOWN`
  87. /// </param>
  88. /// <param name="callback">Callback:
  89. /// * `1`: failed to shut down or reboot the device
  90. /// * `2`: no permission to perform this operation
  91. /// </param>
  92. public static void ControlSetDeviceAction(DeviceControlEnum deviceControl, Action<int> callback)
  93. {
  94. PXR_EnterprisePlugin.UPxr_ControlSetDeviceAction(deviceControl, callback);
  95. }
  96. /// <summary>
  97. /// Installs or uninstalls app silently.
  98. /// @note This is a protected API. You need to add `<meta-data android:name="pico_advance_interface" android:value="0"/>`
  99. /// to the app's AndroidManifest.xml file for calling this API, after which the app is unable to be published on the PICO Store.
  100. /// </summary>
  101. /// <param name="packageControl">The action. Enumerations:
  102. /// * `PACKAGE_SILENCE_INSTALL`: silent installation
  103. /// * `PACKAGE_SILENCE_UNINSTALL`: silent uninstallation
  104. /// </param>
  105. /// <param name="path">The path to the app package for silent installation or the name of the app package for silent uninstallation.</param>
  106. /// <param name="callback">Callback:
  107. /// * `0`: success
  108. /// * `1`: failure
  109. /// * `2`: no permission to perform this operation
  110. /// </param>
  111. public static void ControlAPPManager(PackageControlEnum packageControl, string path, Action<int> callback)
  112. {
  113. PXR_EnterprisePlugin.UPxr_ControlAPPManager(packageControl, path, callback);
  114. }
  115. /// <summary>
  116. /// Sets a Wi-Fi that the device is automatically connected to.
  117. /// </summary>
  118. /// <param name="ssid">Wi-Fi name.</param>
  119. /// <param name="pwd">Wi-Fi password.</param>
  120. /// <param name="callback">Callback:
  121. /// * `true`: connected
  122. /// * `false`: failed to connect
  123. /// </param>
  124. public static void ControlSetAutoConnectWIFI(string ssid, string pwd, Action<bool> callback)
  125. {
  126. PXR_EnterprisePlugin.UPxr_ControlSetAutoConnectWIFI(ssid, pwd, callback);
  127. }
  128. /// <summary>
  129. /// Removes the Wi-Fi that the device is automatically connected to.
  130. /// </summary>
  131. /// <param name="callback">Callback:
  132. /// * `true`: removed
  133. /// * `false`: failed to remove
  134. /// </param>
  135. public static void ControlClearAutoConnectWIFI(Action<bool> callback)
  136. {
  137. PXR_EnterprisePlugin.UPxr_ControlClearAutoConnectWIFI(callback);
  138. }
  139. /// <summary>
  140. /// Sets the Home button event.
  141. /// </summary>
  142. /// <param name="eventEnum">Target event. Enumerations:
  143. /// * `SINGLE_CLICK`: single-click
  144. /// * `DOUBLE_CLICK`: double-click
  145. /// * `LONG_PRESS`: long press
  146. /// * `SINGLE_CLICK_RIGHT_CTL`: single-click on the right controller's Home button
  147. /// * `DOUBLE_CLICK_RIGHT_CTL`: double-click on the right controller's Home button
  148. /// * `LONG_PRESS_RIGHT_CTL`: long press on the right controller's Home button
  149. /// * `SINGLE_CLICK_LEFT_CTL`: single-click on the left controller's Home button
  150. /// * `DOUBLE_CLICK_LEFT_CTL`: double-click on the left controller's Home button
  151. /// * `LONG_PRESS_LEFT_CTL`: long press on the left controller's Home button
  152. /// * `SINGLE_CLICK_HMD`: single-click on the HMD's Home button
  153. /// * `DOUBLE_CLICK_HMD`: double-click on the HMD's Home button
  154. /// * `LONG_PRESS_HMD`: long press on the HMD's Home button
  155. /// </param>
  156. /// <param name="function">The function of the event. Enumerations:
  157. /// * `VALUE_HOME_GO_TO_SETTING`: go to Settings
  158. /// * `VALUE_HOME_BACK`: back (only supported by PICO G2 4K)
  159. /// * `VALUE_HOME_RECENTER`: recenter the screen
  160. /// * `VALUE_HOME_OPEN_APP`: open a specified app
  161. /// * `VALUE_HOME_DISABLE`: disable the Home button
  162. /// * `VALUE_HOME_GO_TO_HOME`: open the launcher
  163. /// * `VALUE_HOME_SEND_BROADCAST`: send Home-button-click broadcast
  164. /// * `VALUE_HOME_CLEAN_MEMORY`: clear background apps
  165. /// * `VALUE_HOME_QUICK_SETTING`: enable quick settings
  166. /// * `VALUE_HOME_SCREEN_CAP`: enable screen capture
  167. /// * `VALUE_HOME_SCREEN_RECORD`: enable screen recording
  168. /// </param>
  169. /// <param name="callback">Callback:
  170. /// * `true`: success
  171. /// * `false`: failure
  172. /// </param>
  173. public static void PropertySetHomeKey(HomeEventEnum eventEnum, HomeFunctionEnum function, Action<bool> callback)
  174. {
  175. PXR_EnterprisePlugin.UPxr_PropertySetHomeKey(eventEnum, function, callback);
  176. }
  177. /// <summary>
  178. /// Sets extended settings for the Home button.
  179. /// </summary>
  180. /// <param name="eventEnum">Target event. Enumerations:
  181. /// * `SINGLE_CLICK_RIGHT_CTL`: single-click on the right controller's Home button
  182. /// * `DOUBLE_CLICK_RIGHT_CTL`: double-click on the right controller's Home button
  183. /// * `LONG_PRESS_RIGHT_CTL`: long press on the right controller's Home button
  184. /// * `SINGLE_CLICK_LEFT_CTL`: single-click on the left controller's Home button
  185. /// * `DOUBLE_CLICK_LEFT_CTL`: double-click on the left controller's Home button
  186. /// * `LONG_PRESS_LEFT_CTL`: long press on the left controller's Home button
  187. /// * `SINGLE_CLICK_HMD`: single-click on the HMD's Home button
  188. /// * `DOUBLE_CLICK_HMD`: double-click on the HMD's Home button
  189. /// * `LONG_PRESS_HMD`: long press on the HMD's Home button
  190. /// </param>
  191. /// <param name="function">The function of the event. Enumerations:
  192. /// * `VALUE_HOME_GO_TO_SETTING`: go to Settings
  193. /// * `VALUE_HOME_BACK`: back (only supported by PICO G2 4K)
  194. /// * `VALUE_HOME_RECENTER`: recenter the screen
  195. /// * `VALUE_HOME_OPEN_APP`: open a specified app
  196. /// * `VALUE_HOME_DISABLE`: disable the Home button
  197. /// * `VALUE_HOME_GO_TO_HOME`: open the launcher
  198. /// * `VALUE_HOME_SEND_BROADCAST`: send Home-key-click broadcast
  199. /// * `VALUE_HOME_CLEAN_MEMORY`: clear background apps
  200. /// * `VALUE_HOME_QUICK_SETTING`: enable quick settings
  201. /// * `VALUE_HOME_SCREEN_CAP`: enable screen capture
  202. /// * `VALUE_HOME_SCREEN_RECORD`: enable screen recording
  203. /// </param>
  204. /// <param name="timesetup">The interval of key pressing is set only if there is the double click event or long pressing event. When shortly pressing the Home button, pass `0`.</param>
  205. /// <param name="pkg">Pass `null`.</param>
  206. /// <param name="className">Pass `null`.</param>
  207. /// <param name="callback">Callback:
  208. /// * `true`: set
  209. /// * `false`: failed to set
  210. /// </param>
  211. public static void PropertySetHomeKeyAll(HomeEventEnum eventEnum, HomeFunctionEnum function, int timesetup, string pkg, string className, Action<bool> callback)
  212. {
  213. PXR_EnterprisePlugin.UPxr_PropertySetHomeKeyAll(eventEnum, function, timesetup, pkg, className, callback);
  214. }
  215. /// <summary>
  216. /// Sets the Power button's event.
  217. /// </summary>
  218. /// <param name="isSingleTap">Whether it is a single click event:
  219. /// * `true`: single-click event
  220. /// * `false`: long-press event
  221. /// </param>
  222. /// <param name="enable">Enable or disable the Power button:
  223. /// * `true`: enable
  224. /// * `false`: disable
  225. /// </param>
  226. /// <param name="callback">Callback:
  227. /// * `0`: set
  228. /// * `1`: failed to set
  229. /// </param>
  230. public static void PropertyDisablePowerKey(bool isSingleTap, bool enable, Action<int> callback)
  231. {
  232. PXR_EnterprisePlugin.UPxr_PropertyDisablePowerKey(isSingleTap, enable, callback);
  233. }
  234. /// <summary>
  235. /// Sets the time the screen turns off when the device is not in use.
  236. /// </summary>
  237. /// <param name="timeEnum">Screen off timeout. Enumerations:
  238. /// * `Never`: never off
  239. /// * `THREE`: 3s (only supported by PICO G2 4K)
  240. /// * `TEN`: 10s (only supported by PICO G2 4K)
  241. /// * `THIRTY`: 30s
  242. /// * `SIXTY`: 60s
  243. /// * `THREE_HUNDRED`: 5 mins
  244. /// * `SIX_HUNDRED`: 10 mins
  245. /// </param>
  246. /// <param name="callback">Callback:
  247. /// * `0`: set
  248. /// * `1`: failed to set
  249. /// * `10`: the screen off timeout should not be longer than the system sleep timeout
  250. /// </param>
  251. public static void PropertySetScreenOffDelay(ScreenOffDelayTimeEnum timeEnum, Action<int> callback)
  252. {
  253. PXR_EnterprisePlugin.UPxr_PropertySetScreenOffDelay(timeEnum, callback);
  254. }
  255. /// <summary>
  256. /// Sets the time the system sleeps when the device is not in use.
  257. /// </summary>
  258. /// <param name="timeEnum">System sleep timeout. Enumerations:
  259. /// * `Never`: never sleep
  260. /// * `FIFTEEN`: 15s (only supported by PICO G2 4K)
  261. /// * `THIRTY`: 30s (only supported by PICO G2 4K)
  262. /// * `SIXTY`: 60s (only supported by PICO G2 4K)
  263. /// * `THREE_HUNDRED`: 5 mins
  264. /// * `SIX_HUNDRED`: 10 mins
  265. /// * `ONE_THOUSAND_AND_EIGHT_HUNDRED`: 30 mins
  266. /// </param>
  267. public static void PropertySetSleepDelay(SleepDelayTimeEnum timeEnum)
  268. {
  269. PXR_EnterprisePlugin.UPxr_PropertySetSleepDelay(timeEnum);
  270. }
  271. /// <summary>
  272. /// Switches specified system function on/off.
  273. /// </summary>
  274. /// <param name="systemFunction">Function name. Enumerations:
  275. /// * `SFS_USB`: USB debugging
  276. /// * `SFS_AUTOSLEEP`: auto sleep
  277. /// * `SFS_SCREENON_CHARGING`: screen-on charging
  278. /// * `SFS_OTG_CHARGING`: OTG charging (supported by G2 devices)
  279. /// * `SFS_RETURN_MENU_IN_2DMODE`: display the Return icon on the 2D screen
  280. /// * `SFS_COMBINATION_KEY`: combination key
  281. /// * `SFS_CALIBRATION_WITH_POWER_ON`: calibration with power on
  282. /// * `SFS_SYSTEM_UPDATE`: system update (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  283. /// * `SFS_CAST_SERVICE`: phone casting service
  284. /// * `SFS_EYE_PROTECTION`: eye-protection mode
  285. /// * `SFS_SECURITY_ZONE_PERMANENTLY`: permanently disable the 6DoF play area (supported by PICO Neo2 devices)
  286. /// * `SFS_GLOBAL_CALIBRATION`: global calibration (supported by PICO G2 devices)
  287. /// * `SFS_Auto_Calibration`: auto calibration
  288. /// * `SFS_USB_BOOT`: USB plug-in boot
  289. /// * `SFS_VOLUME_UI`: global volume UI (need to restart the device to make the setting take effect)
  290. /// * `SFS_CONTROLLER_UI`: global controller connected UI
  291. /// * `SFS_NAVGATION_SWITCH`: navigation bar
  292. /// * `SFS_SHORTCUT_SHOW_RECORD_UI`: screen recording button UI
  293. /// * `SFS_SHORTCUT_SHOW_FIT_UI`: PICO fit UI
  294. /// * `SFS_SHORTCUT_SHOW_CAST_UI`: screencast button UI
  295. /// * `SFS_SHORTCUT_SHOW_CAPTURE_UI`: screenshot button UI
  296. /// * `SFS_USB_FORCE_HOST`: set the Neo3 Pro/Pro Eye device as the host device
  297. /// * `SFS_SET_DEFAULT_SAFETY_ZONE`: set a default play area for PICO Neo3 and PICO 4 series devices
  298. /// * `SFS_ALLOW_RESET_BOUNDARY`: allow to reset customized boundary for PICO Neo3 series devices
  299. /// * `SFS_BOUNDARY_CONFIRMATION_SCREEN`: whether to display the boundary confirmation screen for PICO Neo3 and PICO 4 series devices
  300. /// * `SFS_LONG_PRESS_HOME_TO_RECENTER`: long press the Home button to recenter for PICO Neo3 and PICO 4 series devices
  301. /// * `SFS_POWER_CTRL_WIFI_ENABLE`: stay connected to the network when the device sleeps/turns off (supported by PICO Neo3 Pro with system version 4.8.0 or later and PICO 4 Enterprise with system version OTA-5.2.8 or later)
  302. /// * `SFS_WIFI_DISABLE`: disable Wi-Fi (supported by PICO Neo3 Pro with system version 4.8.0 or later and PICO 4 Enterprise with system version OTA-5.2.8 or later)
  303. /// * `SFS_SIX_DOF_SWITCH`: 6DoF position tracking for PICO Neo3 and PICO 4 series devices
  304. /// * `SFS_INVERSE_DISPERSION`: anti-dispersion (supported by PICO Neo3 Pro with system version 4.8.0 or later and PICO 4 Enterprise with system version OTA0-5.2.8 or later)
  305. /// * `SFS_LOGCAT`: system log switch (/data/logs) (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  306. /// * `SFS_PSENSOR`: PSensor switch (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  307. /// * `SFS_SYSTEM_UPDATE_OTA`: OTA upgrade (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  308. /// * `SFS_SYSTEM_UPDATE_APP`: app upgrade and update (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  309. /// * `SFS_SHORTCUT_SHOW_WLAN_UI`: quickly set whether to show the WLAN button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  310. /// * `SFS_SHORTCUT_SHOW_BOUNDARY_UI`: quickly set whether to show the boundary button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  311. /// * `SFS_SHORTCUT_SHOW_BLUETOOTH_UI`: quickly set whether to show the bluetooth button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  312. /// * `SFS_SHORTCUT_SHOW_CLEAN_TASK_UI`: quickly set whether to show the one-click clear button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  313. /// * `SFS_SHORTCUT_SHOW_IPD_ADJUSTMENT_UI`: quickly set whether to show the IPD adjustment button (supported by PICO 4 Enterprise with system version 5.4.0 or later)
  314. /// * `SFS_SHORTCUT_SHOW_POWER_UI`: quickly set whether to show the power button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  315. /// * `SFS_SHORTCUT_SHOW_EDIT_UI`: quickly set whether to show the edit button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  316. /// * `SFS_BASIC_SETTING_APP_LIBRARY_UI`: the button for customizing the app library (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  317. /// * `SFS_BASIC_SETTING_SHORTCUT_UI`: the button for customizing quick settings (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  318. /// * `SFS_LED_FLASHING_WHEN_SCREEN_OFF`: whether to keep the LED indicator light on when the device's screen is off and the battery is below 20% (supported by PICO G3 devices)
  319. /// * `SFS_BASIC_SETTING_CUSTOMIZE_SETTING_UI`: customize settings item to show or hide in basic settings
  320. /// * `SFS_BASIC_SETTING_SHOW_APP_QUIT_CONFIRM_DIALOG`: whether to show the app-quit dialog box when switching to a new app
  321. /// * `SFS_BASIC_SETTING_KILL_BACKGROUND_VR_APP`: whether to kill background VR apps (`1`: kill, and this is the default setting; `2`: do not kill)
  322. /// * `SFS_BASIC_SETTING_SHOW_CAST_NOTIFICATION`: whether to show a blue icon when casting the screen. The icon is displayed by default, and you can set the value to `0` to hide it.
  323. /// * `SFS_AUTOMATIC_IPD`: auto IPD switch (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.7.0 or later)
  324. /// * `SFS_QUICK_SEETHROUGH_MODE`: quick seethrough mode switch (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.7.0 or later)
  325. /// * `SFS_HIGN_REFERSH_MODE`: high refresh mode switch (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.7.0 or later)
  326. /// * `SFS_SEETHROUGH_APP_KEEP_RUNNING`: set whether to keep the app running under the seethrough mode (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.8.0 or later)
  327. /// * `SFS_OUTDOOR_TRACKING_ENHANCEMENT`: enhance outdoor position tracking (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.8.0 or later)
  328. /// * `SFS_AUTOIPD_AUTO_COMFIRM`: quick auto-IPD (supported by PICO 4 Enterprise with system version 5.8.0 or later)
  329. /// * `SFS_LAUNCH_AUTOIPD_IF_GLASSES_WEARED`: set whether to launch auto-IPD after wearing the headset (supported by PICO 4 Enterprise with system version 5.8.0 or later)
  330. /// * `SFS_GESTURE_RECOGNITION_HOME_ENABLE`: Home gesture switch (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.8.0 or later)
  331. /// * `SFS_GESTURE_RECOGNITION_RESET_ENABLE`: enable/disable the Reset gesture (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.8.0 or later)
  332. /// * `SFS_AUTO_COPY_FILES_FROM_USB_DEVICE`: automatically import OTG resources (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.8.0 or later)
  333. /// </param>
  334. /// <param name="switchEnum">Whether to switch the function on/off:
  335. /// * `S_ON`: switch on
  336. /// * `S_OFF`: switch off
  337. /// </param>
  338. public static void SwitchSystemFunction(SystemFunctionSwitchEnum systemFunction, SwitchEnum switchEnum)
  339. {
  340. PXR_EnterprisePlugin.UPxr_SwitchSystemFunction(systemFunction, switchEnum);
  341. }
  342. /// <summary>
  343. /// Sets the USB configuration mode.
  344. /// </summary>
  345. /// <param name="uSBConfigModeEnum">USB configuration mode. Enumerations:
  346. /// * `MTP`: MTP mode
  347. /// * `CHARGE`: charging mode
  348. /// </param>
  349. public static void SwitchSetUsbConfigurationOption(USBConfigModeEnum uSBConfigModeEnum)
  350. {
  351. PXR_EnterprisePlugin.UPxr_SwitchSetUsbConfigurationOption(uSBConfigModeEnum);
  352. }
  353. /// <summary>
  354. /// Sets the duration after which the controllers enter the pairing mode.
  355. /// @note Supported by PICO Neo3 Pro (system version 5.4.0 or later) and PICO 4 Enterprise (system version 5.2.8 or later)
  356. /// </summary>
  357. /// <param name="timeEnum">Duration enumerations:
  358. /// * `SIX`: 6 seconds
  359. /// * `FIFTEEN`: 15 seconds
  360. /// * `SIXTY`: 60 seconds
  361. /// * `ONE_HUNDRED_AND_TWENTY`: 120 seconds (2 minutes)
  362. /// * `SIX_HUNDRED`: 600 seconds (5 minutes)
  363. /// * `NEVER`: never enter the pairing mode
  364. /// </param>
  365. /// <param name="callback">Returns the result:
  366. /// * `0`: failure
  367. /// * `1`: success
  368. /// </param>
  369. public static void SetControllerPairTime(ControllerPairTimeEnum timeEnum, Action<int> callback)
  370. {
  371. PXR_EnterprisePlugin.UPxr_SetControllerPairTime(timeEnum, callback);
  372. }
  373. /// <summary>
  374. /// Gets the duration after which the controllers enter the pairing mode.
  375. /// @note Supported by PICO Neo3 Pro (system version 5.4.0 or later) and PICO 4 Enterprise (system version 5.2.8 or later)
  376. /// </summary>
  377. /// <param name="callback">Returns a duration enumeration from the following:
  378. /// * `SIX`: 6 seconds
  379. /// * `FIFTEEN`: 15 seconds
  380. /// * `SIXTY`: 60 seconds
  381. /// * `ONE_HUNDRED_AND_TWENTY`: 120 seconds (2 minutes)
  382. /// * `SIX_HUNDRED`: 600 seconds (5 minutes)
  383. /// * `NEVER`: never enter the pairing mode
  384. /// </param>
  385. public static void GetControllerPairTime(Action<int> callback)
  386. {
  387. PXR_EnterprisePlugin.UPxr_GetControllerPairTime(callback);
  388. }
  389. /// <summary>
  390. /// Turns the screen on.
  391. /// @note This is a protected API. You need to add `<meta-data android:name="pico_advance_interface" android:value="0"/>`
  392. /// to the app's AndroidManifest.xml file for calling this API, after which the app is unable to be published on the PICO Store.
  393. /// </summary>
  394. public static void ScreenOn()
  395. {
  396. PXR_EnterprisePlugin.UPxr_ScreenOn();
  397. }
  398. /// <summary>
  399. /// Turns the screen off.
  400. /// @note This is a protected API. You need to add `<meta-data android:name="pico_advance_interface" android:value="0"/>`
  401. /// to the app's AndroidManifest.xml file for calling this API, after which the app is unable to be published on the PICO Store.
  402. /// </summary>
  403. public static void ScreenOff()
  404. {
  405. PXR_EnterprisePlugin.UPxr_ScreenOff();
  406. }
  407. /// <summary>
  408. /// Acquires the wake lock.
  409. /// </summary>
  410. public static void AcquireWakeLock()
  411. {
  412. PXR_EnterprisePlugin.UPxr_AcquireWakeLock();
  413. }
  414. /// <summary>
  415. /// Releases the wake lock.
  416. /// </summary>
  417. public static void ReleaseWakeLock()
  418. {
  419. PXR_EnterprisePlugin.UPxr_ReleaseWakeLock();
  420. }
  421. /// <summary>
  422. /// Enables the Confirm button.
  423. /// </summary>
  424. public static void EnableEnterKey()
  425. {
  426. PXR_EnterprisePlugin.UPxr_EnableEnterKey();
  427. }
  428. /// <summary>
  429. /// Disables the Confirm button.
  430. /// </summary>
  431. public static void DisableEnterKey()
  432. {
  433. PXR_EnterprisePlugin.UPxr_DisableEnterKey();
  434. }
  435. /// <summary>
  436. /// Enables the Volume button.
  437. /// </summary>
  438. public static void EnableVolumeKey()
  439. {
  440. PXR_EnterprisePlugin.UPxr_EnableVolumeKey();
  441. }
  442. /// <summary>
  443. /// Disables the Volume button.
  444. /// </summary>
  445. public static void DisableVolumeKey()
  446. {
  447. PXR_EnterprisePlugin.UPxr_DisableVolumeKey();
  448. }
  449. /// <summary>
  450. /// Enables the Back button.
  451. /// </summary>
  452. public static void EnableBackKey()
  453. {
  454. PXR_EnterprisePlugin.UPxr_EnableBackKey();
  455. }
  456. /// <summary>
  457. /// Disables the Back button.
  458. /// </summary>
  459. public static void DisableBackKey()
  460. {
  461. PXR_EnterprisePlugin.UPxr_DisableBackKey();
  462. }
  463. /// <summary>
  464. /// Resets all buttons to default configuration.
  465. /// </summary>
  466. /// <param name="callback">Whether all keys have been successfully reset to default configuration:
  467. /// * `true`: reset
  468. /// * `false`: failed to reset
  469. /// </param>
  470. public static void ResetAllKeyToDefault(Action<bool> callback)
  471. {
  472. PXR_EnterprisePlugin.UPxr_ResetAllKeyToDefault(callback);
  473. }
  474. /// <summary>
  475. /// Sets an app as the launcher app. Need to restart the device to make the setting work.
  476. /// </summary>
  477. /// <param name="switchEnum">(deprecated)</param>
  478. /// <param name="packageName">The app's package name.</param>
  479. public static void SetAPPAsHome(SwitchEnum switchEnum, string packageName)
  480. {
  481. PXR_EnterprisePlugin.UPxr_SetAPPAsHome(switchEnum, packageName);
  482. }
  483. /// <summary>
  484. /// Force quits app(s) by passing app PID or package name.
  485. /// @note This is a protected API. You need to add `<meta-data android:name="pico_advance_interface" android:value="0"/>`
  486. /// to the app's AndroidManifest.xml file for calling this API, after which the app is unable to be published on the PICO Store.
  487. /// </summary>
  488. /// <param name="pids">An array of app PID(s).</param>
  489. /// <param name="packageNames">An array of package name(s).</param>
  490. public static void KillAppsByPidOrPackageName(int[] pids, string[] packageNames)
  491. {
  492. PXR_EnterprisePlugin.UPxr_KillAppsByPidOrPackageName(pids, packageNames);
  493. }
  494. /// <summary>
  495. /// Force quits background app(s) expect those in the allowlist.
  496. /// @note This is a protected API. You need to add `<meta-data android:name="pico_advance_interface" android:value="0"/>`
  497. /// to the app's AndroidManifest.xml file for calling this API, after which the app is unable to be published on the PICO Store.
  498. /// </summary>
  499. /// <param name="packageNames">An array of package name(s) to be added to the allowlist. The corresponding app(s) in the allowlist will not be force quit.</param>
  500. public static void KillBackgroundAppsWithWhiteList(string[] packageNames)
  501. {
  502. PXR_EnterprisePlugin.UPxr_KillBackgroundAppsWithWhiteList(packageNames);
  503. }
  504. /// <summary>
  505. /// Freezes the screen to the front. The screen will turn around with the HMD.
  506. /// @note Supported by G2 4K and Neo2 devices.
  507. /// </summary>
  508. /// <param name="freeze">Whether to freeze the screen:
  509. /// * `true`: freeze
  510. /// * `false`: stop freezing
  511. /// </param>
  512. public static void FreezeScreen(bool freeze)
  513. {
  514. PXR_EnterprisePlugin.UPxr_FreezeScreen(freeze);
  515. }
  516. /// <summary>
  517. /// Turns on the screencast function.
  518. /// </summary>
  519. public static void OpenMiracast()
  520. {
  521. PXR_EnterprisePlugin.UPxr_OpenMiracast();
  522. }
  523. /// <summary>
  524. /// Gets the status of the screencast function.
  525. /// </summary>
  526. /// <returns>The status of the screencast function:
  527. /// * `true`: on
  528. /// * `false`: off
  529. /// </returns>
  530. public static bool IsMiracastOn()
  531. {
  532. return PXR_EnterprisePlugin.UPxr_IsMiracastOn();
  533. }
  534. /// <summary>
  535. /// Turns off the screencast function.
  536. /// </summary>
  537. public static void CloseMiracast()
  538. {
  539. PXR_EnterprisePlugin.UPxr_CloseMiracast();
  540. }
  541. /// <summary>
  542. /// Starts looking for devices that can be used for screen casting.
  543. /// </summary>
  544. public static void StartScan()
  545. {
  546. PXR_EnterprisePlugin.UPxr_StartScan();
  547. }
  548. /// <summary>
  549. /// Stops looking for devices that can be used for screen casting.
  550. /// </summary>
  551. public static void StopScan()
  552. {
  553. PXR_EnterprisePlugin.UPxr_StopScan();
  554. }
  555. /// <summary>
  556. /// Casts the screen to the specified device.
  557. /// </summary>
  558. /// <param name="modelJson">A modelJson structure containing the following fields:
  559. /// * `deviceAddress`
  560. /// * `deviceName`
  561. /// * `isAvailable` (`true`-device available; `false`-device not available)
  562. /// </param>
  563. public static void ConnectWifiDisplay(string modelJson)
  564. {
  565. PXR_EnterprisePlugin.UPxr_ConnectWifiDisplay(modelJson);
  566. }
  567. /// <summary>
  568. /// Stops casting the screen to the current device.
  569. /// </summary>
  570. public static void DisConnectWifiDisplay()
  571. {
  572. PXR_EnterprisePlugin.UPxr_DisConnectWifiDisplay();
  573. }
  574. /// <summary>
  575. /// Forgets the device that have been connected for screencast.
  576. /// </summary>
  577. /// <param name="address">Device address.</param>
  578. public static void ForgetWifiDisplay(string address)
  579. {
  580. PXR_EnterprisePlugin.UPxr_ForgetWifiDisplay(address);
  581. }
  582. /// <summary>
  583. /// Renames the device connected for screencast. The name is only for local storage.
  584. /// </summary>
  585. /// <param name="address">The MAC address of the device.</param>
  586. /// <param name="newName">The new device name.</param>
  587. public static void RenameWifiDisplay(string address, string newName)
  588. {
  589. PXR_EnterprisePlugin.UPxr_RenameWifiDisplay(address, newName);
  590. }
  591. /// <summary>
  592. /// Sets the callback for the scanning result, which returns `List<PBS_WifiDisplayModel>` that contains the devices previously connected for screencast and the devices currently found for screencast.
  593. /// </summary>
  594. /// <param name="models">
  595. /// Returns `List<WifiDisplayModel>` that contains the currently scanned device.
  596. /// </param>
  597. public static void SetWDModelsCallback(Action<List<WifiDisplayModel>> models)
  598. {
  599. PXR_EnterprisePlugin.UPxr_SetWDModelsCallback(models);
  600. }
  601. /// <summary>
  602. /// Sets the callback for the scanning result, which returns the JSON string that contains the devices previously connected for screencast and the devices currently found for screencast.
  603. /// </summary>
  604. /// <param name="callback">
  605. /// Returns a JSON string that contains the currently scanned device.
  606. /// </param>
  607. public static void SetWDJsonCallback(Action<string> callback)
  608. {
  609. PXR_EnterprisePlugin.UPxr_SetWDJsonCallback(callback);
  610. }
  611. /// <summary>
  612. /// Manually updates the list of devices for screencast.
  613. /// </summary>
  614. public static void UpdateWifiDisplays()
  615. {
  616. PXR_EnterprisePlugin.UPxr_UpdateWifiDisplays();
  617. }
  618. /// <summary>
  619. /// Gets the information of the currently connected device.
  620. /// </summary>
  621. /// <returns>The information of the currently connected device.</returns>
  622. public static string GetConnectedWD()
  623. {
  624. return PXR_EnterprisePlugin.UPxr_GetConnectedWD();
  625. }
  626. /// <summary>
  627. /// Switches the large space scene on.
  628. /// @note Supported by 6Dof devices.
  629. /// </summary>
  630. /// <param name="open">Whether to switch the large space scene on:
  631. /// * `true`: switch on
  632. /// * `false`: not to switch on
  633. /// </param>
  634. /// <param name="callback">Callback:
  635. /// * `true`: success
  636. /// * `false`: failure
  637. /// </param>
  638. public static void SwitchLargeSpaceScene(bool open, Action<bool> callback)
  639. {
  640. PXR_EnterprisePlugin.UPxr_SwitchLargeSpaceScene(open, callback);
  641. }
  642. /// <summary>
  643. /// Gets the status of the large space scene.
  644. /// @note Supported by 6Dof devices.
  645. /// </summary>
  646. /// <param name="callback">Returns the status of large space:
  647. /// * `0`: switched off
  648. /// * `1`: switched on
  649. /// </param>
  650. public static void GetSwitchLargeSpaceStatus(Action<string> callback)
  651. {
  652. PXR_EnterprisePlugin.UPxr_GetSwitchLargeSpaceStatus(callback);
  653. }
  654. /// <summary>
  655. /// Saves the large space map.
  656. /// @note Supported by 6Dof devices.
  657. /// </summary>
  658. /// <returns>Whether the large space map has been saved:
  659. /// * `true`: saved
  660. /// * `false`: failed to save
  661. /// </returns>
  662. public static bool SaveLargeSpaceMaps()
  663. {
  664. return PXR_EnterprisePlugin.UPxr_SaveLargeSpaceMaps();
  665. }
  666. /// <summary>
  667. /// Exports maps. The exported maps are stored in the /maps/export file.
  668. /// @note Supported by 6Dof devices.
  669. /// </summary>
  670. /// <param name="callback">Returns the result:
  671. /// * `true`: exported
  672. /// * `false`: failed to export
  673. /// </param>
  674. public static void ExportMaps(Action<bool> callback)
  675. {
  676. PXR_EnterprisePlugin.UPxr_ExportMaps(callback);
  677. }
  678. /// <summary>
  679. /// Imports maps. Need to copy maps to the /maps folder.
  680. /// @note Supported by 6Dof devices.
  681. /// </summary>
  682. /// <param name="callback">Returns the result:
  683. /// * `true`: imported
  684. /// * `false`: failed to import
  685. /// </param>
  686. public static void ImportMaps(Action<bool> callback)
  687. {
  688. PXR_EnterprisePlugin.UPxr_ImportMaps(callback);
  689. }
  690. /// <summary>
  691. /// Gets each CPU's utilization for the current device.
  692. /// </summary>
  693. /// <returns>An array of CPU utilization info.</returns>
  694. public static float[] GetCpuUsages()
  695. {
  696. return PXR_EnterprisePlugin.UPxr_GetCpuUsages();
  697. }
  698. /// <summary>
  699. /// Gets device temperature in Celsius.
  700. /// </summary>
  701. /// <param name="type">The requested type of device temperature:
  702. /// * `DEVICE_TEMPERATURE_CPU`: CPU temperature
  703. /// * `DEVICE_TEMPERATURE_GPU`: GPU temperature
  704. /// * `DEVICE_TEMPERATURE_BATTERY`: battery temperature
  705. /// * `DEVICE_TEMPERATURE_SKIN`: surface temperature
  706. /// </param>
  707. /// <param name="source">The requested source of device temperature:
  708. /// * `TEMPERATURE_CURRENT`: current temperature
  709. /// * `TEMPERATURE_THROTTLING`: temperature threshold for throttling
  710. /// * `TEMPERATURE_SHUTDOWN`: temperature threshold for shutdown
  711. /// * `TEMPERATURE_THROTTLING_BELOW_VR_MIN`: temperature threshold for throttling. If the actual temperature is higher than the threshold, the lowest clock frequency for VR mode will not be met
  712. /// </param>
  713. /// <returns>An array of requested float device temperatures in Celsius.</returns>
  714. public static float[] GetDeviceTemperatures(int type, int source)
  715. {
  716. return PXR_EnterprisePlugin.UPxr_GetDeviceTemperatures(type, source);
  717. }
  718. /// <summary>
  719. /// Captures the current screen.
  720. /// @note Not supported by G2 4K devices.
  721. /// </summary>
  722. public static void Capture()
  723. {
  724. PXR_EnterprisePlugin.UPxr_Capture();
  725. }
  726. /// <summary>
  727. /// Records the screen. Call this function again to stop recording.
  728. /// @note Not supported by G2 4K devices.
  729. /// </summary>
  730. public static void Record()
  731. {
  732. PXR_EnterprisePlugin.UPxr_Record();
  733. }
  734. /// <summary>
  735. /// Connects the device to a specified Wi-Fi.
  736. /// </summary>
  737. /// <param name="ssid">Wi-Fi name.</param>
  738. /// <param name="pwd">Wi-Fi password.</param>
  739. /// <param name="ext">Reserved parameter, pass `0` by default.</param>
  740. /// <param name="callback">The callback for indicating whether the Wi-Fi connection is successful:
  741. /// * `0`: connected
  742. /// * `1`: password error
  743. /// * `2`: unknown error
  744. /// </param>
  745. public static void ControlSetAutoConnectWIFIWithErrorCodeCallback(String ssid, String pwd, int ext, Action<int> callback)
  746. {
  747. PXR_EnterprisePlugin.UPxr_ControlSetAutoConnectWIFIWithErrorCodeCallback(ssid, pwd, ext, callback);
  748. }
  749. /// <summary>
  750. /// Keeps an app active. In other words, improves the priority of an app, thereby making the system not to force quit the app.
  751. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA-5.2.8 or later).
  752. /// </summary>
  753. /// <param name="appPackageName">App package name.</param>
  754. /// <param name="keepAlive">Whether to keep the app active (i.e., whether to enhance the priority of the app):
  755. /// * `true`: keep
  756. /// * `false`: not keep
  757. /// </param>
  758. /// <param name="ext">Reserved parameter, pass `0`.</param>
  759. public static void AppKeepAlive(String appPackageName, bool keepAlive, int ext)
  760. {
  761. PXR_EnterprisePlugin.UPxr_AppKeepAlive(appPackageName, keepAlive, ext);
  762. }
  763. /// <summary>
  764. /// Schedules auto startup for the device.
  765. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA-5.2.8 or later).
  766. /// </summary>
  767. /// <param name="year">Year, for example, `2022`.</param>
  768. /// <param name="month">Month, for example, `2`.</param>
  769. /// <param name="day">Day, for example, `22`.</param>
  770. /// <param name="hour">Hour, for example, `22`.</param>
  771. /// <param name="minute">Minute, for example, `22`.</param>
  772. /// <param name="open">Whether to enable scheduled auto startup for the device:
  773. /// * `true`: enable
  774. /// * `false`: disable
  775. /// </param>
  776. public static void TimingStartup(int year, int month, int day, int hour, int minute, bool open)
  777. {
  778. PXR_EnterprisePlugin.UPxr_TimingStartup(year, month, day, hour, minute, open);
  779. }
  780. /// <summary>
  781. /// Schedules auto shutdown for the device.
  782. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version 5.4.0 or later).
  783. /// </summary>
  784. /// <param name="year">Year, for example, `2022`.</param>
  785. /// <param name="month">Month, for example, `2`.</param>
  786. /// <param name="day">Day, for example, `22`.</param>
  787. /// <param name="hour">Hour, for example, `22`.</param>
  788. /// <param name="minute">Minute, for example, `22`.</param>
  789. /// <param name="open">Whether to enable scheduled auto shutdown for the device:
  790. /// * `true`: enable
  791. /// * `false`: disable
  792. /// </param>
  793. public static void TimingShutdown(int year, int month, int day, int hour, int minute, bool open)
  794. {
  795. PXR_EnterprisePlugin.UPxr_TimingShutdown(year, month, day, hour, minute, open);
  796. }
  797. /// <summary>
  798. /// Displays a specified settings screen.
  799. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA-5.2.8 or later).
  800. /// </summary>
  801. /// <param name="settingsEnum">The enumerations of settings screen:
  802. /// * `START_VR_SETTINGS_ITEM_WIFI`: the Wi-Fi settings screen;
  803. /// * `START_VR_SETTINGS_ITEM_BLUETOOTH`: the bluetooth settings screen;
  804. /// * `START_VR_SETTINGS_ITEM_CONTROLLER`: the controller settings screen;
  805. /// * `START_VR_SETTINGS_ITEM_LAB`: the lab settings screen;
  806. /// * `START_VR_SETTINGS_ITEM_BRIGHTNESS`: the brightness settings screen;
  807. /// * `START_VR_SETTINGS_ITEM_GENERAL)`: the general settings screen;
  808. /// * `START_VR_SETTINGS_ITEM_NOTIFICATION`: the notification settings screen.
  809. /// </param>
  810. /// <param name="hideOtherItem">Whether to display the selected settings screen:
  811. /// * `true`: display
  812. /// * `false`: hide
  813. /// </param>
  814. /// <param name="ext">Reserved parameter, pass `0`.</param>
  815. public static void StartVrSettingsItem(StartVRSettingsEnum settingsEnum, bool hideOtherItem, int ext)
  816. {
  817. PXR_EnterprisePlugin.UPxr_StartVrSettingsItem(settingsEnum, hideOtherItem, ext);
  818. }
  819. /// <summary>
  820. /// Changes the Volume button's function to that of the Home and Enter button's, or restores the volume adjustment function to the Volume button.
  821. /// @note Supported by PICO 4 Enterprise with system version OTA-5.2.8 or later.
  822. /// </summary>
  823. /// <param name="switchEnum">Whether to change the Volume button's function:
  824. /// * `S_ON`: change
  825. /// * `S_OFF`: do not change
  826. /// </param>
  827. /// <param name="ext">Reserved parameter, pass `0`.</param>
  828. public static void SwitchVolumeToHomeAndEnter(SwitchEnum switchEnum, int ext)
  829. {
  830. PXR_EnterprisePlugin.UPxr_SwitchVolumeToHomeAndEnter(switchEnum, ext);
  831. }
  832. /// <summary>
  833. /// Gets whether the Volume button's function has been changed to that of the Home and Enter button's.
  834. /// @note Supported by PICO 4 Enterprise with system version OTA-5.2.8 or later.
  835. /// </summary>
  836. /// <returns>
  837. /// * `S_ON`: changed
  838. /// * `S_OFF`: not changed
  839. /// </returns>
  840. public static SwitchEnum IsVolumeChangeToHomeAndEnter()
  841. {
  842. return PXR_EnterprisePlugin.UPxr_IsVolumeChangeToHomeAndEnter();
  843. }
  844. /// <summary>
  845. /// Upgrades the OTA.
  846. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA0-5.2.8 or later).
  847. /// </summary>
  848. /// <param name="otaPackagePath">The location of the OTA package.</param>
  849. /// <returns>
  850. /// * `0`: success
  851. /// * `1`: failure
  852. /// * `21`: OTA package version too low
  853. /// </returns>
  854. public static int InstallOTAPackage(String otaPackagePath)
  855. {
  856. return PXR_EnterprisePlugin.UPxr_InstallOTAPackage(otaPackagePath);
  857. }
  858. /// <summary>
  859. /// Gets the configuration of the Wi-Fi network that the device automatically connects to.
  860. /// </summary>
  861. /// <returns>The SSID and password of the Wi-Fi network.</returns>
  862. public static string GetAutoConnectWiFiConfig()
  863. {
  864. return PXR_EnterprisePlugin.UPxr_GetAutoConnectWiFiConfig();
  865. }
  866. /// <summary>
  867. /// Gets the scheduled auto startup settings for the device.
  868. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA-5.2.8 or later).
  869. /// </summary>
  870. /// <returns>
  871. /// * `open`: the status of scheduled auto startup:
  872. /// * `true`: enabled
  873. /// * `false`: disabled
  874. /// * `time`: the time when the device auto starts up, for example, `1658980380000`. Returned when `open` is `true`.
  875. /// </returns>
  876. public static string GetTimingStartupStatus()
  877. {
  878. return PXR_EnterprisePlugin.UPxr_GetTimingStartupStatus();
  879. }
  880. /// <summary>
  881. /// Gets the scheduled auto shutdown settings for the device.
  882. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA-5.2.8 or later).
  883. /// </summary>
  884. /// <returns>
  885. /// * `open`: the status of scheduled auto shutdown:
  886. /// * `true`: enabled
  887. /// * `false`: disabled
  888. /// * `time`: the time when the device auto shuts down, for example, `1658980380000`. Returned when `open` is `true`.
  889. /// </returns>
  890. public static string GetTimingShutdownStatus()
  891. {
  892. return PXR_EnterprisePlugin.UPxr_GetTimingShutdownStatus();
  893. }
  894. /// <summary>
  895. /// Gets the status of a specified controller button.
  896. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA0-5.2.8 or later).
  897. /// </summary>
  898. /// <param name="pxrControllerKey">The enumerations of controller button:
  899. /// * `CONTROLLER_KEY_JOYSTICK`
  900. /// * `CONTROLLER_KEY_MENU`
  901. /// * `CONTROLLER_KEY_TRIGGER`
  902. /// * `CONTROLLER_KEY_RIGHT_A`
  903. /// * `CONTROLLER_KEY_RIGHT_B`
  904. /// * `CONTROLLER_KEY_LEFT_X`
  905. /// * `CONTROLLER_KEY_LEFT_Y`
  906. /// * `CONTROLLER_KEY_LEFT_GRIP`
  907. /// * `CONTROLLER_KEY_RIGHT_GRIP`
  908. /// </param>
  909. /// <returns>The button's status:
  910. /// * `0`: disabled
  911. /// * `1`: enabled
  912. /// </returns>
  913. public static int GetControllerKeyState(ControllerKeyEnum pxrControllerKey)
  914. {
  915. return PXR_EnterprisePlugin.UPxr_GetControllerKeyState(pxrControllerKey);
  916. }
  917. /// <summary>
  918. /// Enables or disables a specified controller button.
  919. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA-5.2.8 or later).
  920. /// </summary>
  921. /// <param name="pxrControllerKey">The enumerations of controller button:
  922. /// * `CONTROLLER_KEY_JOYSTICK`
  923. /// * `CONTROLLER_KEY_MENU`
  924. /// * `CONTROLLER_KEY_TRIGGER`
  925. /// * `CONTROLLER_KEY_RIGHT_A`
  926. /// * `CONTROLLER_KEY_RIGHT_B`
  927. /// * `CONTROLLER_KEY_LEFT_X`
  928. /// * `CONTROLLER_KEY_LEFT_Y`
  929. /// * `CONTROLLER_KEY_LEFT_GRIP`
  930. /// * `CONTROLLER_KEY_RIGHT_GRIP`
  931. /// </param>
  932. /// <param name="status">Whether to enable or disable the button:
  933. /// * `S_ON`: enable
  934. /// * `S_OFF`: disable
  935. /// </param>
  936. /// <returns>
  937. /// `0` indicates success, other values indicate failure.
  938. /// </returns>
  939. public static int SetControllerKeyState(ControllerKeyEnum pxrControllerKey, SwitchEnum status)
  940. {
  941. return PXR_EnterprisePlugin.UPxr_SetControllerKeyState(pxrControllerKey, status);
  942. }
  943. /// <summary>
  944. /// Gets the status of the switch which is for powering off the USB cable when the device is shut down.
  945. /// </summary>
  946. /// <returns>The switch's status:
  947. /// * `S_ON`: on
  948. /// * `S_OFF`: off
  949. /// </returns>
  950. public static SwitchEnum GetPowerOffWithUSBCable()
  951. {
  952. return PXR_EnterprisePlugin.UPxr_ControlGetPowerOffWithUSBCable();
  953. }
  954. /// <summary>
  955. /// Gets the screen timeout setting for the device.
  956. /// </summary>
  957. /// <returns>`PBS_ScreenOffDelayTimeEnum`: the enumerations of screen timeout. </returns>
  958. public static ScreenOffDelayTimeEnum GetScreenOffDelay()
  959. {
  960. return PXR_EnterprisePlugin.UPxr_PropertyGetScreenOffDelay();
  961. }
  962. /// <summary>
  963. /// Gets the sleep timeout settings for the device.
  964. /// </summary>
  965. /// <returns>`PBS_SleepDelayTimeEnum`: the enumeration of sleep timeout.</returns>
  966. public static SleepDelayTimeEnum GetSleepDelay()
  967. {
  968. return PXR_EnterprisePlugin.UPxr_PropertyGetSleepDelay();
  969. }
  970. /// <summary>
  971. /// Gets the current settings for the Power button.
  972. /// </summary>
  973. /// <returns>
  974. /// * `null`: not set
  975. /// * `singleTap`: whether a single-tap event has been set
  976. /// * `longTap`: whether a long-press event has been set
  977. /// * `longPressTime`: the time after which the long-press event takes place. Returned when `longTap` is `true`.
  978. /// </returns>
  979. public static string GetPowerKeyStatus()
  980. {
  981. return PXR_EnterprisePlugin.UPxr_PropertyGetPowerKeyStatus();
  982. }
  983. /// <summary>
  984. /// Get the Enter button's status.
  985. /// </summary>
  986. /// <returns>
  987. /// * `0`: disabled
  988. /// * `1`: enabled
  989. /// </returns>
  990. public static int GetEnterKeyStatus()
  991. {
  992. return PXR_EnterprisePlugin.UPxr_GetEnterKeyStatus();
  993. }
  994. /// <summary>
  995. /// Get the Volume button's status.
  996. /// </summary>
  997. /// <returns>
  998. /// * `0`: disabled
  999. /// * `1`: enabled
  1000. /// </returns>
  1001. public static int GetVolumeKeyStatus()
  1002. {
  1003. return PXR_EnterprisePlugin.UPxr_GetVolumeKeyStatus();
  1004. }
  1005. /// <summary>
  1006. /// Get the Back button's status.
  1007. /// </summary>
  1008. /// <returns>
  1009. /// * `0`: disabled
  1010. /// * `1`: enabled
  1011. /// </returns>
  1012. public static int GetBackKeyStatus()
  1013. {
  1014. return PXR_EnterprisePlugin.UPxr_GetBackKeyStatus();
  1015. }
  1016. /// <summary>
  1017. /// Gets the event settings for the Home button.
  1018. /// </summary>
  1019. /// <param name="homeEvent">The enumerations of event type:
  1020. /// * `SINGLE_CLICK`: single-click event
  1021. /// * `DOUBLE_CLICK`: double-click event
  1022. /// * `LONG_PRESS`: long-press event
  1023. /// </param>
  1024. /// <returns>
  1025. /// * For `SINGLE_CLICK` and `DOUBLE_CLICK`, the event(s) you set will be returned.
  1026. /// * For `LONG_PRESS`, the time and event you set will be returned. If you have not set a time for a long-press event, time will be `null`.
  1027. ///
  1028. /// * If you have not set any event for the event type you pass in the request, the response will return `null`.
  1029. /// * For event enumerations, see `PropertySetHomeKey` or `PropertySetHomeKeyAll`.
  1030. /// </returns>
  1031. public static string GetHomeKeyStatus(HomeEventEnum homeEvent)
  1032. {
  1033. return PXR_EnterprisePlugin.UPxr_PropertyGetHomeKeyStatus(homeEvent);
  1034. }
  1035. /// <summary>
  1036. /// Gets the status of a specified system function switch.
  1037. /// </summary>
  1038. /// <param name="systemFunction">The enumerations of system function switch:
  1039. /// * `SFS_USB`: USB debugging
  1040. /// * `SFS_AUTOSLEEP`: auto sleep
  1041. /// * `SFS_SCREENON_CHARGING`: screen-on charging
  1042. /// * `SFS_OTG_CHARGING`: OTG charging (supported by G2 devices)
  1043. /// * `SFS_RETURN_MENU_IN_2DMODE`: display the Return icon on the 2D screen
  1044. /// * `SFS_COMBINATION_KEY`: combination key
  1045. /// * `SFS_CALIBRATION_WITH_POWER_ON`: calibration with power on
  1046. /// * `SFS_SYSTEM_UPDATE`: system update (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1047. /// * `SFS_CAST_SERVICE`: phone casting service
  1048. /// * `SFS_EYE_PROTECTION`: eye-protection mode
  1049. /// * `SFS_SECURITY_ZONE_PERMANENTLY`: permanently disable the 6DoF play area (supported by PICO Neo2 devices)
  1050. /// * `SFS_GLOBAL_CALIBRATION`: global calibration (supported by PICO G2 devices)
  1051. /// * `SFS_Auto_Calibration`: auto calibration
  1052. /// * `SFS_USB_BOOT`: USB plug-in boot
  1053. /// * `SFS_VOLUME_UI`: global volume UI (need to restart the device to make the setting take effect)
  1054. /// * `SFS_CONTROLLER_UI`: global controller connected UI
  1055. /// * `SFS_NAVGATION_SWITCH`: navigation bar
  1056. /// * `SFS_SHORTCUT_SHOW_RECORD_UI`: screen recording button UI
  1057. /// * `SFS_SHORTCUT_SHOW_FIT_UI`: PICO fit UI
  1058. /// * `SFS_SHORTCUT_SHOW_CAST_UI`: screencast button UI
  1059. /// * `SFS_SHORTCUT_SHOW_CAPTURE_UI`: screenshot button UI
  1060. /// * `SFS_USB_FORCE_HOST`: set the Neo3 Pro/Pro Eye device as the host device
  1061. /// * `SFS_SET_DEFAULT_SAFETY_ZONE`: set a default play area for PICO Neo3 and PICO 4 series devices
  1062. /// * `SFS_ALLOW_RESET_BOUNDARY`: allow to reset customized boundary for PICO Neo3 series devices
  1063. /// * `SFS_BOUNDARY_CONFIRMATION_SCREEN`: whether to display the boundary confirmation screen for PICO Neo3 and PICO 4 series devices
  1064. /// * `SFS_LONG_PRESS_HOME_TO_RECENTER`: long press the Home button to recenter for PICO Neo3 and PICO 4 series devices
  1065. /// * `SFS_POWER_CTRL_WIFI_ENABLE`: stay connected to the network when the device sleeps/turns off (supported by PICO Neo3 Pro with system version 4.8.0 or later and PICO 4 Enterprise with system version OTA-5.2.8 or later)
  1066. /// * `SFS_WIFI_DISABLE`: disable Wi-Fi (supported by PICO Neo3 Pro with system version 4.8.0 or later and PICO 4 Enterprise with system version OTA-5.2.8 or later)
  1067. /// * `SFS_SIX_DOF_SWITCH`: 6DoF position tracking for PICO Neo3 and PICO 4 series devices
  1068. /// * `SFS_INVERSE_DISPERSION`: anti-dispersion (supported by PICO Neo3 Pro with system version 4.8.0 or later and PICO 4 Enterprise with system version OTA0-5.2.8 or later)
  1069. /// * `SFS_LOGCAT`: system log switch (/data/logs) (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1070. /// * `SFS_PSENSOR`: PSensor switch (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1071. /// * `SFS_SYSTEM_UPDATE_OTA`: OTA upgrade (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1072. /// * `SFS_SYSTEM_UPDATE_APP`: app upgrade and update (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1073. /// * `SFS_SHORTCUT_SHOW_WLAN_UI`: quickly set whether to show the WLAN button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1074. /// * `SFS_SHORTCUT_SHOW_BOUNDARY_UI`: quickly set whether to show the boundary button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1075. /// * `SFS_SHORTCUT_SHOW_BLUETOOTH_UI`: quickly set whether to show the bluetooth button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1076. /// * `SFS_SHORTCUT_SHOW_CLEAN_TASK_UI`: quickly set whether to show the one-click clear button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1077. /// * `SFS_SHORTCUT_SHOW_IPD_ADJUSTMENT_UI`: quickly set whether to show the IPD adjustment button (supported by PICO 4 Enterprise with system version 5.4.0 or later)
  1078. /// * `SFS_SHORTCUT_SHOW_POWER_UI`: quickly set whether to show the power button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1079. /// * `SFS_SHORTCUT_SHOW_EDIT_UI`: quickly set whether to show the edit button (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1080. /// * `SFS_BASIC_SETTING_APP_LIBRARY_UI`: the button for customizing the app library (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1081. /// * `SFS_BASIC_SETTING_SHORTCUT_UI`: the button for customizing quick settings (supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later)
  1082. /// * `SFS_LED_FLASHING_WHEN_SCREEN_OFF`: whether to keep the LED indicator light on when the device's screen is off and the battery is below 20% (supported by PICO G3 devices)
  1083. /// * `SFS_BASIC_SETTING_CUSTOMIZE_SETTING_UI`: customize settings item to show or hide in basic settings
  1084. /// * `SFS_BASIC_SETTING_SHOW_APP_QUIT_CONFIRM_DIALOG`: whether to show the app-quit dialog box when switching to a new app
  1085. /// * `SFS_BASIC_SETTING_KILL_BACKGROUND_VR_APP`: whether to kill background VR apps (`1`: kill, and this is the default setting; `2`: do not kill)
  1086. /// * `SFS_BASIC_SETTING_SHOW_CAST_NOTIFICATION`: whether to show a blue icon when casting the screen. The icon is displayed by default, and you can set the value to `0` to hide it.
  1087. /// * `SFS_AUTOMATIC_IPD`: auto IPD switch (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.7.0 or later)
  1088. /// * `SFS_QUICK_SEETHROUGH_MODE`: quick seethrough mode switch (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.7.0 or later)
  1089. /// * `SFS_HIGN_REFERSH_MODE`: high refresh mode switch (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.7.0 or later)
  1090. /// * `SFS_SEETHROUGH_APP_KEEP_RUNNING`: set whether to keep the app running under the seethrough mode (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.8.0 or later)
  1091. /// * `SFS_OUTDOOR_TRACKING_ENHANCEMENT`: enhance outdoor position tracking (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.8.0 or later)
  1092. /// * `SFS_AUTOIPD_AUTO_COMFIRM`: quick auto-IPD (supported by PICO 4 Enterprise with system version 5.8.0 or later)
  1093. /// * `SFS_LAUNCH_AUTOIPD_IF_GLASSES_WEARED`: set whether to launch auto-IPD after wearing the headset (supported by PICO 4 Enterprise with system version 5.8.0 or later)
  1094. /// * `SFS_GESTURE_RECOGNITION_HOME_ENABLE`: Home gesture switch (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.8.0 or later)
  1095. /// * `SFS_GESTURE_RECOGNITION_RESET_ENABLE`: enable/disable the Reset gesture (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.8.0 or later)
  1096. /// * `SFS_AUTO_COPY_FILES_FROM_USB_DEVICE`: automatically import OTG resources (supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.8.0 or later)
  1097. /// </param>
  1098. /// <param name="callback">The callback that returns the switch's status:
  1099. /// * `0`: off
  1100. /// * `1`: on
  1101. /// * `2`: not supported by device
  1102. /// For `SFS_SYSTEM_UPDATE`, the returns are as follows:
  1103. /// * `0`: off
  1104. /// * `1`: OTA upgrade on
  1105. /// * `2`: app upgrade on
  1106. /// * `3`: OTA and app upgrade on
  1107. /// </param>
  1108. public static void GetSwitchSystemFunctionStatus(SystemFunctionSwitchEnum systemFunction, Action<int> callback)
  1109. {
  1110. PXR_EnterprisePlugin.UPxr_GetSwitchSystemFunctionStatus(systemFunction, callback);
  1111. }
  1112. /// <summary>
  1113. /// Gets the configured USB mode.
  1114. /// </summary>
  1115. /// <returns>
  1116. /// * `MTP`: MTP mode
  1117. /// * `CHARGE`: charging mode
  1118. /// </returns>
  1119. public static string GetUsbConfigurationOption()
  1120. {
  1121. return PXR_EnterprisePlugin.UPxr_SwitchGetUsbConfigurationOption();
  1122. }
  1123. /// <summary>
  1124. /// Gets the current launcher.
  1125. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA0-5.2.8 or later).
  1126. /// </summary>
  1127. /// <returns>The package name or class name of the launcher.</returns>
  1128. public static string GetCurrentLauncher()
  1129. {
  1130. return PXR_EnterprisePlugin.UPxr_GetCurrentLauncher();
  1131. }
  1132. /// <summary>
  1133. /// Initializes the screencast service.
  1134. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA0-5.2.8 or later).
  1135. /// </summary>
  1136. /// <param name="callback">The callback:
  1137. /// * `0`: disconnect
  1138. /// * `1`: connect
  1139. /// * `2`: no microphone permission
  1140. /// </param>
  1141. /// <returns>
  1142. /// * `0`: failure
  1143. /// * `1`: success
  1144. /// Returns `0` when there is no microphone permission.
  1145. /// </returns>
  1146. public static int PICOCastInit(Action<int> callback)
  1147. {
  1148. return PXR_EnterprisePlugin.UPxr_PICOCastInit(callback);
  1149. }
  1150. /// <summary>
  1151. /// Sets whether to show the screencast authorization window.
  1152. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA0-5.2.8 or later).
  1153. /// </summary>
  1154. /// <param name="authZ">
  1155. /// * `0`: ask every time (default)
  1156. /// * `1`: always allow
  1157. /// * `2`: not accepted
  1158. /// </param>
  1159. /// <returns>
  1160. /// * `0`: failure
  1161. /// * `1`: success
  1162. /// </returns>
  1163. public static int PICOCastSetShowAuthorization(int authZ)
  1164. {
  1165. return PXR_EnterprisePlugin.UPxr_PICOCastSetShowAuthorization(authZ);
  1166. }
  1167. /// <summary>
  1168. /// Gets the setting of whether to show the screencast authorization window.
  1169. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA0-5.2.8 or later).
  1170. /// </summary>
  1171. /// <returns>
  1172. /// * `0`: ask every time (default)
  1173. /// * `1`: always allow
  1174. /// * `2`: not accepted
  1175. /// </returns>
  1176. public static int PICOCastGetShowAuthorization()
  1177. {
  1178. return PXR_EnterprisePlugin.UPxr_PICOCastGetShowAuthorization();
  1179. }
  1180. /// <summary>
  1181. /// Gets the URL for screencast.
  1182. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA0-5.2.8 or later).
  1183. /// </summary>
  1184. /// <param name="urlType">The enumerations of URL type:
  1185. /// * `NormalURL`: Normal URL. The screencast authorization window will show if it is not set.
  1186. /// * `NoConfirmURL`: Non-confirm URL. The screencast authorization window will not show in the browser. Screencast will start once you enter the URL.
  1187. /// * `RtmpURL`: Returns the RTMP live streaming URL. The screencast authorization window will not appear on the VR headset's screen.
  1188. /// </param>
  1189. /// <returns>The URL for screencast.</returns>
  1190. public static string PICOCastGetUrl(PICOCastUrlTypeEnum urlType)
  1191. {
  1192. return PXR_EnterprisePlugin.UPxr_PICOCastGetUrl(urlType);
  1193. }
  1194. /// <summary>
  1195. /// Stops screencast.
  1196. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA0-5.2.8 or later).
  1197. /// </summary>
  1198. /// <returns>
  1199. /// * `0`: failure
  1200. /// * `1`: success
  1201. /// </returns>
  1202. public static int PICOCastStopCast()
  1203. {
  1204. return PXR_EnterprisePlugin.UPxr_PICOCastStopCast();
  1205. }
  1206. /// <summary>
  1207. /// sets screencast options.
  1208. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA0-5.2.8 or later).
  1209. /// </summary>
  1210. /// <param name="castOptionOrStatus">The enumerations of the property to set:
  1211. /// * `OPTION_RESOLUTION_LEVEL`: resolution level
  1212. /// * `OPTION_BITRATE_LEVEL`: bitrate level
  1213. /// * `OPTION_AUDIO_ENABLE`: whether to enable the audio
  1214. /// </param>
  1215. /// <param name="castOptionValue">The values that can be set for each property:
  1216. /// * For `OPTION_RESOLUTION_LEVEL`:
  1217. /// * `OPTION_VALUE_RESOLUTION_HIGH`
  1218. /// * `OPTION_VALUE_RESOLUTION_MIDDLE`
  1219. /// * `OPTION_VALUE_RESOLUTION_AUTO`
  1220. /// * `OPTION_VALUE_RESOLUTION_HIGH_2K`
  1221. /// * `OPTION_VALUE_RESOLUTION_HIGH_4K`
  1222. /// * For `OPTION_BITRATE_LEVEL`:
  1223. /// * `OPTION_VALUE_BITRATE_HIGH`
  1224. /// * `OPTION_VALUE_BITRATE_MIDDLE`
  1225. /// * `OPTION_VALUE_BITRATE_LOW`
  1226. /// * For `OPTION_AUDIO_ENABLE`:
  1227. /// * `OPTION_VALUE_AUDIO_ON`
  1228. /// * `OPTION_VALUE_AUDIO_OFF`
  1229. /// </param>
  1230. /// <returns>
  1231. /// * `0`: failure
  1232. /// * `1`: success
  1233. /// </returns>
  1234. public static int PICOCastSetOption(PICOCastOptionOrStatusEnum castOptionOrStatus, PICOCastOptionValueEnum castOptionValue)
  1235. {
  1236. return PXR_EnterprisePlugin.UPxr_PICOCastSetOption(castOptionOrStatus, castOptionValue);
  1237. }
  1238. /// <summary>
  1239. /// Gets the screencast settings for the current device.
  1240. /// @note Supported by PICO Neo3 Pro (system version 4.8.0 or later) and PICO 4 Enterprise (system version OTA0-5.2.8 or later).
  1241. /// </summary>
  1242. /// <param name="castOptionOrStatus">The enumerations of the screencast property to get setting for:
  1243. /// * `OPTION_RESOLUTION_LEVEL`: resolution level
  1244. /// * `OPTION_BITRATE_LEVEL`: bitrate level
  1245. /// * `OPTION_AUDIO_ENABLE`: whether the audio is enabled
  1246. /// * `PICOCAST_STATUS`: returns the current screencast status
  1247. /// </param>
  1248. /// <returns>The setting of the selected property:
  1249. /// * For `OPTION_RESOLUTION_LEVEL`:
  1250. /// * `OPTION_VALUE_RESOLUTION_HIGH`
  1251. /// * `OPTION_VALUE_RESOLUTION_MIDDLE`
  1252. /// * `OPTION_VALUE_RESOLUTION_AUTO`
  1253. /// * `OPTION_VALUE_RESOLUTION_HIGH_2K`
  1254. /// * `OPTION_VALUE_RESOLUTION_HIGH_4K`
  1255. /// * For `OPTION_BITRATE_LEVEL`:
  1256. /// * `OPTION_VALUE_BITRATE_HIGH`
  1257. /// * `OPTION_VALUE_BITRATE_MIDDLE`
  1258. /// * `OPTION_VALUE_BITRATE_LOW`
  1259. /// * For `OPTION_AUDIO_ENABLE`:
  1260. /// * `OPTION_VALUE_AUDIO_ON`
  1261. /// * `OPTION_VALUE_AUDIO_OFF`
  1262. /// * `PICOCAST_STATUS` :
  1263. /// * `STATUS_VALUE_STATE_STARTED`
  1264. /// * `STATUS_VALUE_STATE_STOPPED`
  1265. /// * `STATUS_VALUE_ERROR`
  1266. /// </returns>
  1267. public static PICOCastOptionValueEnum PICOCastGetOptionOrStatus(PICOCastOptionOrStatusEnum castOptionOrStatus)
  1268. {
  1269. return PXR_EnterprisePlugin.UPxr_PICOCastGetOptionOrStatus(castOptionOrStatus);
  1270. }
  1271. /// <summary>Sets the system language for the device.
  1272. /// For a language that is spoken in different countries/regions, the system language is then co-set by the language code and the device's country/region code.
  1273. /// For example, if the language code is set to `en` and the device's country/region code is `US`, the system language will be set to English (United States).</summary>
  1274. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1275. ///
  1276. /// <param name="language">Supported language codes:
  1277. /// * `cs`: Czech
  1278. /// * `da`: Danish
  1279. /// * `de`: German
  1280. /// * `el`: Greek
  1281. /// * `en`: English (United States / United Kingdom)
  1282. /// * `es`: Spanish
  1283. /// * `fi`: Finnish
  1284. /// * `fr`: French
  1285. /// * `it`: Italian
  1286. /// * `ja`: Japanese
  1287. /// * `ko`: Korean
  1288. /// * `ms`: Malay
  1289. /// * `nb`: Norwegian
  1290. /// * `nl`: Dutch
  1291. /// * `pl`: Polish
  1292. /// * `pt`: Portuguese (Brazil / Portugal)
  1293. /// * `ro`: Romanian
  1294. /// * `ru`: Russian
  1295. /// * `sv`: Swedish
  1296. /// * `th`: Thai
  1297. /// * `tr`: Turkish
  1298. /// * `zh`: Chinese (Simplified) / Chinese (Hong Kong SAR of China) / Chinese (Traditional)
  1299. /// For devices in Mainland China / Taiwan, China / Hong Kong SAR of China / Macao SAR of China, the country/region code has been defined in factory settings.
  1300. /// </param>
  1301. /// <returns>
  1302. /// * `0`: success
  1303. /// * `1`: failure
  1304. /// * `22`: invalid language
  1305. /// </returns>
  1306. public static int SetSystemLanguage(String language)
  1307. {
  1308. return PXR_EnterprisePlugin.UPxr_SetSystemLanguage(language);
  1309. }
  1310. /// <summary>Gets the device's system language.</summary>
  1311. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1312. ///
  1313. /// <returns>The system language set for the device. For details, refer to the
  1314. /// parameter description for `SetSystemLanguage`.</returns>
  1315. public static String GetSystemLanguage()
  1316. {
  1317. return PXR_EnterprisePlugin.UPxr_GetSystemLanguage();
  1318. }
  1319. /// <summary>Sets a default Wi-Fi network for the device. Once set, the device will automatically connect to the Wi-Fi network if accessible.</summary>
  1320. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1321. ///
  1322. /// <param name="ssid">The SSID (name) of the Wi-Fi network.</param>
  1323. /// <param name="pwd">The password of the Wi-Fi network.</param>
  1324. /// <returns>
  1325. /// * `0`: success
  1326. /// * `1`: failure
  1327. /// </returns>
  1328. public static int ConfigWifi(String ssid, String pwd)
  1329. {
  1330. return PXR_EnterprisePlugin.UPxr_ConfigWifi(ssid, pwd);
  1331. }
  1332. /// <summary>Gets the device's default Wi-Fi network.</summary>
  1333. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1334. ///
  1335. /// <returns>The SSID (name) of the Wi-Fi network.</returns>
  1336. public static String[] GetConfiguredWifi()
  1337. {
  1338. return PXR_EnterprisePlugin.UPxr_GetConfiguredWifi();
  1339. }
  1340. /// <summary>Sets a country/region for the device.</summary>
  1341. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1342. ///
  1343. /// <param name="countryCode">The country/region code co-determines the device's system language with the language code you set via `SetSystemLanguage`.
  1344. /// Below are supported country/region codes:
  1345. /// * `AD`: Andorra
  1346. /// * `AT`: Austria
  1347. /// * `AU`: Australia
  1348. /// * `BE`: Belgium
  1349. /// * `BG`: Bulgaria
  1350. /// * `CA`: Canada
  1351. /// * `CH`: Switzerland
  1352. /// * `CZ`: Czech Republic
  1353. /// * `DE`: Germany
  1354. /// * `DK`: Denmark
  1355. /// * `EE`: Estonia
  1356. /// * `ES`: Spain
  1357. /// * `FI`: Finland
  1358. /// * `FR`: France
  1359. /// * `GB`: the Great Britain
  1360. /// * `GR`: Greece
  1361. /// * `HR`: Croatia
  1362. /// * `HU`: Hungary
  1363. /// * `IE`: Ireland
  1364. /// * `IL`: Israel
  1365. /// * `IS`: Iceland
  1366. /// * `IT`: Italy
  1367. /// * `JP`: Japan
  1368. /// * `KR`: Korea
  1369. /// * `LI`: Liechtenstein
  1370. /// * `LT`: Lithuania
  1371. /// * `LU`: Luxembourg
  1372. /// * `LV`: Latvia
  1373. /// * `MC`: Monaco
  1374. /// * `MT`: Malta
  1375. /// * `MY`: Malaysia
  1376. /// * `NL`: Netherlands
  1377. /// * `NO`: Norway
  1378. /// * `NZ`: New Zealand
  1379. /// * `PL`: Poland
  1380. /// * `PT`: Portugal
  1381. /// * `RO`: Romania
  1382. /// * `SE`: Sweden
  1383. /// * `SG`: Singapore
  1384. /// * `SI`: Slovenia
  1385. /// * `SK`: Slovakia
  1386. /// * `SM`: San Marino
  1387. /// * `TR`: Turkey
  1388. /// * `US`: the United States
  1389. /// * `VA`: Vatican
  1390. /// </param>
  1391. /// <param name="callback">Set the callback to get the result:
  1392. /// * `0`: success
  1393. /// * `1`: failure
  1394. /// </param>
  1395. public static int SetSystemCountryCode(String countryCode, Action<int> callback)
  1396. {
  1397. return PXR_EnterprisePlugin.UPxr_SetSystemCountryCode(countryCode, callback);
  1398. }
  1399. /// <summary>Gets the device's country/region code.</summary>
  1400. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1401. ///
  1402. /// <returns>A string value that indicates the device's current country/region code.
  1403. /// For supported country/region codes, see the parameter description in `SetSystemCountryCode`.</returns>
  1404. public static string GetSystemCountryCode()
  1405. {
  1406. return PXR_EnterprisePlugin.UPxr_GetSystemCountryCode();
  1407. }
  1408. /// <summary>Sets the page to skip in initialization settings.</summary>
  1409. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1410. ///
  1411. /// <param name="flag">Set the flag.
  1412. /// The first 6 bits are valid, the 7th to 32rd bits are reserved. For each bit, `0` indicates showing and `1` indicates hiding.
  1413. /// * `Constants#INIT_SETTING_HANDLE_CONNECTION_TEACHING`: the controller connection tutorial page
  1414. /// * `Constants#INIT_SETTING_TRIGGER_KEY_TEACHING`: the Trigger button tutorial page
  1415. /// * `Constants#INIT_SETTING_SELECT_LANGUAGE`: the language selection page
  1416. /// * `Constants#INIT_SETTING_SELECT_COUNTRY`: the country/region selection page. Only available for devices in non-Mainland China countries/regions.
  1417. /// * `Constants#INIT_SETTING_WIFI_SETTING`: the Wi-Fi settings page
  1418. /// * `Constants#INIT_SETTING_QUICK_SETTING`: the quick settings page
  1419. /// </param>
  1420. /// Below is an example implementation:
  1421. /// ```csharp
  1422. /// int flag = Constants.INIT_SETTING_HANDLE_CONNECTION_TEACHING | Constants.INIT_SETTING_TRIGGER_KEY_TEACHING;
  1423. /// int result = serviceBinder.pbsSetSkipInitSettingPage(flag,0);
  1424. /// ```
  1425. /// <returns>
  1426. /// * `0`: success
  1427. /// * `1`: failure
  1428. /// </returns>
  1429. public static int SetSkipInitSettingPage(int flag)
  1430. {
  1431. return PXR_EnterprisePlugin.UPxr_SetSkipInitSettingPage(flag);
  1432. }
  1433. /// <summary>Gets the page to skip in initialization settings.</summary>
  1434. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1435. ///
  1436. /// <returns>Returns the flag set in `SetSkipInitSettingPage`.</returns>
  1437. public static int GetSkipInitSettingPage()
  1438. {
  1439. return PXR_EnterprisePlugin.UPxr_GetSkipInitSettingPage();
  1440. }
  1441. /// <summary>Gets whether the initialization settings have been complete.</summary>
  1442. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1443. ///
  1444. /// <returns>
  1445. /// * `0`: not complete
  1446. /// * `1`: complete
  1447. /// </returns>
  1448. public static int IsInitSettingComplete()
  1449. {
  1450. return PXR_EnterprisePlugin.UPxr_IsInitSettingComplete();
  1451. }
  1452. /// <summary>Starts an activity in another app.</summary>
  1453. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1454. /// <param name="packageName">(Optional) The app's package name.</param>
  1455. /// <param name="className">(Optional) The app's class name.</param>
  1456. /// <param name="action">(Optional) The action to be performed.</param>
  1457. /// <param name="extra">The basic types of standard fields that can be used as extra data.</param>
  1458. /// <param name="categories">Standard categories that can be used to further clarify an Intent. Add a new category to the intent.</param>
  1459. /// <param name="flags">Add additional flags to the intent.</param>
  1460. /// <returns>
  1461. /// * `0`: success
  1462. /// * `1`: failure
  1463. /// </returns>
  1464. public static int StartActivity(String packageName, String className, String action, String extra, String[] categories, int[] flags)
  1465. {
  1466. return PXR_EnterprisePlugin.UPxr_StartActivity(packageName, className, action, extra, categories, flags);
  1467. }
  1468. /// <summary>Shows/hides specified app(s) in the library.
  1469. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1470. /// </summary>
  1471. /// <param name="packageNames">Package name(s). If there are multiple names, use commas (,) to separate them.</param>
  1472. /// <param name="switchEnum">Specifies to show/hide the app(s), enums:
  1473. /// * `S_ON`: show
  1474. /// * `S_OFF`: hide
  1475. /// </param>
  1476. /// <returns>
  1477. /// * `0`: success
  1478. /// * `1`: failure
  1479. /// </returns>
  1480. public static int CustomizeAppLibrary(String[] packageNames, SwitchEnum switchEnum)
  1481. {
  1482. return PXR_EnterprisePlugin.UPxr_CustomizeAppLibrary(packageNames, switchEnum);
  1483. }
  1484. /// <summary>
  1485. /// Gets the controller's battery level.
  1486. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1487. /// </summary>
  1488. /// <returns>Returns the following information:
  1489. /// * array[0]: the left controller's battery level
  1490. /// * array[1]: the right controller's battery level
  1491. /// * an integer from 1 to 5, which indicates the battery level, the bigger the integer, the higher the battery level
  1492. /// </returns>
  1493. public static int[] GetControllerBattery()
  1494. {
  1495. return PXR_EnterprisePlugin.UPxr_GetControllerBattery();
  1496. }
  1497. /// <summary>
  1498. /// Gets the controller's connection status.
  1499. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1500. /// </summary>
  1501. /// <returns>
  1502. /// * `0`: both controllers are disconnected
  1503. /// * `1`: the left controller is connected
  1504. /// * `2`: the right controller is connected
  1505. /// * `3`: both controllers are connected
  1506. /// </returns>
  1507. public static int GetControllerConnectState()
  1508. {
  1509. return PXR_EnterprisePlugin.UPxr_GetControllerConnectState();
  1510. }
  1511. /// <summary>
  1512. /// Gets the apps that are hidden in the library.
  1513. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.4.0 or later.
  1514. /// </summary>
  1515. /// <returns>The packages names of hidden apps. Multiple names are separated by commas (,).</returns>
  1516. public static string GetAppLibraryHideList()
  1517. {
  1518. return PXR_EnterprisePlugin.UPxr_GetAppLibraryHideList();
  1519. }
  1520. /// <summary>
  1521. /// Sets the device that outputs audio during screen casting.
  1522. /// @note
  1523. /// - Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.5.0 or later.
  1524. /// - This API is only for miracast.
  1525. /// </summary>
  1526. /// <param name="screencastAudioOutput">Specifies the device that outputs audio. Enumerations:
  1527. /// * `AUDIO_SINK`: the HMD
  1528. /// * `AUDIO_TARGET`: the receiver
  1529. /// * `AUDIO_SINK_TARGET`: both the HMD and the receiver
  1530. /// </param>
  1531. /// <returns>
  1532. /// * `0`: success
  1533. /// * `1`: failure
  1534. /// </returns>
  1535. public static int SetScreenCastAudioOutput(ScreencastAudioOutputEnum screencastAudioOutput)
  1536. {
  1537. return PXR_EnterprisePlugin.UPxr_SetScreenCastAudioOutput(screencastAudioOutput);
  1538. }
  1539. /// <summary>
  1540. /// Gets the device that outputs audio during screen casting.
  1541. /// @note
  1542. /// - Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.5.0 or later.
  1543. /// - This API is only for miracast.
  1544. /// </summary>
  1545. /// <returns>
  1546. /// Enumerations:
  1547. /// * `AUDIO_SINK`: the HMD
  1548. /// * `AUDIO_TARGET`: the receiver
  1549. /// * `AUDIO_SINK_TARGET`: both the HMD and the receiver
  1550. /// </returns>
  1551. public static ScreencastAudioOutputEnum GetScreenCastAudioOutput()
  1552. {
  1553. return PXR_EnterprisePlugin.UPxr_GetScreenCastAudioOutput();
  1554. }
  1555. /// <summary>
  1556. /// Displays or hides the specified tab or option on the Settings pane.
  1557. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.5.0 or later.
  1558. /// </summary>
  1559. /// <param name="customizeSettingsTabEnum">Specifies the tab or option to display or hide. Enumerations:
  1560. /// * `CUSTOMIZE_SETTINGS_TAB_WLAN`: the "WLAN" tab
  1561. /// * `CUSTOMIZE_SETTINGS_TAB_CONTROLLER`: the "Controller" tab
  1562. /// * `CUSTOMIZE_SETTINGS_TAB_BLUETOOTH`: the "Bluetooth" tab
  1563. /// * `CUSTOMIZE_SETTINGS_TAB_DISPLAY`: the "Display" tab
  1564. /// * `CUSTOMIZE_SETTINGS_TAB_LAB`: the "LAB" tab
  1565. /// * `CUSTOMIZE_SETTINGS_TAB_GENERAL_FACTORY_RESET`: the "Factory Reset" option on the "General" tab
  1566. /// * `CUSTOMIZE_SETTINGS_TAB_GENERAL_LOCKSCREEN`: the "Lock Screen" option on the "General" tab
  1567. /// </param>
  1568. /// <param name="switchEnum">Sets to display or hide the specified tab or option:
  1569. /// * `S_ON`: display
  1570. /// * `S_OFF`: hide
  1571. /// </param>
  1572. /// <returns>
  1573. /// * `0`: success
  1574. /// * `1`: failure
  1575. /// </returns>
  1576. public static int UPxr_CustomizeSettingsTabStatus(CustomizeSettingsTabEnum customizeSettingsTabEnum, SwitchEnum switchEnum)
  1577. {
  1578. return PXR_EnterprisePlugin.UPxr_CustomizeSettingsTabStatus(customizeSettingsTabEnum, switchEnum);
  1579. }
  1580. /// <summary>
  1581. /// Gets the status set for the specified tab or option on the Settings pane.
  1582. /// @note Supported by PICO Neo3 Pro and PICO 4 Enterprise with system version 5.5.0 or later.
  1583. /// </summary>
  1584. /// <param name="customizeSettingsTabEnum">Specifies the tab or option to get status for. Enumerations:
  1585. /// * `CUSTOMIZE_SETTINGS_TAB_WLAN`: the "WLAN" tab
  1586. /// * `CUSTOMIZE_SETTINGS_TAB_CONTROLLER`: the "Controller" tab
  1587. /// * `CUSTOMIZE_SETTINGS_TAB_BLUETOOTH`: the "Bluetooth" tab
  1588. /// * `CUSTOMIZE_SETTINGS_TAB_DISPLAY`: the "Display" tab
  1589. /// * `CUSTOMIZE_SETTINGS_TAB_LAB`: the "LAB" tab
  1590. /// * `CUSTOMIZE_SETTINGS_TAB_GENERAL_FACTORY_RESET`: the "Factory Reset" option on the "General" tab
  1591. /// * `CUSTOMIZE_SETTINGS_TAB_GENERAL_LOCKSCREEN`: the "Lock Screen" option on the "General" tab
  1592. /// </param>
  1593. /// <returns>
  1594. /// The status of the specified tab or option:
  1595. /// * `S_ON`: displayed
  1596. /// * `S_OFF`: hidden
  1597. /// </returns>
  1598. public static SwitchEnum UPxr_GetCustomizeSettingsTabStatus(CustomizeSettingsTabEnum customizeSettingsTabEnum)
  1599. {
  1600. return PXR_EnterprisePlugin.UPxr_GetCustomizeSettingsTabStatus(customizeSettingsTabEnum);
  1601. }
  1602. /// <summary>
  1603. /// Shuts down the PICO device when the USB plug is unplugged or the plug runs out of power.
  1604. /// </summary>
  1605. /// <param name="switchEnum">Determines whether to enable/disable this function:
  1606. /// * `S_ON`: enable
  1607. /// * `S_OFF`: disable
  1608. /// </param>
  1609. public static void SetPowerOffWithUSBCable(SwitchEnum switchEnum)
  1610. {
  1611. PXR_EnterprisePlugin.UPxr_SetPowerOffWithUSBCable(switchEnum);
  1612. }
  1613. /// <summary>
  1614. /// Removes a specific Home key event setting, which restores the event to its default setting.
  1615. /// </summary>
  1616. /// <param name="switchEnum">Specify a Home key event from the following:
  1617. /// `PBS_HomeEventEnum. SINGLE_CLICK`: single-click event
  1618. /// `PBS_HomeEventEnum. DOUBLE_CLICK`: double-click event
  1619. /// `PBS_HomeEventEnum. LONG_PRESS`: long press event
  1620. /// `PBS_HomeEventEnum. SINGLE_CLICK_RIGHT_CTL`: single-click on the right controller's Home button
  1621. /// `PBS_HomeEventEnum. DOUBLE_CLICK_RIGHT_CTL`: double-click on the right controller's Home button
  1622. /// `PBS_HomeEventEnum. LONG_PRESS_RIGHT_CTL`: long press on the right controller's Home button
  1623. /// `PBS_HomeEventEnum. SINGLE_CLICK_LEFT_CTL`: single-click on the left controller's Home button
  1624. /// `PBS_HomeEventEnum. DOUBLE_CLICK_LEFT_CTL`: double-click on the left controller's Home button
  1625. /// `PBS_HomeEventEnum. LONG_PRESS_LEFT_CTL`: long press on the left controller's Home button
  1626. /// `PBS_HomeEventEnum. SINGLE_CLICK_HMD`: single-click on the HMD's Home button
  1627. /// `PBS_HomeEventEnum. DOUBLE_CLICK_HMD`: double-click on the HMD's Home button
  1628. /// `PBS_HomeEventEnum. LONG_PRESS_HMD`: long press on the HMD's Home button
  1629. /// </param>
  1630. public static void RemoveControllerHomeKey(HomeEventEnum EventEnum)
  1631. {
  1632. PXR_EnterprisePlugin.UPxr_RemoveControllerHomeKey(EventEnum);
  1633. }
  1634. /// <summary>
  1635. /// Sets the power on logo or the power on/off animation.
  1636. /// </summary>
  1637. /// <param name="powerOnOffLogoEnum">Specify a setting from the following:
  1638. /// * `PBS_PowerOnOffLogoEnum. PLPowerOnLogo`: sets a logo for the first frame after powering on the device
  1639. /// * `PBS_PowerOnOffLogoEnum. PLPowerOnAnimation`: sets the power on animation
  1640. /// * `PBS_PowerOnOffLogoEnum. PLPowerOffAnimation`: sets the power off animation
  1641. /// </param>
  1642. /// <param name="path">
  1643. /// * For setting a logo for the first frame after powering on the device, pass the path where the .img file is stored, for example, `/sdcard/bootlogo.img`.
  1644. /// * For setting the power on/off animation, pass the folder where the pictures composing the animation is stored.
  1645. /// </param>
  1646. /// <param name="callback">Result callback:
  1647. /// * `true`: success
  1648. /// * `false`: failure
  1649. /// </param>
  1650. public static void SetPowerOnOffLogo(PowerOnOffLogoEnum powerOnOffLogoEnum, String path, Action<bool> callback)
  1651. {
  1652. PXR_EnterprisePlugin.UPxr_SetPowerOnOffLogo(powerOnOffLogoEnum,path,callback);
  1653. }
  1654. /// <summary>
  1655. /// Sets an interpupillary distance (IPD).
  1656. /// @note Supported by PICO 4 Enterprise with system version 5.7.0 or later.
  1657. /// </summary>
  1658. /// <param name="ipd">
  1659. /// The IPD to set. Valid value range: [62,72]. Unit: millimeters.
  1660. /// </param>
  1661. /// <param name="callback">Result callback:
  1662. /// * `0`: success
  1663. /// * `1`: failure
  1664. /// * `23`: the `ipd` value is out of the valid range
  1665. /// </param>
  1666. public static void SetIPD(float ipd, Action<int> callback)
  1667. {
  1668. PXR_EnterprisePlugin.UPxr_SetIPD(ipd,callback);
  1669. }
  1670. /// <summary>
  1671. /// Gets the device configured for miracast.
  1672. /// </summary>
  1673. /// <returns>
  1674. /// The name of the device.
  1675. /// </returns>
  1676. public static string GetAutoMiracastConfig()
  1677. {
  1678. return PXR_EnterprisePlugin.UPxr_GetAutoMiracastConfig();
  1679. }
  1680. /// <summary>
  1681. /// Sets screencast-related parameters.
  1682. /// @note Supported by PICO Neo3 series and PICO 4 Enterprise with system version 5.7.0 or later.
  1683. /// </summary>
  1684. /// <param name="mediaFormat">
  1685. /// The mediaFormat object to set. Currently, only support settings the bitrate.
  1686. /// </param>
  1687. /// <returns>
  1688. /// * `0`: success
  1689. /// * `1`: failure
  1690. /// </returns>
  1691. public static int SetPicoCastMediaFormat(PicoCastMediaFormat mediaFormat)
  1692. {
  1693. return PXR_EnterprisePlugin.UPxr_SetPicoCastMediaFormat(mediaFormat);
  1694. }
  1695. /// <summary>
  1696. /// Gets the pose and ID of the marker.
  1697. /// @note Supported by 6Dof devices.
  1698. /// </summary>
  1699. /// <param name="trackingMode">Specify a tracking origin mode from the following:
  1700. /// * `TrackingOriginModeFlags.Device`: Device mode. The system sets the device's initial position as the origin. The device's height from the floor is not calculated.
  1701. /// * `TrackingOriginModeFlags.Floor`: Floor mode. The system sets an origin based on the device's original position and the device's height from the floor.
  1702. /// @note The PICO Unity OpenXR SDK only supports the `TrackingOriginModeFlags.Device` mode.
  1703. /// </param>
  1704. /// <param name="cameraYOffset">
  1705. /// Set the offset added to the camera's Y direction, which is for simulating a user's height and is only applicable if you select the 'Device' mode.
  1706. /// </param>
  1707. /// <param name="markerInfos">
  1708. /// The callback function for returning marker information.
  1709. /// </param>
  1710. /// <returns>
  1711. /// * `0`: success
  1712. /// * `1`: failure
  1713. /// </returns>
  1714. public static int SetMarkerInfoCallback(TrackingOriginModeFlags trackingMode,float cameraYOffset,Action<List<MarkerInfo>> markerInfos)
  1715. {
  1716. return PXR_EnterprisePlugin.UPxr_setMarkerInfoCallback(trackingMode,cameraYOffset,markerInfos);
  1717. }
  1718. /// <summary>
  1719. /// Open RGB camera.
  1720. /// @note The PICO Unity OpenXR SDK does not support this API.
  1721. /// </summary>
  1722. /// <returns>Whether the RGB camera has been opened:
  1723. /// * `true`: success
  1724. /// * `false`: failure
  1725. /// </returns>
  1726. public static bool OpenVSTCamera()
  1727. {
  1728. return PXR_EnterprisePlugin.UPxr_OpenVSTCamera();
  1729. }
  1730. /// <summary>
  1731. /// Close RGB camera.
  1732. /// @note The PICO Unity OpenXR SDK does not support this API.
  1733. /// </summary>
  1734. /// <returns>Whether the RGB camera has been closed:
  1735. /// * `true`: success
  1736. /// * `false`: failure
  1737. /// </returns>
  1738. public static bool CloseVSTCamera()
  1739. {
  1740. return PXR_EnterprisePlugin.UPxr_CloseVSTCamera();
  1741. }
  1742. /// <summary>
  1743. /// Get camera parameters(including intrinsics & extrinsics).
  1744. /// @note The PICO Unity OpenXR SDK does not support this API.
  1745. /// </summary>
  1746. /// <returns> RGBCameraParams including intrinsics and extrinsics.
  1747. /// </returns>
  1748. public static RGBCameraParams GetCameraParameters()
  1749. {
  1750. return PXR_EnterprisePlugin.UPxr_GetCameraParameters();
  1751. }
  1752. /// <summary>
  1753. /// Get current head tracking confidence.
  1754. /// @note The PICO Unity OpenXR SDK does not support this API.
  1755. /// </summary>
  1756. /// <returns>
  1757. /// * `0`: bad
  1758. /// * `1`: good
  1759. /// </returns>
  1760. public static int GetHeadTrackingConfidence()
  1761. {
  1762. return PXR_EnterprisePlugin.UPxr_GetHeadTrackingConfidence();
  1763. }
  1764. /// <summary>
  1765. /// Acquire RGB camera frame,distortion
  1766. /// @note The PICO Unity OpenXR SDK does not support this API.
  1767. /// </summary>
  1768. /// <param name="frame">[out]frame frame info</param>
  1769. /// <returns>
  1770. /// * `0`: success
  1771. /// * other: failure
  1772. /// </returns>
  1773. public static int AcquireVSTCameraFrame(out Frame frame)
  1774. {
  1775. return PXR_EnterprisePlugin.UPxr_AcquireVSTCameraFrame(out frame);
  1776. }
  1777. /// <summary>
  1778. /// Acquire RGB camera frame,anti-distortion
  1779. /// @note The PICO Unity OpenXR SDK does not support this API.
  1780. /// </summary>
  1781. /// <param name="width">[in]width desired frame width,should be less equal than 2328</param>
  1782. /// <param name="height">[in]height desired frame height, should be less equal than 1748</param>
  1783. /// <param name="frame">[out]frame frame info</param>
  1784. /// <returns>
  1785. /// * `0`: success
  1786. /// * other: failure
  1787. /// </returns>
  1788. public static int AcquireVSTCameraFrameAntiDistortion(int width, int height, out Frame frame)
  1789. {
  1790. return PXR_EnterprisePlugin.UPxr_AcquireVSTCameraFrameAntiDistortion(width, height, out frame);
  1791. }
  1792. /// <summary>
  1793. /// Gets the predicted display time.
  1794. /// @note The PICO Unity OpenXR SDK does not support this API.
  1795. /// <returns>The predicted display time.</returns>
  1796. public static double GetPredictedDisplayTime()
  1797. {
  1798. return PXR_EnterprisePlugin.UPxr_GetPredictedDisplayTime();
  1799. }
  1800. /// <summary>
  1801. /// Gets the predicted status of the sensor.
  1802. /// @note The PICO Unity OpenXR SDK does not support this API.
  1803. /// </summary>
  1804. /// <param name="predictTime">predict time.</param>
  1805. /// <returns>The predicted status of the sensor.</returns>
  1806. public static SensorState GetPredictedMainSensorState(double predictTime)
  1807. {
  1808. return PXR_EnterprisePlugin.UPxr_GetPredictedMainSensorState(predictTime);
  1809. }
  1810. /// <summary>
  1811. /// Directs the user to the floor-height-adjustment app to adjust the floor's height.
  1812. /// @note Supported by PICO Neo3 Pro, general PICO Neo3 devices activated as enterprise devices, and PICO 4 Enterprise.
  1813. /// </summary>
  1814. /// <returns>
  1815. /// * `0`: success
  1816. /// * `1`: failure
  1817. /// </returns>
  1818. public static int GotoSeeThroughFloorSetting()
  1819. {
  1820. return PXR_EnterprisePlugin.UPxr_gotoSeeThroughFloorSetting();
  1821. }
  1822. /// <summary>
  1823. /// Copies a file or a folder from the source path to the destination path.
  1824. /// @note Supported by PICO Neo3 Pro, general PICO Neo3 devices activated as enterprise devices, and PICO 4 Enterprise.
  1825. /// </summary>
  1826. /// <param name="srcPath">
  1827. /// The source path of the file or folder.
  1828. /// * For mobile storage devices, the prefix of the path is 'udisk://'. For example, the path of the Movie folder under the root directory should be passed as 'udisk://Movie'.
  1829. /// * For internal storage paths, directly specify the path under the root directory. For example, the path of the Picture folder under the root directory should be passed as 'Picture'.
  1830. /// </param>
  1831. /// <param name="dstPath">
  1832. /// The destination path that the file or folder is copied to.
  1833. /// * For mobile storage devices, the prefix of the path is 'udisk://'. For example, the path of the Movie folder under the root directory should be passed as 'udisk://Movie'.
  1834. /// * For internal storage paths, directly write the path under the root directory. For example, the path of the Picture folder under the root directory should be passed as 'Picture'.
  1835. /// </param>
  1836. /// <param name="callback">The result callback:
  1837. /// * `onCopyStart`: copy start callback
  1838. /// * `onCopyProgress(double process)`: copy progress callback, value range:[0.00, 1.00]
  1839. /// * `onCopyFinish(int errorCode)`: `0` (copy succeeded); `101` (USB flash disk is not connected); `103` (insufficient storage space in the target device); `104` (copy failed)
  1840. /// </param>
  1841. /// <returns>
  1842. /// * `0`: API call succeeded, wait for copy to start
  1843. /// * `101`: USB flash drive is not connected
  1844. /// * `102`: source file/folder does not exist
  1845. /// * `106`: null parameter
  1846. /// </returns>
  1847. public static int FileCopy(String srcPath, String dstPath, FileCopyCallback callback)
  1848. {
  1849. return PXR_EnterprisePlugin.UPxr_fileCopy(srcPath, dstPath, callback);
  1850. }
  1851. /// <summary>
  1852. /// Checks whether a map is being used.
  1853. /// @note Supported by PICO Neo3 Pro, general PICO Neo3 devices activated as enterprise devices, and PICO 4 Enterprise.
  1854. /// </summary>
  1855. /// <param name="path">The path of the map's zip file.</param>
  1856. /// <param name="callback">The result callback:
  1857. /// * `0`: success
  1858. /// * `1`: failure
  1859. /// * `101`: file does not exist
  1860. /// * `102`: failed to unzip the file
  1861. /// * `103`: file corruption
  1862. /// * `104`: position tracking is disabled
  1863. /// * `106`: failed to get the current map's information
  1864. /// * `107`: `path` parameter is null
  1865. /// </param>
  1866. public static void IsMapInEffect(String path, Action<int> callback)
  1867. {
  1868. PXR_EnterprisePlugin.UPxr_IsMapInEffect(path, callback);
  1869. }
  1870. /// <summary>
  1871. /// Imports a map.
  1872. /// @note Supported by PICO Neo3 Pro, general PICO Neo3 devices activated as enterprise devices, and PICO 4 Enterprise.
  1873. /// </summary>
  1874. /// <param name="path">The path of the map's zip file.</param>
  1875. /// <param name="callback">The result callback:
  1876. /// * `0`: success
  1877. /// * `1`: failure
  1878. /// * `101`: file does not exist
  1879. /// * `102`: failed to unzip the file
  1880. /// * `103`: file corruption
  1881. /// * `104`: position tracking is disabled
  1882. /// * `107`: `path` parameter is null
  1883. /// </param>
  1884. public static void ImportMapByPath(String path, Action<int> callback)
  1885. {
  1886. PXR_EnterprisePlugin.UPxr_ImportMapByPath(path, callback);
  1887. }
  1888. }
  1889. }