Subversion Repositories HomeAutomation

Rev

Rev 1598 | Rev 1600 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1598 Rev 1599
Line 26... Line 26...
26
#include <boost/lexical_cast.hpp>
26
#include <boost/lexical_cast.hpp>
27
 
27
 
28
namespace atom {
28
namespace atom {
29
namespace can {
29
namespace can {
30
 
30
 
31
Protocol::Pointer Protocol::instance_ = Protocol::Pointer(new Protocol());
31
Protocol::Pointer Protocol::instance_;
32
 
32
 
33
Protocol::Protocol() : LOG("can::Protocol")
33
Protocol::Protocol() : LOG("can::Protocol")
34
{
34
{
35
}
35
}
36
 
36
 
37
Protocol::~Protocol()
37
Protocol::~Protocol()
38
{
38
{
-
 
39
}
-
 
40
 
-
 
41
void Protocol::Create()
-
 
42
{
-
 
43
    Protocol::instance_ = Protocol::Pointer(new Protocol());
39
}
44
}
40
 
45
 
41
Protocol::Pointer Protocol::Instance()
46
Protocol::Pointer Protocol::Instance()
42
{
47
{
43
    return Protocol::instance_;
48
    return Protocol::instance_;
Line 327... Line 332...
327
}
332
}
328
 
333
 
329
void Protocol::EncodeFloat(type::Bitset& bitset, unsigned int start_bit, unsigned int bit_length, std::string value)
334
void Protocol::EncodeFloat(type::Bitset& bitset, unsigned int start_bit, unsigned int bit_length, std::string value)
330
{
335
{
331
 // TODO:
336
    // TODO:
-
 
337
    LOG.Error("EncodeFloat() is not implemented yet!");
332
}
338
}
333
 
339
 
334
std::string Protocol::DecodeAscii(type::Bitset& bitset, unsigned int start_bit, unsigned int bit_length)
340
std::string Protocol::DecodeAscii(type::Bitset& bitset, unsigned int start_bit, unsigned int bit_length)
335
{
341
{
336
    std::string value;
342
    std::string value;
Line 347... Line 353...
347
}
353
}
348
 
354
 
349
void Protocol::EncodeAscii(type::Bitset& bitset, unsigned int start_bit, unsigned int bit_length, std::string value)
355
void Protocol::EncodeAscii(type::Bitset& bitset, unsigned int start_bit, unsigned int bit_length, std::string value)
350
{
356
{
351
    // TODO
357
    // TODO
-
 
358
    LOG.Error("EncodeAscii() is not implemented yet!");
352
}
359
}
353
 
360
 
354
std::string Protocol::DecodeHexstring(type::Bitset& bitset, unsigned int start_bit, unsigned int bit_length)
361
std::string Protocol::DecodeHexstring(type::Bitset& bitset, unsigned int start_bit, unsigned int bit_length)
355
{
362
{
356
    std::string value;
363
    std::string value;
Line 374... Line 381...
374
}
381
}
375
 
382
 
376
void Protocol::EncodeHexstring(type::Bitset& bitset, unsigned int start_bit, unsigned int bit_length, std::string value)
383
void Protocol::EncodeHexstring(type::Bitset& bitset, unsigned int start_bit, unsigned int bit_length, std::string value)
377
{
384
{
378
    // TODO:
385
    // TODO:
-
 
386
    LOG.Error("EncodeHexstring() is not implemented yet!");
379
}
387
}
380
 
388
 
381
}; // namespace can
389
}; // namespace can
382
}; // namespace atom
390
}; // namespace atom