rename 'data' structure into 'message'

This commit is contained in:
Adrien Marquès 2018-12-01 18:36:02 +01:00
parent f917275cbc
commit 2a7311e10f
2 changed files with 15 additions and 15 deletions

View File

@ -22,13 +22,13 @@ The base scenario takes place in a mesh network of similar <u>nodes</u> ; each b
**Vocabulary** **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. - **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. The `data` format is sent by nodes to submit messagesca to the well.
```c++ ```c++
struct data { struct message {
uint8_t opcode; // opcode = 1 uint8_t opcode; // opcode = 1
uint8_t dist; // distance of the last sender uint8_t dist; // distance of the last sender
uint8_t ttl; // time to live default = 10 uint8_t ttl; // time to live default = 10
uint8_t size; // size of message in bytes uint8_t size; // size of message in bytes
uint8_t message[]; // actual message uint8_t data[]; // actual message
}; };
``` ```

View File

@ -12,12 +12,12 @@
}; };
struct data { struct message {
uint8_t opcode; // opcode = 1 uint8_t opcode; // opcode = 1
uint8_t dist; // distance of the last sender uint8_t dist; // distance of the last sender
uint8_t ttl; // time to live default = 10 uint8_t ttl; // time to live default = 10
uint8_t size; // size of message in bytes uint8_t size; // size of message in bytes
uint8_t message[]; // actual message uint8_t data[]; // actual message
}; };
// A <node> object is held by each node which values are determined thanks // A <node> object is held by each node which values are determined thanks
@ -45,7 +45,7 @@
// update the current node according to a (received) // update the current node according to a (received)
// discover request // discover request
bool update(struct discover req); bool update(struct discover dsc);
}; };