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-2010 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 <stdint.h> 00015 00016 #include <vector> 00017 #include <map> 00018 00019 #include <gbxutilacfr/tracer.h> 00020 00021 namespace gbxsmartbatteryacfr 00022 { 00023 00026 void readFlags( const std::string &str, 00027 std::vector<bool> &flags ); 00028 00031 double readTemperature( const std::string &str ); 00032 00035 double readCurrent( const std::string &str ); 00036 00039 double readVoltage( const std::string &str ); 00040 00043 int readNumBatteries( const std::string &str ); 00044 00047 int readPercentWord( const std::string &str ); 00048 00051 int readPercentByte( const std::string &str ); 00052 00055 int readMinutes( const std::string &str ); 00056 00059 int readCapacity( const std::string &str ); 00060 00063 uint16_t read16Flags( const std::string &str ); 00064 00067 int readCount( const std::string &str ); 00068 00071 int readNumber( const std::string &str ); 00072 00075 int readRate( const std::string &str ); 00076 00079 bool isChecksumValid( const std::string &input, 00080 const std::string &expected ); 00081 00084 void toKeyValuePairs( const std::vector<std::string> &fields, 00085 std::map<std::string,std::string> &pairs, 00086 gbxutilacfr::Tracer &tracer ); 00087 00088 } 00089 00090 #endif |