SecureElementStatus_t SecureElementInit( SecureElementNvmEvent seNvmCtxChanged )
{
    lr1110_crypto_status_t status = LR1110_CRYPTO_STATUS_ERROR;

    // Assign callback
    if( seNvmCtxChanged != 0 )
    {
        SeNvmCtxChanged = seNvmCtxChanged;
    }
    else
    {
        SeNvmCtxChanged = DummyCB;
    }

    lr1110_crypto_restore_from_flash( &LR1110, &status );

#if defined( SECURE_ELEMENT_PRE_PROVISIONED )
    // Read LR1110 pre-provisioned identity
    lr1110_system_read_uid( &LR1110, SeContext.DevEui );
    lr1110_system_read_join_eui( &LR1110, SeContext.JoinEui );
    lr1110_system_read_pin( &LR1110, SeContext.Pin );
#else
#if( STATIC_DEVICE_EUI == 0 )
    // Get a DevEUI from MCU unique ID
    LR1110SeHalGetUniqueId( SeContext.DevEui );
#endif
#endif

    SeNvmCtxChanged( );

    return ( SecureElementStatus_t ) status;
}
SecureElementStatus_t SecureElementInit( SecureElementNvmEvent seNvmCtxChanged )
{
    lr1110_crypto_status_t status = LR1110_CRYPTO_STATUS_ERROR;

     
    if( seNvmCtxChanged != 0 )
    {
        SeNvmCtxChanged = seNvmCtxChanged;
    }
    else
    {
        SeNvmCtxChanged = DummyCB;
    }

    lr1110_crypto_restore_from_flash( &LR1110, &status );

#if defined( SECURE_ELEMENT_PRE_PROVISIONED )
     
    lr1110_system_read_uid( &LR1110, SeContext.DevEui );
    lr1110_system_read_join_eui( &LR1110, SeContext.JoinEui );
    lr1110_system_read_pin( &LR1110, SeContext.Pin );
#else
#if( STATIC_DEVICE_EUI == 0 )
     
    LR1110SeHalGetUniqueId( SeContext.DevEui );
#endif
#endif

    SeNvmCtxChanged( );

    return ( SecureElementStatus_t ) status;
}