SerialHelper.hpp
Go to the documentation of this file.
00001 /*
00002  * SerialHelper.hpp
00003  *
00004  *  Created on: Nov 24, 2011
00005  *      Author: mriedel
00006  */
00007 
00008 #ifndef SERIALHELPER_HPP_
00009 #define SERIALHELPER_HPP_
00010 
00011 #include <telekyb_defines/telekyb_defines.hpp>
00012 
00013 namespace TELEKYB_NAMESPACE {
00014 
00015 class SerialHelper {
00016 public:
00017         static int appendCRC ( char* buffer, unsigned int bufferPosition );
00018         //** Warning Prefix must be encoded so that it does not create 11 at the Beginning or a direct \r
00019         static int encodeData ( char* buffer, // buffer to write to must be at least prefixLength + 3 (crc1,2 and \r) + messageLength*4/3
00020                         const char* prefix, unsigned int prefixLength,
00021                         const char* message, unsigned int messageLength );
00022 
00023         static int decodeData(char* buffer, unsigned int targetLength, const char* message);
00024 
00025         static bool checkCRC (const char* message, unsigned int messageLength);
00026 };
00027 
00028 } /* namespace telekyb */
00029 #endif /* SERIALHELPER_HPP_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Defines


telekyb_serial
Author(s): Martin Riedel
autogenerated on Mon Nov 11 2013 11:14:08