Rev 1309 | Rev 1311 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1309 | Rev 1310 | ||
|---|---|---|---|
| Line 75... | Line 75... | ||
| 75 | this->myBuffer.clear(); |
75 | this->myBuffer.clear(); |
| 76 | return; |
76 | return; |
| 77 | } |
77 | } |
| 78 | 78 | ||
| 79 | byte_list data; |
79 | byte_list data; |
| 80 | - | ||
| 81 | /*unsigned long id = 0; |
- | |
| 82 | - | ||
| 83 | id = id | this->myBuffer[0]; |
- | |
| 84 | id = id | this->myBuffer[1] << 8; |
- | |
| 85 | id = id | this->myBuffer[2] << 16; |
- | |
| 86 | id = id | this->myBuffer[3] << 24;*/ |
- | |
| 87 | 80 | ||
| 88 | data.push_back(this->myBuffer[0]); |
81 | data.push_back(this->myBuffer[0]); |
| 89 | data.push_back(this->myBuffer[1]); |
82 | data.push_back(this->myBuffer[1]); |
| 90 | data.push_back(this->myBuffer[2]); |
83 | data.push_back(this->myBuffer[2]); |
| 91 | data.push_back(this->myBuffer[3]); |
84 | data.push_back(this->myBuffer[3]); |
| 92 | 85 | ||
| 93 | unsigned char length = this->myBuffer[4]; |
86 | unsigned char length = this->myBuffer[4]; |
| 94 | 87 | ||
| 95 | for (unsigned char n = 0; n < length; n++) |
88 | for (unsigned char n = 0; n < length; n++) |
| 96 | { |
89 | { |
| 97 | data.push_back(this->myBuffer[5 + n]); |
90 | data.push_back(this->myBuffer[5 + n]); |
| 98 | } |
91 | } |
| 99 | 92 | ||
| 100 | 93 | ||
| 101 | BitBuffer buffer(data); |
94 | BitBuffer buffer(data); |
| 102 | 95 | ||
| 103 | Header header; |
96 | Header header; |
| 104 | 97 | ||
| 105 | header.readBits(buffer); |
98 | header.readBits(buffer); |
| 106 | 99 | ||
| - | 100 | // TODO how do we convert from moduleType and messageId to their string names... where are these ids stored? |
|
| 107 | 101 | ||
| - | 102 | /*string moduleType = header.getVariable("moduleType").getValue(). |
|
| - | 103 | unsigned int moduleId = header.getVariable("moduleId").getValue(). |
|
| - | 104 | string messageType = header.getVariable("messageId").getValue(). |
|
| 108 | 105 | ||
| - | 106 | Message::pointer message = boost::make_shared<Message>(moduletype, moduleId, messageType); |
|
| 109 | 107 | ||
| 110 | Message::pointer message = boost::make_shared<Message>("", 0, ""); |
- | |
| 111 | // TODO Get moduletype-bits, lookup moduletype-name |
- | |
| 112 | - | ||
| 113 | // TODO Get moduleid-bits |
- | |
| 114 | - | ||
| 115 | // TODO Get messagetype-bits, lookup messagetype-name |
- | |
| 116 | - | ||
| 117 | // TODO Get variables for message |
- | |
| 118 | - | ||
| 119 |
|
108 | message.readBits(buffer); |
| 120 | - | ||
| 121 | // TODO Convert bitbuffer to message |
- | |
| 122 | - | ||
| 123 | - | ||
| 124 | 109 | ||
| 125 | this |
110 | this->put(message);*/ |
| 126 | 111 | ||
| 127 | this->myBuffer.clear(); |
112 | this->myBuffer.clear(); |
| 128 | } |
113 | } |
| 129 | 114 | ||
| 130 | void CanNet::sendPing() |
115 | void CanNet::sendPing() |