Skip to content

Commit 2108a6f

Browse files
authored
Update README.md
1 parent f723e6d commit 2108a6f

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,23 @@ dependencies {
4646
<br/>
4747

4848
<h2 id="what-is">What is SOS-T?</h2>
49-
The [**Open Geospatial Consortium***](https://www.opengeospatial.org/) is a group committed to making open standards for the geospatial community. One of those standards is the [**Sensor Observation Service**](https://www.opengeospatial.org/standards/sos) which defines how sensors can be managed and share their data. SOS-T is a specific capability that many SOS servers possess and is this library's focus. While powerful and flexible, SOS and SOS-T standards are sometimes difficult to begin using. This library is an effort to make all those standards and nuanced data formats happen in the background leaving you to focus on the app you're building and the great data it has to share with the world.
49+
50+
The [**Open Geospatial Consortium**](https://www.opengeospatial.org) is a group committed to making open standards for the geospatial community. One of those standards is the [**Sensor Observation Service**](https://www.opengeospatial.org/standards/sos) which defines how sensors can be managed and share their data. SOS-T is a specific capability that many SOS servers possess and is this library's focus. While powerful and flexible, SOS and SOS-T standards are sometimes difficult to begin using. This library is an effort to make all those standards and nuanced data formats happen in the background leaving you to focus on the app you're building and the great data it has to share with the world.
5051

5152
<h2 id="brief-sos">A Brief Overview of how SOS-T works</h2>
53+
5254
An **SOS-T server** and a **Sensor** have a specific pattern of interaction. This pattern is as follows:<br/>
5355
1. The first time a **Sensor** wants to start providing data to a **SOS-T server**, the **Sensor** sends a message that describes itself. The **SOS-T server**, in response, sends back some identification names that the **SOS-T server** wants the **Sensor** to use to identify itself.<br/>
5456
2. When the **Sensor** is ready to tell the **SOS-T server** about the data the **Sensor** will provide, the **Sensor** sends the **SOS-T server** a template that describes its data. The **SOS-T server** relies back with an indentification name that the **SOS-T server** would like the **Sensor** to use to label its data so the **SOS-T server** can match that data back to the **Sensor**.<br/>
5557
3. Up until this point, the **Sensor** and **SOS-T server** have just negotiated descriptions and data formats, no sensor readings have actually gone from the **Sensor** to the **SOS-T server**. These two set-up steps only need to be done once.<br/>
5658
4. Now, when the **Sensor** wants to send data, it just sends a short form with its data and the label that the **SOS-T server** provided earlier. If all goes well, the **SOS-T server** lets the **Sensor** know that the data was received in a short reply. The **Sensor** keeps repeating this step whenever it wants to send new data.
5759

5860
<h2 id="how-to">How to Send Sensor Data</h2>
59-
To use this library, you should have some type of sensor in an app that needs to send data to an SOS-T server. This library started as a way to connect the SOFWERX [**TORGI**](https://github.com/sofwerx/TORGI) app to an SOS-T and is a good example of the library at work. This library is **not** the definitive answer on how to connect every sensor scenario with an SOS-T server, but it helped the TORGI effort and it's offered in hopes it will help other sensor developers as well. You can see the specific implementation of this library in the [**Torgi Service**](https://github.com/sofwerx/TORGI/blob/master/torgi/src/main/java/org/sofwerx/torgi/service/TorgiService.java). <br/><br/>
6061

61-
###Step 1: build your sensor
62+
To use this library, you should have some type of sensor in an app that needs to send data to an SOS-T server. This library started as a way to connect the SOFWERX [**TORGI**](https://github.com/sofwerx/TORGI) app to an SOS-T and is a good example of the library at work. This library is **not** the definitive answer on how to connect every sensor scenario with an SOS-T server, but it helped the TORGI effort and it's offered in hopes it will help other sensor developers as well. You can see the specific implementation of this library in the [**TorgiService**](https://github.com/sofwerx/TORGI/blob/master/torgi/src/main/java/org/sofwerx/torgi/service/TorgiService.java). <br/><br/>
63+
64+
### Step 1: build your sensor
65+
6266
You can build a sensor by providing a human-readable name that uniquely identifies this one particular sensor, a unique ID for this sensor, a title for this type of sensor, and a human-readable description of the sensor.
6367
```java
6468
SosSensor sosSensor = new SosSensor("Sensor 18742","sensor18742","TORGI","Tactical Observation of RF and GNSS Interference sensor");
@@ -73,14 +77,21 @@ sosSensor.addMeasurement(sosMeasurementFoo);
7377
sosSensor.addMeasurement(sosMeasurementTime);
7478
sosSensor.addMeasurement(sosMeasurementLocation);
7579
```
76-
###Step 2: describe the SOS-T server
80+
<br/>
81+
82+
### Step 2: describe the SOS-T server
83+
7784
Now you need to tell the library about where the sensor should send its data
7885
```java
7986
SosService sosService = new SosService(context, sosSensor,"www.your-sos-t-server.com", true, true);
8087
```
88+
<br/>
8189
Those last two boolean values deserve a bit more attention. The first, *turnOn* means that if set to true, the library will immediately try to contact the **SOS-T server** and handle all the initial information about what the **Sensor** intends to provide.<br/>
8290
The second boolean, *enableIpcBroadcast* means that the library will send out your sensor data to other apps on your same device. This is included primarily to support a future link with [**OpenSensorHub-Android**](https://github.com/opensensorhub/osh-android). If you want to send your sensor data to other apps on the same device, but not out over the internet to an SOS-T server, just provide *null* for the sosServerURL.
83-
###Step 3: send your data
91+
<br/>
92+
93+
### Step 3: send your data
94+
8495
When you have something to report to the **SOS-T server**, you can update the data in your SensorMeasurements
8596
```java
8697
sosMeasurementTime.setValue(System.currentTimeMillis());
@@ -93,8 +104,10 @@ sosService.broadcastSensorReadings();
93104
```
94105
<br/>
95106
You can repeat this step as often as needed. There is no requirement to handle the connection with the server. The library runs on another thread and will make the connection whenever is needed and pass and receive information automatically.
107+
<br/>
108+
109+
### Step 4: disconnecting
96110

97-
###Step 4: disconnecting
98111
When you are finally done communicating with the server, clean up the server connection by calling:
99112
```java
100113
sosService.shutdown();

0 commit comments

Comments
 (0)