/* Called to obtain a "prand" as defined in core V4.2 Vol 6 Part B 1.3.2.2 */
void ble_ll_rand_prand_get(uint8_t *prand)
/* Called to obtain a "prand" as defined in core V4.2 Vol 6 Part B 1.3.2.2 */
void ble_ll_rand_prand_get(uint8_t *prand)
{
    uint16_t sum;
    while (1) {
        ble_ll_rand_data_get(prand, 3);
        sum = prand[0] + prand[1] + prand[2];
        if ((sum != 0) && (sum != (3 * 0xff))) {
            break;
        }
    }
    prand[2] &= ~0xc0;
    prand[2] |= 0x40;
}