MT_SYS.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. /***************************************************************************************************
  2. Filename: MT.c
  3. Revised: $Date: 2009-03-12 16:25:22 -0700 (Thu, 12 Mar 2009) $
  4. Revision: $Revision: 19404 $
  5. Description: MonitorTest
  6. Copyright 2007 Texas Instruments Incorporated. All rights reserved.
  7. IMPORTANT: Your use of this Software is limited to those specific rights
  8. granted under the terms of a software license agreement between the user
  9. who downloaded the software, his/her employer (which must be your employer)
  10. and Texas Instruments Incorporated (the "License"). You may not use this
  11. Software unless you agree to abide by the terms of the License. The License
  12. limits your use, and you acknowledge, that the Software may not be modified,
  13. copied or distributed unless embedded on a Texas Instruments microcontroller
  14. or used solely and exclusively in conjunction with a Texas Instruments radio
  15. frequency transceiver, which is integrated into your product. Other than for
  16. the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  17. works of, modify, distribute, perform, display or sell this Software and/or
  18. its documentation for any purpose.
  19. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  20. PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  21. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  22. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  23. TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  24. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  25. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  26. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  27. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  28. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  29. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  30. Should you have any questions regarding your right to use this Software,
  31. contact Texas Instruments Incorporated at www.TI.com.
  32. ***************************************************************************************************/
  33. /***************************************************************************************************
  34. * INCLUDES
  35. ***************************************************************************************************/
  36. #include "ZComDef.h"
  37. #include "MT.h"
  38. #include "MT_SYS.h"
  39. #include "MT_VERSION.h"
  40. #include "nwk_util.h"
  41. #include "OSAL_NV.h"
  42. #include "Onboard.h" /* This is here because RAM read/write macros need it */
  43. #include "hal_adc.h"
  44. #include "ZGlobals.h"
  45. #include "Osal_Memory.h"
  46. #include "OSAL.h"
  47. /***************************************************************************************************
  48. * MACROS
  49. ***************************************************************************************************/
  50. #define MT_SYS_DEVICE_INFO_RESPONSE_LEN 14
  51. #define MT_NV_ITEM_MAX_LENGTH 250
  52. /***************************************************************************************************
  53. * CONSTANT
  54. ***************************************************************************************************/
  55. const uint16 MT_SysOsalEventId [] = {
  56. MT_SYS_OSAL_EVENT_0,
  57. MT_SYS_OSAL_EVENT_1,
  58. MT_SYS_OSAL_EVENT_2,
  59. MT_SYS_OSAL_EVENT_3
  60. };
  61. typedef enum {
  62. GPIO_DIR,
  63. GPIO_TRI,
  64. GPIO_SET,
  65. GPIO_CLR,
  66. GPIO_TOG,
  67. GPIO_GET,
  68. GPIO_HiD = 0x12
  69. } GPIO_Op_t;
  70. #define GPIO_MASK 0x33
  71. /***************************************************************************************************
  72. * EXTERNAL FUNCTIONS
  73. ***************************************************************************************************/
  74. extern uint16 HalAdcReadVoltage(void);
  75. extern uint16 HalAdcReadTemperature(void);
  76. /***************************************************************************************************
  77. * LOCAL FUNCTIONS
  78. ***************************************************************************************************/
  79. #if defined (MT_SYS_FUNC)
  80. void MT_SysReset(uint8 *pBuf);
  81. void MT_SysPing(void);
  82. void MT_SysVersion(void);
  83. void MT_SysSetExtAddr(uint8 *pBuf);
  84. void MT_SysGetExtAddr(void);
  85. void MT_SysOsalNVWrite(uint8 *pBuf);
  86. void MT_SysOsalNVRead(uint8 *pBuf);
  87. void MT_SysOsalStartTimer(uint8 *pBuf);
  88. void MT_SysOsalStopTimer(uint8 *pBuf);
  89. void MT_SysRandom(void);
  90. void MT_SysAdcRead(uint8 *pBuf);
  91. void MT_SysGpio(uint8 *pBuf);
  92. void MT_SysGetDeviceInfo(uint8 *pBuf);
  93. #endif /* MT_SYS_FUNC */
  94. #if defined (MT_SYS_FUNC)
  95. /***************************************************************************************************
  96. * @fn MT_SysProcessing
  97. *
  98. * @brief Process all the SYS commands that are issued by test tool
  99. *
  100. * @param pBuf - pointer to the msg buffer
  101. *
  102. * | LEN | CMD0 | CMD1 | DATA |
  103. * | 1 | 1 | 1 | 0-255 |
  104. *
  105. * @return status
  106. ***************************************************************************************************/
  107. uint8 MT_SysCommandProcessing(uint8 *pBuf)
  108. {
  109. uint8 status = MT_RPC_SUCCESS;
  110. switch (pBuf[MT_RPC_POS_CMD1])
  111. {
  112. case MT_SYS_RESET_REQ:
  113. MT_SysReset(pBuf);
  114. break;
  115. case MT_SYS_PING:
  116. MT_SysPing();
  117. break;
  118. case MT_SYS_VERSION:
  119. MT_SysVersion();
  120. break;
  121. case MT_SYS_SET_EXTADDR:
  122. MT_SysSetExtAddr(pBuf);
  123. break;
  124. case MT_SYS_GET_EXTADDR:
  125. MT_SysGetExtAddr();
  126. break;
  127. case MT_SYS_OSAL_NV_READ:
  128. MT_SysOsalNVRead(pBuf);
  129. break;
  130. case MT_SYS_OSAL_NV_WRITE:
  131. MT_SysOsalNVWrite(pBuf);
  132. break;
  133. case MT_SYS_OSAL_START_TIMER:
  134. MT_SysOsalStartTimer(pBuf);
  135. break;
  136. case MT_SYS_OSAL_STOP_TIMER:
  137. MT_SysOsalStopTimer(pBuf);
  138. break;
  139. case MT_SYS_RANDOM:
  140. MT_SysRandom();
  141. break;
  142. case MT_SYS_ADC_READ:
  143. MT_SysAdcRead(pBuf);
  144. break;
  145. case MT_SYS_GPIO:
  146. MT_SysGpio(pBuf);
  147. break;
  148. case MT_SYS_RESET_IND:
  149. //TBD
  150. break;
  151. default:
  152. status = MT_RPC_ERR_COMMAND_ID;
  153. break;
  154. }
  155. return status;
  156. }
  157. /***************************************************************************************************
  158. * @fn MT_SysReset
  159. *
  160. * @brief Reset/reprogram the device.
  161. * @param typID: 0=reset, 1=serial bootloader
  162. *
  163. * @return None
  164. ***************************************************************************************************/
  165. void MT_SysReset(uint8 *pBuf)
  166. {
  167. (void)pBuf; // Intentionally unreferenced parameter
  168. SystemReset(); /* Restart this program */
  169. }
  170. /***************************************************************************************************
  171. * @fn MT_SysPing
  172. *
  173. * @brief Process the Ping command
  174. *
  175. * @param None
  176. *
  177. * @return None
  178. ***************************************************************************************************/
  179. void MT_SysPing(void)
  180. {
  181. uint16 tmp16;
  182. uint8 retArray[2];
  183. /* Build Capabilities */
  184. tmp16 = MT_CAP_SYS | MT_CAP_MAC | MT_CAP_NWK | MT_CAP_AF | MT_CAP_ZDO|
  185. MT_CAP_SAPI | MT_CAP_UTIL | MT_CAP_DEBUG | MT_CAP_APP | MT_CAP_ZOAD;
  186. /* Convert to high byte first into temp buffer */
  187. retArray[0] = LO_UINT16( tmp16 );
  188. retArray[1] = HI_UINT16( tmp16 );
  189. /* Build and send back the response */
  190. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), MT_SYS_PING,
  191. sizeof (tmp16), retArray );
  192. }
  193. /***************************************************************************************************
  194. * @fn MT_SysVersion
  195. *
  196. * @brief Process the Version command
  197. *
  198. * @param None
  199. *
  200. * @return None
  201. ***************************************************************************************************/
  202. void MT_SysVersion(void)
  203. {
  204. byte *verStr = (byte *)MTVersionString;
  205. uint8 respLen = sizeof(MTVersionString);
  206. /* Build and send back the response */
  207. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), MT_SYS_VERSION,
  208. respLen, verStr);
  209. }
  210. /***************************************************************************************************
  211. * @fn MT_SysSetExtAddr
  212. *
  213. * @brief Set the Extended Address
  214. *
  215. * @param pBuf
  216. *
  217. * @return None
  218. ***************************************************************************************************/
  219. void MT_SysSetExtAddr(uint8 *pBuf)
  220. {
  221. uint8 retValue = ZFailure;
  222. uint8 cmdId;
  223. /* parse header */
  224. cmdId = pBuf[MT_RPC_POS_CMD1];
  225. pBuf += MT_RPC_FRAME_HDR_SZ;
  226. if ( ZMacSetReq(ZMacExtAddr, pBuf) == ZMacSuccess )
  227. {
  228. retValue = osal_nv_write(ZCD_NV_EXTADDR, 0, Z_EXTADDR_LEN, pBuf);
  229. }
  230. /* Build and send back the response */
  231. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), cmdId, 1, &retValue);
  232. }
  233. /***************************************************************************************************
  234. * @fn MT_SysVersion
  235. *
  236. * @brief Process the Version command
  237. *
  238. * @param None
  239. *
  240. * @return None
  241. ***************************************************************************************************/
  242. void MT_SysGetExtAddr(void)
  243. {
  244. uint8 extAddr[Z_EXTADDR_LEN];
  245. ZMacGetReq( ZMacExtAddr, extAddr );
  246. /* Build and send back the response */
  247. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), MT_SYS_GET_EXTADDR,
  248. Z_EXTADDR_LEN, extAddr);
  249. }
  250. /***************************************************************************************************
  251. * @fn MT_SysOsalNVRead
  252. *
  253. * @brief Read a NV value
  254. *
  255. * @param uint8 pBuf - pointer to the data
  256. *
  257. * @return None
  258. ***************************************************************************************************/
  259. void MT_SysOsalNVRead(uint8 *pBuf)
  260. {
  261. uint16 nvId;
  262. uint8 nvItemLen=0, nvItemOffset=0;
  263. uint8 *pRetBuf=NULL;
  264. uint8 respLen, cmdId;
  265. /* parse header */
  266. cmdId = pBuf[MT_RPC_POS_CMD1];
  267. pBuf += MT_RPC_FRAME_HDR_SZ;
  268. /* Get the ID */
  269. nvId = BUILD_UINT16(pBuf[0], pBuf[1]);
  270. pBuf += sizeof(uint16);
  271. /* Calculate the offset */
  272. nvItemOffset = *pBuf;
  273. nvItemLen = osal_nv_item_len(nvId);
  274. /* Return only 250 bytes max */
  275. if (nvItemLen > MT_NV_ITEM_MAX_LENGTH)
  276. {
  277. nvItemLen = MT_NV_ITEM_MAX_LENGTH;
  278. }
  279. if ((nvItemLen > 0) && ((nvItemLen - nvItemOffset) > 0))
  280. {
  281. respLen = nvItemLen - nvItemOffset + 2;
  282. }
  283. else
  284. {
  285. respLen = 2;
  286. }
  287. pRetBuf = osal_mem_alloc(respLen);
  288. if (pRetBuf != NULL)
  289. {
  290. osal_memset(pRetBuf, 0, respLen);
  291. /* Default to ZFailure */
  292. pRetBuf[0] = ZFailure;
  293. if (respLen > 2)
  294. {
  295. if (((osal_nv_read( nvId, (uint16)nvItemOffset, (uint16)nvItemLen, &pRetBuf[2])) == ZSUCCESS) && (respLen > 2))
  296. {
  297. pRetBuf[0] = ZSuccess;
  298. }
  299. pRetBuf[1] = nvItemLen - nvItemOffset;
  300. }
  301. else
  302. {
  303. pRetBuf[1] = 0;
  304. }
  305. /* Build and send back the response */
  306. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), cmdId, respLen, pRetBuf );
  307. osal_mem_free(pRetBuf);
  308. }
  309. }
  310. /***************************************************************************************************
  311. * @fn MT_SysOsalNVWrite
  312. *
  313. * @brief
  314. *
  315. * @param uint8 pData - pointer to the data
  316. *
  317. * @return None
  318. ***************************************************************************************************/
  319. void MT_SysOsalNVWrite(uint8 *pBuf)
  320. {
  321. uint16 nvId;
  322. uint8 nvItemLen=0, nvItemOffset=0;
  323. uint8 retValue, cmdId;
  324. /* parse header */
  325. cmdId = pBuf[MT_RPC_POS_CMD1];
  326. pBuf += MT_RPC_FRAME_HDR_SZ;
  327. /* Get the ID */
  328. nvId = BUILD_UINT16(pBuf[0], pBuf[1]);
  329. pBuf += sizeof(uint16);
  330. /* Calculate the offset */
  331. nvItemOffset = *pBuf++;
  332. /* Calculate the length */
  333. nvItemLen = *pBuf++;
  334. /* Default to ZFailure */
  335. retValue = ZFailure;
  336. /* Set the zGlobal value of this NV item. */
  337. zgSetItem( nvId, (uint16)nvItemLen, pBuf );
  338. if ((osal_nv_write( nvId, (uint16)nvItemOffset, (uint16)nvItemLen, pBuf)) == ZSUCCESS)
  339. {
  340. retValue = ZSuccess;
  341. }
  342. /* Build and send back the response */
  343. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), cmdId, 1, &retValue );
  344. }
  345. /***************************************************************************************************
  346. * @fn MT_SysOsalStartTimer
  347. *
  348. * @brief
  349. *
  350. * @param uint8 pData - pointer to the data
  351. *
  352. * @return None
  353. ***************************************************************************************************/
  354. void MT_SysOsalStartTimer(uint8 *pBuf)
  355. {
  356. uint16 eventId;
  357. uint8 retValue = ZFailure;
  358. uint8 cmdId;
  359. /* parse header */
  360. cmdId = pBuf[MT_RPC_POS_CMD1];
  361. pBuf += MT_RPC_FRAME_HDR_SZ;
  362. if (*pBuf <= 3)
  363. {
  364. eventId = (uint16) MT_SysOsalEventId[*pBuf];
  365. retValue = osal_start_timerEx(MT_TaskID, eventId, BUILD_UINT16(pBuf[1], pBuf[2]));
  366. }
  367. else
  368. {
  369. retValue = ZInvalidParameter;
  370. }
  371. /* Build and send back the response */
  372. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), cmdId, 1, &retValue);
  373. }
  374. /***************************************************************************************************
  375. * @fn MT_SysOsalStopTimer
  376. *
  377. * @brief
  378. *
  379. * @param uint8 pData - pointer to the data
  380. *
  381. * @return None
  382. ***************************************************************************************************/
  383. void MT_SysOsalStopTimer(uint8 *pBuf)
  384. {
  385. uint16 eventId;
  386. uint8 retValue = ZFailure;
  387. uint8 cmdId;
  388. /* parse header */
  389. cmdId = pBuf[MT_RPC_POS_CMD1];
  390. pBuf += MT_RPC_FRAME_HDR_SZ;
  391. if (*pBuf <= 3)
  392. {
  393. eventId = (uint16) MT_SysOsalEventId[*pBuf];
  394. retValue = osal_stop_timerEx(MT_TaskID, eventId);
  395. }
  396. else
  397. {
  398. retValue = ZInvalidParameter;
  399. }
  400. /* Build and send back the response */
  401. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), cmdId, 1, &retValue );
  402. }
  403. /***************************************************************************************************
  404. * @fn MT_SysRandom
  405. *
  406. * @brief
  407. *
  408. * @param uint8 pData - pointer to the data
  409. *
  410. * @return None
  411. ***************************************************************************************************/
  412. void MT_SysRandom()
  413. {
  414. uint16 randValue = Onboard_rand();
  415. uint8 retArray[2];
  416. retArray[0] = LO_UINT16(randValue);
  417. retArray[1] = HI_UINT16(randValue);
  418. /* Build and send back the response */
  419. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), MT_SYS_RANDOM, 2, retArray );
  420. }
  421. /***************************************************************************************************
  422. * @fn MT_SysAdcRead
  423. *
  424. * @brief Reading ADC value, temperature sensor and voltage
  425. *
  426. * @param uint8 pData - pointer to the data
  427. *
  428. * @return None
  429. ***************************************************************************************************/
  430. void MT_SysAdcRead(uint8 *pBuf)
  431. {
  432. uint8 channel, resolution;
  433. uint16 tempValue;
  434. uint8 retArray[2];
  435. uint8 cmdId;
  436. /* parse header */
  437. cmdId = pBuf[MT_RPC_POS_CMD1];
  438. pBuf += MT_RPC_FRAME_HDR_SZ;
  439. /* Channel */
  440. channel = *pBuf++;
  441. /* Resolution */
  442. resolution = *pBuf++;
  443. /* Voltage reading */
  444. switch (channel)
  445. {
  446. /* Analog input channel */
  447. case HAL_ADC_CHANNEL_0:
  448. case HAL_ADC_CHANNEL_1:
  449. case HAL_ADC_CHANNEL_2:
  450. case HAL_ADC_CHANNEL_3:
  451. case HAL_ADC_CHANNEL_4:
  452. case HAL_ADC_CHANNEL_5:
  453. case HAL_ADC_CHANNEL_6:
  454. case HAL_ADC_CHANNEL_7:
  455. tempValue = HalAdcRead(channel, resolution);
  456. break;
  457. /* Temperature sensor */
  458. case(HAL_ADC_CHANNEL_TEMP):
  459. tempValue = HalAdcRead(HAL_ADC_CHANNEL_TEMP, HAL_ADC_RESOLUTION_14);
  460. break;
  461. /* Voltage reading */
  462. case(HAL_ADC_CHANNEL_VDD):
  463. tempValue = HalAdcRead(HAL_ADC_CHANNEL_VDD, HAL_ADC_RESOLUTION_14);
  464. break;
  465. default:
  466. break;
  467. }
  468. retArray[0] = LO_UINT16(tempValue);
  469. retArray[1] = HI_UINT16(tempValue);
  470. /* Build and send back the response */
  471. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), cmdId, 2, retArray);
  472. }
  473. /**************************************************************************************************
  474. * @fn MT_SysGpio
  475. *
  476. * @brief ZAccel RPC interface for controlling the available GPIO pins.
  477. *
  478. * @param uint8 pData - Pointer to the data.
  479. *
  480. * @return None
  481. *************************************************************************************************/
  482. void MT_SysGpio(uint8 *pBuf)
  483. {
  484. uint8 cmd, val;
  485. cmd = pBuf[MT_RPC_POS_CMD1];
  486. pBuf += MT_RPC_FRAME_HDR_SZ;
  487. /* Board specific GPIO goes here */
  488. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), cmd, 1, &val);
  489. }
  490. #endif /* MT_SYS_FUNC */
  491. /***************************************************************************************************
  492. * SUPPORT
  493. ***************************************************************************************************/
  494. /***************************************************************************************************
  495. * @fn MT_SysResetInd()
  496. *
  497. * @brief Sends a ZTOOL "reset response" message.
  498. *
  499. * @param None
  500. *
  501. * @return None
  502. *
  503. ***************************************************************************************************/
  504. void MT_SysResetInd(void)
  505. {
  506. uint8 retArray[6];
  507. retArray[0] = ResetReason(); /* Reason */
  508. retArray[1] = 0x00; /* Transport Revision */
  509. retArray[2] = 0x00; /* Product */
  510. retArray[3] = 0x00; /* Major Revision */
  511. retArray[4] = 0x00; /* Minor Revision */
  512. retArray[5] = 0x00; /* Hardware Revision */
  513. /* Send out Reset Response message */
  514. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_AREQ | (uint8)MT_RPC_SYS_SYS), MT_SYS_RESET_IND,
  515. sizeof(retArray), retArray);
  516. }
  517. /***************************************************************************************************
  518. * @fn MT_SysOsalTimerExpired()
  519. *
  520. * @brief Sends a SYS Osal Timer Expired
  521. *
  522. * @param None
  523. *
  524. * @return None
  525. *
  526. ***************************************************************************************************/
  527. void MT_SysOsalTimerExpired(uint8 Id)
  528. {
  529. uint8 retValue;
  530. retValue = Id;
  531. MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_AREQ | (uint8)MT_RPC_SYS_SYS), MT_SYS_OSAL_TIMER_EXPIRED, 1, &retValue);
  532. }
  533. /***************************************************************************************************
  534. ***************************************************************************************************/