... | ... | @@ -14,7 +14,7 @@ All requests made to the API must be sent to the following URL (URL base): |
|
|
|
|
|
## Publication
|
|
|
|
|
|
To **publish** information, a REST API is available:
|
|
|
This use case has a REST API for the publication (sending) of the data by the companies that request it. Details of this can be found in the following sections:
|
|
|
|
|
|
- General details for making a request:
|
|
|
|
... | ... | @@ -30,7 +30,7 @@ To **publish** information, a REST API is available: |
|
|
|
|
|
## Subscription
|
|
|
|
|
|
The service subscription part of use case 13 will be done using the MQTT protocol.
|
|
|
This use case also has a subscription service (reception) to the data for the companies that request it through the MQTT protocol. Below you can find the details of this:
|
|
|
|
|
|
**MQTT (MQ Telemetry Transport)** is a messaging protocol used as a simple and lightweight method to transfer data to / from low-power devices.
|
|
|
|
... | ... | @@ -40,8 +40,47 @@ Subscription to the service of this use case must be through the topic: |
|
|
|
|
|
> usecase13/events
|
|
|
|
|
|
See more information and a connection example [here](https://gitlab.cmobility30.es/dgt3.0_eng/general/-/wikis/MQTT).
|
|
|
In the topic, the events are published in JSON format. Here you can see an example:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"beaconTypeId": 1,
|
|
|
"timestamp": "2021-06-02T13:34:56.747Z",
|
|
|
"lon": -4.304818,
|
|
|
"lat": 41.312456,
|
|
|
"eventTypeId": 1,
|
|
|
"speed": 85,
|
|
|
"provinceId": 40,
|
|
|
"road": "A-601",
|
|
|
"pk": 64.73,
|
|
|
"direction": "UP"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
- beaconTypeId (integer number): beacon type identifier. 1 = Individual, 2 = Group
|
|
|
|
|
|
- timestamp (UTC time): date and time in UTC format of when the event was generated. It must be a maximum of 30 seconds old with respect to UTC time. The date must end with the character 'Z' that marks that it is in UTC
|
|
|
|
|
|
- deviceTypeId (integer number): identifier of the type of device from which the information is sent. 1 = Baliza, 2 = App
|
|
|
|
|
|
- speed (integer number): speed measured in kilometers per hour at which the element is at the moment it sends the event
|
|
|
|
|
|
- provinceId (integer number): identifier of the province where the event is generated according to the [INE](https://www.ine.es/daco/daco42/codmun/cod_provincia_estandar.htm)
|
|
|
|
|
|
- road (integer number): official name of the road where the event is generated
|
|
|
|
|
|
#### Information available:
|
|
|
- pk (integer number): kilometer point where the event is generated
|
|
|
|
|
|
- direction (String): direction of the road where the event is generated. UP = Upward direction, DOWN = Downward direction, UNKNOWN = Unknown
|
|
|
|
|
|
- lonStart (decimal number): longitude in WGS 84 coordinate system where the event was generated
|
|
|
|
|
|
- latStart (decimal number): latitude in WGS 84 coordinate system where the event was generated
|
|
|
|
|
|
- lonEnd (decimal number): longitude in WGS 84 coordinate system where the event was generated
|
|
|
|
|
|
- latEnd (decimal number): latitude in WGS 84 coordinate system where the event was generated
|
|
|
|
|
|
See more information and a connection example [here](https://gitlab.cmobility30.es/dgt3.0_eng/general/-/wikis/MQTT).
|
|
|
|
|
|
The information that is being published in the development environment is a simulation with non-real information that changes throughout the day, so that the consumer interface can be tested. |
|
|
**Note:** *The information that is being published in the development environment is a simulation with non-real information that changes throughout the day, so that the consumer interface can be tested.* |