Subversion Repositories HomeAutomation

Rev

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

Rev 1319 Rev 1322
Line 16... Line 16...
16
    {
16
    {
17
        this->myBuffer.push_back(bytes[n]);
17
        this->myBuffer.push_back(bytes[n]);
18
    }
18
    }
19
}
19
}
20
 
20
 
21
BitBuffer::BitBuffer(vector<unsigned char> bytes) {
21
BitBuffer::BitBuffer(byte_list bytes) {
22
    this->setFromBytes(bytes);
22
    this->setFromBytes(bytes);
23
}
23
}
24
 
24
 
25
BitBuffer::BitBuffer(string value) {
-
 
26
    this->setFromString(value);
-
 
27
}
-
 
28
 
25
 
29
 
-
 
30
BitBuffer::BitBuffer() {
26
BitBuffer::BitBuffer() {
31
}
27
}
32
 
28
 
33
BitBuffer::~BitBuffer() {
29
BitBuffer::~BitBuffer() {
34
}
30
}
35
 
-
 
36
 
-
 
37
double BitBuffer::readDecimal(unsigned int length, unsigned int scaling)
-
 
38
{
-
 
39
}
-
 
40
 
-
 
41
unsigned long BitBuffer::readUnsignedInteger(unsigned int length)
-
 
42
{
-
 
43
}
-
 
44
 
-
 
45
bool BitBuffer::readBoolean()
-
 
46
{
-
 
47
}
-
 
48
 
-
 
49
long BitBuffer::readInteger(unsigned int length)
-
 
50
{
-
 
51
}
-
 
52
 
-
 
53
void BitBuffer::writeDecimal(unsigned int length, unsigned int scaling, double value)
-
 
54
{
-
 
55
}
-
 
56
 
-
 
57
void BitBuffer::writeUnsignedInteger(unsigned int length, unsigned long  value)
-
 
58
{
-
 
59
}
-
 
60
 
31
 
61
void BitBuffer::writeInteger(unsigned int length, long  value)
-
 
62
{
-
 
63
}
-
 
64
 
32
 
65
void BitBuffer::writeBoolean(bool value)
-
 
66
{
-
 
67
}
-
 
68
 
-
 
69
vector<unsigned char> BitBuffer::getAsBytes()
33
byte_list BitBuffer::getAsBytes()
70
{
34
{
71
    return this->myBuffer;
35
    return this->myBuffer;
72
}
36
}
73
 
37
 
74
void BitBuffer::setFromBytes(vector<unsigned char> bytes)
38
void BitBuffer::setFromBytes(byte_list bytes)
75
{
39
{
76
    this->myBuffer = bytes;
40
    this->myBuffer = bytes;
77
}
41
}
-
 
42
 
-
 
43
 
-
 
44
void BitBuffer::readDecimal(unsigned int length, unsigned int scaling, double & value)
-
 
45
{
-
 
46
}
78
 
47
 
79
string BitBuffer::getAsString()
48
void BitBuffer::writeDecimal(unsigned int length, unsigned int scaling, double value)
80
{
49
{
-
 
50
}
-
 
51
 
-
 
52
 
81
    string str = "";
53
void BitBuffer::readBasicType(unsigned int length, unsigned long & value)
-
 
54
{
-
 
55
}
82
 
56
 
83
    for (unsigned int n = 0; n < this->myBuffer.size(); n++)
57
void BitBuffer::writeBasicType(unsigned int length, unsigned long value)
84
    {
58
{
85
        str += this->myBuffer[n];
-
 
86
    }
59
}
87
 
60
 
-
 
61
void BitBuffer::readBasicType(unsigned int length, long & value)
88
    return str;
62
{
89
}
63
}
90
 
64
 
91
void BitBuffer::setFromString(string value)
65
void BitBuffer::writeBasicType(unsigned int length, long  value)
92
{
66
{
93
    this->myBuffer.clear();
-
 
-
 
67
}
94
 
68
 
95
    for (unsigned int n = 0; n < value.length(); n++)
69
void BitBuffer::readBasicType(unsigned int length, bool & value)
96
    {
70
{
97
        this->myBuffer.push_back((unsigned char) value[n]);
-
 
98
    }
71
}
-
 
72
 
-
 
73
void BitBuffer::writeBasicType(unsigned int length, bool value)
-
 
74
{
99
}
75
}
-
 
76
 
100
 
77
 
101
}
78
}
102
}
79
}