host/stream_comm.c
/** nanopb field callback which will write repeated WalletInfo messages; one
  * for each wallet on the device.
  * \param stream Output stream to write to.
  * \param field Field which contains the WalletInfo submessage.
  * \param arg Unused.
  * \return true on success, false on failure (nanopb convention).
  */
nanopb field callback which will write repeated WalletInfo messages; one
for each wallet on the device.
\param stream Output stream to write to.
\param field Field which contains the WalletInfo submessage.
\param arg Unused.
\return true on success, false on failure (nanopb convention).
nanopb field callback which will write repeated WalletInfo messages ; one for each wallet on the device . \ param stream Output stream to write to . \ param field Field which contains the WalletInfo submessage . \ param arg Unused . \ return true on success false on failure ( nanopb convention ) .
bool listWalletsCallback(pb_ostream_t *stream, const pb_field_t *field, void * const *arg)
{
	uint32_t i;
	WalletInfo message_buffer;
	uint32_t version;
	for (i = 0; i < number_of_wallets; i++)
	{
		message_buffer.wallet_number = i;
		message_buffer.wallet_name.size = NAME_LENGTH;
		message_buffer.wallet_uuid.size = UUID_LENGTH;
		if (getWalletInfo(&version,	message_buffer.wallet_name.bytes, message_buffer.wallet_uuid.bytes, i) != WALLET_NO_ERROR)
			return true; 
		if (version != VERSION_NOTHING_THERE)
		{
			if (!pb_encode_tag_for_field(stream, field))
				return false;
			if (!pb_encode_submessage(stream, WalletInfo_fields, &message_buffer))
				return false;
		}
	}
	return true;
}
bool listWalletsCallback ( pb_ostream_t * stream , const pb_field_t * field , void * const * arg ) { uint32_t i ; WalletInfo message_buffer ; uint32_t version ; for ( i = 0 ; i < number_of_wallets ; i ++ ) { message_buffer . wallet_number = i ; message_buffer . wallet_name . size = NAME_LENGTH ; message_buffer . wallet_uuid . size = UUID_LENGTH ; if ( getWalletInfo ( & version , message_buffer . wallet_name . bytes , message_buffer . wallet_uuid . bytes , i ) != WALLET_NO_ERROR ) return true ; if ( version != VERSION_NOTHING_THERE ) { if ( ! pb_encode_tag_for_field ( stream , field ) ) return false ; if ( ! pb_encode_submessage ( stream , WalletInfo_fields , & message_buffer ) ) return false ; } } return true ; }
nanopb field callback which will write repeated WalletInfo messages; one
 for each wallet on the device.
nanopb field callback which will write repeated WalletInfo messages ; one for each wallet on the device .
/* It's too late to return an error message, so cut off the array now */