INTRODUCTION Overview Download and Install Documentation Publications REPOSITORY Libraries DEVELOPER Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
smartbatteryparsing.h00001 /* 00002 * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics 00003 * http://gearbox.sf.net/ 00004 * Copyright (c) 2004-2008 Tobias Kaupp 00005 * 00006 * This distribution is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef GBX_SMARTBATTERY_PARSING_H 00012 #define GBX_SMARTBATTERY_PARSING_H 00013 00014 #include <vector> 00015 #include <map> 00016 00017 #include <gbxutilacfr/tracer.h> 00018 00019 namespace gbxsmartbatteryacfr 00020 { 00021 00024 void readFlags( const std::string &str, 00025 std::vector<bool> &flags ); 00026 00029 double readTemperature( const std::string &str ); 00030 00033 double readCurrent( const std::string &str ); 00034 00037 double readVoltage( const std::string &str ); 00038 00041 int readNumBatteries( const std::string &str ); 00042 00045 int readPercentWord( const std::string &str ); 00046 00049 int readPercentByte( const std::string &str ); 00050 00053 int readMinutes( const std::string &str ); 00054 00057 int readCapacity( const std::string &str ); 00058 00061 uint16_t read16Flags( const std::string &str ); 00062 00065 int readCount( const std::string &str ); 00066 00069 int readNumber( const std::string &str ); 00070 00073 int readRate( const std::string &str ); 00074 00077 bool isChecksumValid( const std::string &input, 00078 const std::string &expected ); 00079 00082 void toKeyValuePairs( const std::vector<std::string> &fields, 00083 std::map<std::string,std::string> &pairs, 00084 gbxutilacfr::Tracer &tracer ); 00085 00086 } 00087 00088 #endif |