3.1.8 PAL_GetRandomNumber Function

C

PAL_Status_t PAL_GetRandomNumber(uint8_t *rnOutput, uint16_t rnLength)

Summary

Random number generation.

Description

This function is used to generate random number.

Precondition

None

Parameters

ParamDescription
rnOutputrandom number
rnLengthsize of random number

Returns

PAL_SUCCESS - If Random number generated successfully PAL_FAILURE - otherwise

Example

uint64_t randomNumber;    
if (PAL_SUCCESS != PAL_GetRandomNumber((uint8_t*)&randomNumber, sizeof(randomNumber))) {
      return PAL_FAILURE;
}    
PHY_PibSet(macIeeeAddress,(PibValue_t *) &randomNumber);

Remarks

None.