diff --git a/src/lowreceiver.cc b/src/lowreceiver.cc index 168db37..77dc87a 100644 --- a/src/lowreceiver.cc +++ b/src/lowreceiver.cc @@ -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 diff --git a/src/message.cc b/src/message.cc index 706aa4d..5111dd2 100644 --- a/src/message.cc +++ b/src/message.cc @@ -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(); diff --git a/src/timestamp.cc b/src/timestamp.cc index 285685a..fe58fe9 100644 --- a/src/timestamp.cc +++ b/src/timestamp.cc @@ -3,7 +3,7 @@ #include "timestamp.h" -#define DEBUG 1 +#define DEBUG 0 TimeStamp::TimeStamp(Protocol::Type type, short index){ _index = index;