host/user_interface.c
/** Write backup seed to some output device. The choice of output device and
  * seed representation is up to the platform-dependent code. But a typical
  * example would be displaying the seed as a hexadecimal string on a LCD.
  * \param seed A byte array of length #SEED_LENGTH bytes which contains the
  *             backup seed.
  * \param is_encrypted Specifies whether the seed has been encrypted.
  * \param destination_device Specifies which (platform-dependent) device the
  *                           backup seed should be sent to.
  * \return false on success, true if the backup seed could not be written
  *         to the destination device.
  */
Write backup seed to some output device. The choice of output device and
seed representation is up to the platform-dependent code. But a typical
example would be displaying the seed as a hexadecimal string on a LCD.
\param seed A byte array of length #SEED_LENGTH bytes which contains the
backup seed.
\param is_encrypted Specifies whether the seed has been encrypted.
\param destination_device Specifies which (platform-dependent) device the
backup seed should be sent to.
\return false on success, true if the backup seed could not be written
to the destination device.
Write backup seed to some output device . The choice of output device and seed representation is up to the platform - dependent code . But a typical example would be displaying the seed as a hexadecimal string on a LCD . \ param seed A byte array of length #SEED_LENGTH bytes which contains the backup seed . \ param is_encrypted Specifies whether the seed has been encrypted . \ param destination_device Specifies which ( platform - dependent ) device the backup seed should be sent to . \ return false on success true if the backup seed could not be written to the destination device .
bool writeBackupSeed(uint8_t *seed, bool is_encrypted, uint32_t destination_device)
{
    int i;
    int byte_counter;
    if (destination_device != 0)
        return true;
    else
    {
        if (is_encrypted)
            printf("\nThe seed is encrypted\n");
        else
            printf("\nThe seed is unencrypted\n");
        printf("\n");
        byte_counter = 0;
        printf("Wallet seed:\n\n");
        for (i = 0; i < SEED_LENGTH; i++)
        {
            if (byte_counter == 2 || byte_counter == 4 || byte_counter == 6)
                printf(" ");
            if (byte_counter == 8)
            {
                byte_counter = 0;
                printf("\n");
            }
            printf("%02x", seed[i]);
            byte_counter++;
        }
        printf("\n\n");
        if(is_test)
            memcpy(test_wallet_backup, seed, SEED_LENGTH);
        return false;
    }
}
bool writeBackupSeed ( uint8_t * seed , bool is_encrypted , uint32_t destination_device ) { int i ; int byte_counter ; if ( destination_device != 0 ) return true ; else { if ( is_encrypted ) printf ( " \n \n " ) ; else printf ( " \n \n " ) ; printf ( " \n " ) ; byte_counter = 0 ; printf ( " \n \n " ) ; for ( i = 0 ; i < SEED_LENGTH ; i ++ ) { if ( byte_counter == 2 || byte_counter == 4 || byte_counter == 6 ) printf ( " " ) ; if ( byte_counter == 8 ) { byte_counter = 0 ; printf ( " \n " ) ; } printf ( " " , seed [ i ] ) ; byte_counter ++ ; } printf ( " \n \n " ) ; if ( is_test ) memcpy ( test_wallet_backup , seed , SEED_LENGTH ) ; return false ; } }
Write backup seed to some output device.
Write backup seed to some output device .
/*
         * The following code will output the seed in the format:
         * " xxxx xxxx xxxx xxxx"
         * " xxxx xxxx xxxx xxxx"
         */