rename 'data' structure into 'message'
This commit is contained in:
parent
f917275cbc
commit
2a7311e10f
16
README.md
16
README.md
|
@ -22,13 +22,13 @@ The base scenario takes place in a mesh network of similar <u>nodes</u> ; 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
|
||||
};
|
||||
```
|
||||
|
||||
|
|
14
protocol.h
14
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 <node> 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);
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue