Skip to content

Commit

Permalink
Implement data booking with CChainLink
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas-Menzel committed Mar 22, 2023
1 parent cac48c2 commit 10f0dff
Show file tree
Hide file tree
Showing 6 changed files with 301 additions and 122 deletions.
74 changes: 43 additions & 31 deletions Documentation/API/ASK.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,20 +452,21 @@ The `data_type` is `aircraft_location`.

**response_data field**

| FIELD | TYPE | VALUE SET? | INFORMATION |
|--------------------------|---------|------------|------------------------------------------------|
| gps_signal_level | int | always | 0 (no gps signal) - 5 (very good gps signal) |
| gps_satellites_connected | int | always | Number of gps-satellites connected. |
| gps_valid | boolean | always | Whether the drone has a (valid) gps-signal. |
| gps_lat | float | always | Latitude. |
| gps_lon | float | always | Longitude. |
| altitude | float | always | In meters. |
| velocity_x | float | always | Velocity X (towards north) in meters / second. |
| velocity_y | float | always | Velocity Y (towards east) in meters / second. |
| velocity_z | float | always | Velocity Z (towards down) in meters / second. |
| pitch | float | always | [-180;180]. |
| yaw | float | always | [-180;180]. |
| roll | float | always | [-180;180]. |
| FIELD | TYPE | VALUE SET? | INFORMATION |
|--------------------------|---------|------------|----------------------------------------------------|
| transaction_uuid | string | always | UUID of the dataset transaction in the blockchain. |
| gps_signal_level | int | always | 0 (no gps signal) - 5 (very good gps signal) |
| gps_satellites_connected | int | always | Number of gps-satellites connected. |
| gps_valid | boolean | always | Whether the drone has a (valid) gps-signal. |
| gps_lat | float | always | Latitude. |
| gps_lon | float | always | Longitude. |
| altitude | float | always | In meters. |
| velocity_x | float | always | Velocity X (towards north) in meters / second. |
| velocity_y | float | always | Velocity Y (towards east) in meters / second. |
| velocity_z | float | always | Velocity Z (towards down) in meters / second. |
| pitch | float | always | [-180;180]. |
| yaw | float | always | [-180;180]. |
| roll | float | always | [-180;180]. |

<details><summary>Sample response</summary><p>

Expand All @@ -475,6 +476,8 @@ The `data_type` is `aircraft_location`.
"errors": [],
"warnings": [],
"response_data": {
"transaction_uuid": "00000000-0000-0000-000000000000",

"gps_signal_level": 5,
"gps_satellites_connected": 12,

Expand Down Expand Up @@ -542,12 +545,13 @@ The `data_type` is `aircraft_power`.

**response_data field**

| FIELD | TYPE | VALUE SET? | INFORMATION |
|---------------------------|-------|------------|-------------|
| battery_remaining | int | always | In mAh. |
| battery_remaining_percent | int | always | In %. |
| remaining_flight_time | int | always | In seconds. |
| remaining_flight_radius | float | always | In meters. |
| FIELD | TYPE | VALUE SET? | INFORMATION |
|---------------------------|--------|------------|----------------------------------------------------|
| transaction_uuid | string | always | UUID of the dataset transaction in the blockchain. |
| battery_remaining | int | always | In mAh. |
| battery_remaining_percent | int | always | In %. |
| remaining_flight_time | int | always | In seconds. |
| remaining_flight_radius | float | always | In meters. |

<details><summary>Sample response</summary><p>

Expand All @@ -557,8 +561,11 @@ The `data_type` is `aircraft_power`.
"errors": [],
"warnings": [],
"response_data": {
"transaction_uuid": "00000000-0000-0000-000000000000",

"battery_remaining": 4500,
"battery_remaining_percent": 42,

"remaining_flight_time": 550,
"remaining_flight_radius": 4320.5
}
Expand Down Expand Up @@ -613,17 +620,18 @@ The `data_type` is `flight_data`.

**response_data field**

| FIELD | TYPE | VALUE SET? | INFORMATION |
|-------------------|-------------------------|------------|-----------------------------|
| takeoff_time | int | always | UNIX timestamp. |
| takeoff_gps_valid | boolean | always | GPS-coordinates valid? |
| takeoff_gps_lat | float | always | Latitude. |
| takeoff_gps_lon | float | always | Longitude. |
| landing_time | int | always | UNIX timestamp. |
| landing_gps_valid | boolean | always | GPS-coordinates valid? |
| landing_gps_lat | float | always | Latitude. |
| landing_gps_lon | float | always | Longitude. |
| operation_modes | [string] as json-string | always | The last X Operation Modes. |
| FIELD | TYPE | VALUE SET? | INFORMATION |
|-------------------|-------------------------|------------|----------------------------------------------------|
| transaction_uuid | string | always | UUID of the dataset transaction in the blockchain. |
| takeoff_time | int | always | UNIX timestamp. |
| takeoff_gps_valid | boolean | always | GPS-coordinates valid? |
| takeoff_gps_lat | float | always | Latitude. |
| takeoff_gps_lon | float | always | Longitude. |
| landing_time | int | always | UNIX timestamp. |
| landing_gps_valid | boolean | always | GPS-coordinates valid? |
| landing_gps_lat | float | always | Latitude. |
| landing_gps_lon | float | always | Longitude. |
| operation_modes | [string] as json-string | always | The last X Operation Modes. |

<details><summary>Sample response</summary><p>

Expand All @@ -633,14 +641,18 @@ The `data_type` is `flight_data`.
"errors": [],
"warnings": [],
"response_data": {
"transaction_uuid": "00000000-0000-0000-000000000000",

"takeoff_time": 1678264333,
"takeoff_gps_valid": "1",
"takeoff_gps_lat": 48.26586,
"takeoff_gps_lon": 11.67436,

"landing_time": 1678264389,
"landing_gps_valid": "1",
"landing_gps_lat": 48.26586,
"landing_gps_lon": 11.67436,

"operation_modes": "[\"OnGround\", \"Landing\", \"Hovering\", \"TakeOff\", \"OnGround\"]"
}
}
Expand Down
177 changes: 117 additions & 60 deletions Documentation/API/TELL.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,64 +134,6 @@ If one or more warnings occured, they are added to the warnings list.

## Interfaces

### aircraft_location

One can send information about the location of a drone.

#### Request

The `data_type` is `aircraft_location`.

**Payload - data field (required)**

| FIELD | TYPE | REQ / OPT | INFORMATION |
|--------------------------|---------|-----------|----------------------------------------------|
| gps_signal_level | int | required | 0 (no gps signal) - 5 (very good gps signal) |
| gps_satellites_connected | int | required | Number of gps-satellites connected. |
| gps_valid | boolean | required | Whether the drone has a (valid) gps-signal. |
| gps_lat | float | required | Latitude. |
| gps_lon | float | required | Longitude. |
| altitude | float | required | Altitude in meters. |
| velocity_x | float | required | Velocity X in meters / second. |
| velocity_y | float | required | Velocity Y in meters / second. |
| velocity_z | float | required | Velocity Z in meters / second. |
| pitch | float | required | [-180;180]. |
| yaw | float | required | [-180;180]. |
| roll | float | required | [-180;180]. |

<details><summary>Sample payload</summary><p>

```json
{
"drone_id": "demo_drone",
"data_type": "aircraft_location",
"data": {
"gps_signal_level": 5,
"gps_satellites_connected": 12,

"gps_valid": true,
"gps_lat": 48.26586,
"gps_lon": 11.67436,

"altitude": 42,

"velocity_x": 0,
"velocity_y": 0,
"velocity_z": 0,

"pitch": 0,
"yaw": 0,
"roll": 0
}
}
```

</details>

#### Response

Standard response. The `response_data` field is never set.

### intersection_location

One can send information about the location of an intersection. The intersection
Expand Down Expand Up @@ -268,6 +210,83 @@ corridor.

Standard response. The `response_data` field is never set.

### aircraft_location

One can send information about the location of a drone.

#### Request

The `data_type` is `aircraft_location`.

**Payload - data field (required)**

| FIELD | TYPE | REQ / OPT | INFORMATION |
|--------------------------|---------|-----------|----------------------------------------------|
| gps_signal_level | int | required | 0 (no gps signal) - 5 (very good gps signal) |
| gps_satellites_connected | int | required | Number of gps-satellites connected. |
| gps_valid | boolean | required | Whether the drone has a (valid) gps-signal. |
| gps_lat | float | required | Latitude. |
| gps_lon | float | required | Longitude. |
| altitude | float | required | Altitude in meters. |
| velocity_x | float | required | Velocity X in meters / second. |
| velocity_y | float | required | Velocity Y in meters / second. |
| velocity_z | float | required | Velocity Z in meters / second. |
| pitch | float | required | [-180;180]. |
| yaw | float | required | [-180;180]. |
| roll | float | required | [-180;180]. |

<details><summary>Sample payload</summary><p>

```json
{
"drone_id": "demo_drone",
"data_type": "aircraft_location",
"data": {
"gps_signal_level": 5,
"gps_satellites_connected": 12,

"gps_valid": true,
"gps_lat": 48.26586,
"gps_lon": 11.67436,

"altitude": 42,

"velocity_x": 0,
"velocity_y": 0,
"velocity_z": 0,

"pitch": 0,
"yaw": 0,
"roll": 0
}
}
```

</details>

#### Response

**response_data field**

| FIELD | TYPE | VALUE SET? | INFORMATION |
|------------------|--------|------------|----------------------------------------------------|
| transaction_uuid | string | always | UUID of the dataset transaction in the blockchain. |

<details><summary>Sample response</summary><p>

```json
{
"executed": true,
"errors": [],
"warnings": [],
"response_data": {
"transaction_uuid": "00000000-0000-0000-000000000000",
}
}
```

</details>

### aircraft_power

One can send information about the state of charge and range of a drone.
Expand Down Expand Up @@ -304,7 +323,26 @@ The `data_type` is `aircraft_power`.

#### Response

Standard response. The `response_data` field is never set.
**response_data field**

| FIELD | TYPE | VALUE SET? | INFORMATION |
|------------------|--------|------------|----------------------------------------------------|
| transaction_uuid | string | always | UUID of the dataset transaction in the blockchain. |

<details><summary>Sample response</summary><p>

```json
{
"executed": true,
"errors": [],
"warnings": [],
"response_data": {
"transaction_uuid": "00000000-0000-0000-000000000000",
}
}
```

</details>

### flight_data

Expand Down Expand Up @@ -353,4 +391,23 @@ The `data_type` is `flight_data`.

#### Response

Standard response. The `response_data` field is never set.
**response_data field**

| FIELD | TYPE | VALUE SET? | INFORMATION |
|------------------|--------|------------|----------------------------------------------------|
| transaction_uuid | string | always | UUID of the dataset transaction in the blockchain. |

<details><summary>Sample response</summary><p>

```json
{
"executed": true,
"errors": [],
"warnings": [],
"response_data": {
"transaction_uuid": "00000000-0000-0000-000000000000",
}
}
```

</details>
Loading

0 comments on commit 10f0dff

Please sign in to comment.