| AVR Z-LINKŪ | |||||
Copyright (c) 2006, Atmel Corporation All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. The name of ATMEL may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file createhex.cpp.
#include "hexfile.h"
#include <sstream>
#include <iomanip>
#include <string>
#include <stdexcept>
#include <vector>
#include <fstream>
#include <algorithm>
Include dependency graph for createhex.cpp:

Go to the source code of this file.
Data Structures | |
| class | ParameterParser |
| Class to parse and store command line parameters for this application. More... | |
Functions | |
| void | CreateHEXFile (const ParameterParser &parser) |
| int | main (size_t argc, const char **argv) |
| void CreateHEXFile | ( | const ParameterParser & | parser | ) |
This function creates a HEX file from parameters stored in a parameter parser object.
Definition at line 163 of file createhex.cpp.
References ParameterParser::GetFilename(), and ParameterParser::GetMACAddress().
Referenced by main().
00164 { 00165 HEXFile hexData; 00166 std::ofstream outFile( parser.GetFilename().c_str() ); 00167 00168 // Prepare counter value bytes. 00169 HEXRecord MACAddress; 00170 std::vector< byte > MACAddressReversed = parser.GetMACAddress(); 00171 std::reverse( MACAddressReversed.begin(), MACAddressReversed.end() ); 00172 MACAddress << MACAddressReversed; 00173 00174 // Add records to HEX file. 00175 hexData << MACAddress; 00176 00177 // Write to disk. 00178 outFile << hexData; 00179 }
Here is the call graph for this function:

| int main | ( | size_t | argc, | |
| const char ** | argv | |||
| ) |
Definition at line 183 of file createhex.cpp.
References CreateHEXFile(), ParameterParser::GetFilename(), and ParameterParser::GetMACAddressString().
00184 { 00185 try { 00186 const std::string endian( " (Byte order reversed in HEX file)" ); 00187 ParameterParser parser( argc, argv ); 00188 std::cout << "Filename : " << parser.GetFilename() << std::endl 00189 << "MAC address : " << parser.GetMACAddressString() << endian << std::endl; 00190 00191 CreateHEXFile( parser ); 00192 std::cout << std::endl << parser.GetFilename() << " created!" << std::endl; 00193 00194 } catch( const std::exception & e ) { 00195 std::cout << "Error: " << e.what() << std::endl; 00196 } catch(...) { 00197 std::cout << "Unknown error" << std::endl; 00198 } 00199 }
Here is the call graph for this function:

Generated on Sun Oct 29 18:12:00 2006 for AVR414 User's Guide - ATAVRRZ502 - Accessory Kit (PC Tools - HEXMaker) by 1.4.7
|