Hello Sign,
There is a simpler way for getting the random number. You can use:
uint16 osal_rand( void ); // returns 16 bit random number.
So if you are using the processExMsgUTIL function for parsing then in a case statement you would have the NV_Read
static uint8 processExMsgUTIL( uint8 cmdID, hciExtCmd_t *pCmd, uint8 *pRspDataLen )
{
uint8 *pBuf = pCmd->pData;
bStatus_t stat = SUCCESS;
*pRspDataLen = 0;
switch( cmdID )
{
....
case HCI_EXT_UTIL_NV_READ:
{
PIN = osal_rand( ); // returns 16 bit random number.
....
}
break;
....
}
Thanks,