Skip to content

Commit f3780e8

Browse files
committed
Format readme
1 parent 3851c25 commit f3780e8

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,25 @@ As defined previously, an IoT Agent is a component that lets a group of devices
8181
Context Broker using their own native protocols. Every IoT Agent is defined for a single payload format, although they
8282
may be able to use multiple disparate transports for that payload.
8383

84-
We have already encountered the JSON IoT Agent, which communicates using a simple bar (`|`) separated list of
85-
key-value pairs. This payload is a simple, terse but relatively obscure communication mechanism - by far the commonest
86-
messaging payload used on the Internet is the so-called JavaScript Object Notation or JSON which will be familar to any
87-
software developer.
84+
We have already encountered the JSON IoT Agent, which communicates using a simple bar (`|`) separated list of key-value
85+
pairs. This payload is a simple, terse but relatively obscure communication mechanism - by far the commonest messaging
86+
payload used on the Internet is the so-called JavaScript Object Notation or JSON which will be familar to any software
87+
developer.
8888

89-
JSON is slightly more verbose than JSON, but the cost of sending larger messages is offset by the familiarity of
90-
the syntax. A separate
89+
JSON is slightly more verbose than JSON, but the cost of sending larger messages is offset by the familiarity of the
90+
syntax. A separate
9191
[IoT Agent for JSON](https://fiware-iotagent-json.readthedocs.io/en/latest/usermanual/index.html#user-programmers-manual)
9292
has been created specifically to cope with messages sent in this format, since a large number of common devices are able
9393
to be programmed to send messages in JSON and many software libraries exist to parse the data.
9494

95-
There is no practical difference between communicating using a JSON payload and communicating using the JSON plain
96-
text payload - provided that the basis of that communication - in other words the fundamental protocol defining how the
95+
There is no practical difference between communicating using a JSON payload and communicating using the JSON plain text
96+
payload - provided that the basis of that communication - in other words the fundamental protocol defining how the
9797
messages are passed between the components remains the same. Obviously the parsing of JSON payloads within the IoT
9898
Agent - the conversion of messages from JSON to NGSI and vice-versa will be unique to the JSON IoT Agent.
9999

100100
A direct comparison of the two IoT Agents can be seen below:
101101

102-
| IoT Agent for JSON | IoT Agent for JSON | Protocol's Area of Concern |
102+
| IoT Agent for JSON | IoT Agent for JSON | Protocol's Area of Concern |
103103
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | -------------------------- |
104104
| Sample Measure `c\|1` | Sample Measure `{"count": "1"}` | Message Payload |
105105
| Sample Command `Robot1@turn\|left` | Sample Command `{"Robot1": {"turn": "left"}}` | Message Payload |
@@ -110,7 +110,7 @@ A direct comparison of the two IoT Agents can be seen below:
110110
| HTTP commands posted to a well-known URL - response is in the reply | HTTP commands posted to a well-known URL - response is in the reply | Communications Handshake |
111111
| MQTT devices are identified by the path of the topic `/XXX/YYY` | MQTT devices are identified by the path of the topic `/XXX/YYY` | Device Identification |
112112
| MQTT commands posted to the `cmd` topic | MQTT commands posted to the `cmd` topic | Communications Handshake |
113-
| MQTT command responses posted to the `cmdexe` topic | MQTT command responses posted to the `cmdexe` topic | Communications Handshake |
113+
| MQTT command responses posted to the `cmdexe` topic | MQTT command responses posted to the `cmdexe` topic | Communications Handshake |
114114

115115
As can be seen, the message payload differs entirely between the two IoT Agents, but much of the rest of the protocol
116116
remains the same.
@@ -544,9 +544,9 @@ however it has been included here for completeness.
544544
### Provisioning a Sensor
545545

546546
It is common good practice to use URNs following the NGSI-LD
547-
[specification](https://cim.etsi.org/NGSI-LD/official/front-page.html) when creating
548-
entities. Furthermore it is easier to understand meaningful names when defining data attributes. These mappings can be
549-
defined by provisioning a device individually.
547+
[specification](https://cim.etsi.org/NGSI-LD/official/front-page.html) when creating entities. Furthermore it is easier
548+
to understand meaningful names when defining data attributes. These mappings can be defined by provisioning a device
549+
individually.
550550

551551
Three types of measurement attributes can be provisioned:
552552

@@ -625,9 +625,9 @@ curl -iX POST \
625625
-d '{"c": "1"}'
626626
```
627627

628-
Both the payload and the `Content-Type` have been updated. The dummy devices made a similar JSON request in the
629-
previous tutorials when the door was unlocked, you will have seen the state of each motion sensor changing and a
630-
Northbound request will be logged in the device monitor.
628+
Both the payload and the `Content-Type` have been updated. The dummy devices made a similar JSON request in the previous
629+
tutorials when the door was unlocked, you will have seen the state of each motion sensor changing and a Northbound
630+
request will be logged in the device monitor.
631631

632632
Now the IoT Agent is connected, the service group has defined the resource upon which the IoT Agent is listening
633633
(`iot/json`) and the API key used to authenticate the request (`4jggokgpepnvsb2uv4s40d59ov`). Since both of these are
@@ -789,8 +789,8 @@ command can be seen in the value of the `ring_info` attribute.
789789

790790
### Provisioning a Smart Door
791791

792-
Because the underlying JSON and JSON protocols are so similar, actuators and devices are provisioned using the
793-
same attributes as the data the IoT Agent needs to know to communicate with the device reamins the same, and the payload
792+
Because the underlying JSON and JSON protocols are so similar, actuators and devices are provisioned using the same
793+
attributes as the data the IoT Agent needs to know to communicate with the device reamins the same, and the payload
794794
parsing NGSI to JSON is delegated to the IoT Agent itself. Provisioning a device which offers both commands and
795795
measurements is merely a matter of making an HTTP POST request with both `attributes` and `command` attributes in the
796796
body of the request.

0 commit comments

Comments
 (0)