This commit is contained in:
glenux 2006-02-05 17:54:58 +00:00
parent c5cb3d88a5
commit 36b156e5de
3 changed files with 2 additions and 60 deletions

View file

@ -133,6 +133,7 @@ void LowReceiver::manage_abcast(Message * mesg) {
} else {
// sinon
// - l'estampille du message est mise a jour
TimeStamp * stamp = new TimeStamp (Protocol::TYPE_ABCAST, cell->message->getData(), cell->message->getDataSize());
// - le message est marqué comme final
// - on défile les estampille finale la

View file

@ -36,65 +36,6 @@ Message::Message(void * data, int len) {
_type = (Protocol::Type)(_raw[index]);
index += 1;
/*
short stamp_index = -1;
short stamp_len = -1;
switch(_type){
case Protocol::TYPE_ABCAST :
{
memcpy(&stamp_index, (_raw + index), 2);
stamp_index = ntohs(stamp_index);
stamp_len = 1; // 2 * 2 octets;
index += 2;
}
break;
case Protocol::TYPE_CBCAST :
{
// on est super embétés...
// on regarde d'abord l'index...
// stamp_len = 4i
memcpy(&stamp_index, (_raw + index), 2);
stamp_index = ntohs(stamp_index);
index += 2;
memcpy(&stamp_len, (_raw + index), 2);
index += 2;
}
break;
case Protocol::TYPE_TEST :
{
// taille = 0;
stamp_len = 0;
}
break;
case Protocol::TYPE_UNKNOWN :
break;
default :
break;
}
if (DEBUG_INPUT) {
printf("Message::Message(void *, int) -- stamp_index %d\n", stamp_index);
printf("Message::Message(void *, int) -- stamp_len %d\n", stamp_len);
}
if (stamp_len < 0){
fprintf(stderr, "Longueur du timestamp inconnue\n !");
exit(-1);
}
_stamp = new TimeStamp(_type, stamp_index);
// on itere stamp_len fois sur 2 octets
for (int i = 0; i< stamp_len; i++){
short site_value;
memcpy(&site_value, (_raw + index), 2);
site_value = ntohs(site_value);
if (DEBUG_INPUT)
printf("Message::Message -- horloge[%d] = %d\n", i, site_value);
index += 2;
_stamp->push_back(site_value);
}
*/
_stamp = new TimeStamp(_type, (_raw + index), len - index);
index += _stamp->getRawSize();

View file

@ -3,7 +3,7 @@
#include "timestamp.h"
#define DEBUG 1
#define DEBUG 0
TimeStamp::TimeStamp(Protocol::Type type, short index){
_index = index;