PXR_Enterprise.cs 102 KB

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