Goby Underwater Autonomy Project
Series: 1.1, revision: 163, released on 2013-02-06 14:23:27 -0500
|
00001 // copyright 2009 t. schneider tes@mit.edu 00002 // 00003 // This program is free software: you can redistribute it and/or modify 00004 // it under the terms of the GNU General Public License as published by 00005 // the Free Software Foundation, either version 3 of the License, or 00006 // (at your option) any later version. 00007 // 00008 // This software is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 // GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License 00014 // along with this software. If not, see <http://www.gnu.org/licenses/>. 00015 00016 #include "goby/acomms/dccl.h" 00017 #include <iostream> 00018 00019 using goby::acomms::operator<<; 00020 00021 int main(int argc, char* argv[]) 00022 { 00023 std::string xml_file; 00024 switch(argc) 00025 { 00026 case 2: 00027 xml_file = argv[1]; 00028 break; 00029 00030 default: 00031 std::cout << "usage: analyze_dccl_xml message_xml_file.xml" << std::endl; 00032 exit(EXIT_FAILURE); 00033 } 00034 00035 std::cout << "creating DCCLCodec using xml file: [" << xml_file << "]" << std::endl; 00036 00037 goby::acomms::DCCLCodec dccl; 00038 goby::acomms::protobuf::DCCLConfig cfg; 00039 cfg.add_message_file()->set_path(xml_file); 00040 dccl.set_cfg(cfg); 00041 00042 std::cout << "parsed file ok!" << std::endl; 00043 00044 std::cout << std::string(30, '#') << std::endl 00045 << "detailed message summary:" << std::endl 00046 << std::string(30, '#') << std::endl 00047 << dccl; 00048 00049 return 0; 00050 }