Skip to content

Commit 1928716

Browse files
committed
Split the doc in different .md
1 parent 50a6599 commit 1928716

File tree

3 files changed

+51
-132
lines changed

3 files changed

+51
-132
lines changed

POPWINarchi.pdf

47.7 KB
Binary file not shown.

PROGRAMMING.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
Examples of programmation
3+
-------------------------
4+
5+
TODO: Write a manual
6+
7+
### main_example.cpp
8+
This file contains the a simple example on how to uses the different classes of the POPWin project. The main code of this examples is:
9+
10+
// Create a POPSensor object on the local machine with resource description
11+
POPSensor popSensor("localhost", "resource.json");
12+
13+
// Start listening to the remote sensors
14+
popSensor.StartListening();
15+
16+
// wait ...
17+
18+
// Stop listening
19+
popSensor.StopListening();
20+
21+
// Print the gathered data
22+
POPSensorData data(popSensor.Gather());
23+
data.Print();
24+
25+
// Clear data
26+
popSensor.Clear();
27+
28+
As shown here the POPSensor object can be used in a very simple and efficient manner. For the programmer this class can be used transparently.
29+
30+
To compile and run this example use:
31+
32+
cd pop-win
33+
make
34+
popcrun objects.map ./main_example resources.json
35+
36+
37+
### main.cpp
38+
This file contains a more complete use of the POPWin objects. It also instantiates a POPSensor objects and lets the user send commands via the keyboard. This example can be used to test the system.
39+
40+
To compile and run this example use:
41+
42+
cd pop-win
43+
make
44+
popcrun objects.map ./main resources.json
45+

README.md

Lines changed: 6 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ POPWin
33
- **Author:** Laurent Winkler
44
- **Date:** Decembre 2014
55

6-
This document contains a general description of the POPWin project, specifications and examples of programmation. For a more technical documentation (installation, troubleshooting, ...) the developer documentation can be found here [here](INSTALL.md)
6+
This document contains a general description of the POPWin project, specifications and examples of programmation.
7+
8+
1. For a more technical documentation (installation, troubleshooting, ...) the developer documentation can be found here [here](INSTALL.md).
9+
2. The full programming guide for POPWin can be found [here](PROGRAMMING.md).
10+
3. Specifications of resource description and messaging can be found [here](SPECIFICATIONS.md).
711

812
Contacts
913
--------
@@ -41,138 +45,8 @@ As explained in the documentation of the POPWin project the communication uses d
4145
- **High level**: the POP model is used
4246
- **Low level**: the publish/subscribe model is used
4347

44-
TODO: Add UML schemes of PK
45-
46-
Examples of programmation
47-
-------------------------
48-
49-
TODO: Write a manual
50-
51-
### main_example.cpp
52-
This file contains the a simple example on how to uses the different classes of the POPWin project. The main code of this examples is:
53-
54-
// Create a POPSensor object on the local machine with resource description
55-
POPSensor popSensor("localhost", "resource.json");
56-
57-
// Start listening to the remote sensors
58-
popSensor.StartListening();
59-
60-
// wait ...
61-
62-
// Stop listening
63-
popSensor.StopListening();
64-
65-
// Print the gathered data
66-
POPSensorData data(popSensor.Gather());
67-
data.Print();
68-
69-
// Clear data
70-
popSensor.Clear();
71-
72-
As shown here the POPSensor object can be used in a very simple and efficient manner. For the programmer this class can be used transparently.
73-
74-
To compile and run this example use:
75-
76-
cd pop-win
77-
make
78-
popcrun objects.map ./main_example resources.json
79-
80-
81-
### main.cpp
82-
This file contains a more complete use of the POPWin objects. It also instantiates a POPSensor objects and lets the user send commands via the keyboard. This example can be used to test the system.
83-
84-
To compile and run this example use:
85-
86-
cd pop-win
87-
make
88-
popcrun objects.map ./main resources.json
89-
90-
91-
Specifications
92-
--------------
93-
### Resource description
94-
The resources (or sensors) that the programmer wants to access are specified in the **resource.json** file. It can contain the following fields:
95-
- **gateway**: specifies how to access the gateway sensor
96-
- **url**: the machine on which the gateway sensor is connected
97-
- **connection**: the connection between the machine and the gateway sensor (for now only usb is supported)
98-
- **nodes**: specifies the types of measurement
99-
- **measurement type**: temperature, humidity, light, ... as specified in [gatewayMote/popwin_messages.h]
100-
- **direction**: "IN" for sensor or "OUT" for actuators
101-
102-
103-
{
104-
"gateways":[
105-
{
106-
"url": "localhost",
107-
"connection": "usb"
108-
}
109-
],
110-
"wsns":{
111-
"nodes":[
112-
{
113-
"measurementType": "temperature",
114-
"direction": "IN"
115-
},
116-
{
117-
"measurementType": "humidity",
118-
"direction": "IN"
119-
},
120-
{
121-
"measurementType": "light",
122-
"direction": "IN"
123-
}
124-
]
125-
}
126-
}
127-
128-
Examples of resource files can be found [resources.json](here) and [multi_gw.json](here).
129-
130-
131-
### Messaging
132-
In the low-level part of the system (that uses the publish/subscribe messaging model) the following types of models are implemented: notification, publication and subscription. Please note that unsubscriptions are not implemented yet but their structure is identical to subscription messages.
133-
134-
The messages can contain the following fields:
135-
- **MeasurementType**: An enum that specifies the type of measurement: temperature, vibration, humidity, ...
136-
- **MeasurementUnit**: An enum that specifies the measurement unit: Celsius, seconds, meters, ...
137-
- **PublicationType**: An enum that specifies the type of publication: e.g. led
138-
- **ID** : The id of the sender
139-
- **DataType** : An enum that specifies the type of the data: double, int or string
140-
- **data** : A buffer of character (of size BUFFERDATASIZE=64) that contains the data. For compatibility between systems integers and floats are printed to this buffer and not stored as bit value.
141-
- **DataSize** : The size of the above data in characters
142-
143-
TODO: Add buffering functions (2 ways) + link to .h
144-
145-
#### Notification message
146-
147-
struct NotifyMessage
148-
{
149-
enum MeasurementType measurementType;
150-
enum DataType dataType;
151-
unsigned short id;
152-
enum MeasurementUnit unit;
153-
size_t dataSize;
154-
char data[BUFFERDATASIZE];
155-
};
156-
157-
#### Publication message
158-
159-
struct PublishMessage
160-
{
161-
enum PublicationType publicationType;
162-
enum DataType dataType;
163-
unsigned short id; // not mandatory, for convenience
164-
size_t dataSize;
165-
char data[BUFFERDATASIZE];
166-
};
167-
48+
A more complete scheme of the network can be found [here](POPWINarchi.pdf) !
16849

169-
#### Subscription message
17050

171-
struct SubscribeMessage
172-
{
173-
unsigned short id; // Id is not mandatory. Only for convenience
174-
enum MeasurementType measurementType;
175-
enum DataType dataType;
176-
};
17751

17852

0 commit comments

Comments
 (0)