From 2a7311e10ffa75f2477e1ae7656c8c5405401756 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 1 Dec 2018 18:36:02 +0100 Subject: [PATCH] rename 'data' structure into 'message' --- README.md | 16 ++++++++-------- protocol.h | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index fe4c049..e920288 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@ The base scenario takes place in a mesh network of similar nodes ; each b **Vocabulary** -- **distance** - the relative distance to the well. The well has a distance of 0, its direct neighbors a distance of 1 and so on. +- **distance** - the relative distance to the well. The well has a distance of 0, its direct neighbors a distance of 1 and so on. - **wave** - a distance propagation of distances throughout the network that share a common source. - + ---- @@ -78,12 +78,12 @@ struct discover { The `data` format is sent by nodes to submit messagesca to the well. ```c++ -struct data { - uint8_t opcode; // opcode = 1 - uint8_t dist; // distance of the last sender - uint8_t ttl; // time to live default = 10 - uint8_t size; // size of message in bytes - uint8_t message[]; // actual message +struct message { + uint8_t opcode; // opcode = 1 + uint8_t dist; // distance of the last sender + uint8_t ttl; // time to live default = 10 + uint8_t size; // size of message in bytes + uint8_t data[]; // actual message }; ``` diff --git a/protocol.h b/protocol.h index 6c7ba3b..7ee52e3 100644 --- a/protocol.h +++ b/protocol.h @@ -12,12 +12,12 @@ }; - struct data { - uint8_t opcode; // opcode = 1 - uint8_t dist; // distance of the last sender - uint8_t ttl; // time to live default = 10 - uint8_t size; // size of message in bytes - uint8_t message[]; // actual message + struct message { + uint8_t opcode; // opcode = 1 + uint8_t dist; // distance of the last sender + uint8_t ttl; // time to live default = 10 + uint8_t size; // size of message in bytes + uint8_t data[]; // actual message }; // A object is held by each node which values are determined thanks @@ -45,7 +45,7 @@ // update the current node according to a (received) // discover request - bool update(struct discover req); + bool update(struct discover dsc); };