Skip to content

Commit

Permalink
Merge branch 'master' into 'public'
Browse files Browse the repository at this point in the history
Publish recent schema updates/fix

See merge request pimplapps/tjf!24
  • Loading branch information
1000len-stpa committed Feb 16, 2024
2 parents f7305c6 + 9a23e0d commit 20fc34c
Show file tree
Hide file tree
Showing 4 changed files with 593 additions and 57 deletions.
61 changes: 4 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tjf - Testo JSON format
This repository contains the schema definitions of the Testo JSON format (tjf).
The tjf is used for app to app (App2App) and device to device (Dev2Dev) communication with testo apps and devices.
The tjf is used for app to app (App2App), device to device (Dev2Dev) communication and exports with testo apps and devices.

App2App is included into the following apps:

Expand Down Expand Up @@ -31,6 +31,8 @@ Dev2Dev over Bluetooth Low Energy (BLE) is included into the following apps / de
| --------- | -----|
| testo 300 | t300 |

For more Information and examples please visit [Testo Interfaces](https://developers.testo.dev/t300/device-to-device/ "Visit developers.testo.dev")

## Inter App Communication / App to App interface (App2App)
Most testo apps can be called via an app to app interface (App2App) and report data back to the caller. This interface is available in the following apps and devices:

Expand All @@ -42,63 +44,8 @@ Most testo apps can be called via an app to app interface (App2App) and report d
| testo 400 | testosmartprobes | Yes | No |
| testo Smart | testosmartprobes | Yes | Yes |

### Workflow
In the following examples `testosmartprobes` is used as a placeholder. Replace it with the proper application ID according to the table above. `com.example.demoapplication` is a placeholder for the app identifier of the caller.
1. Open `testosmartprobes://start?bundleid=com.example.demoapplication` via your application
2. Testo app will open, the measurement is performed (or a saved measurement is opened) and the export via JSON/TJF is selected.
3. Testo app opens an url like this: `testoapp+com.example.demoapplication://data?json=[base64_encoded_json_data]`.
4. Caller app receives the url and decodes the data. **Important:** to make the base64 URL compatible the testo app will replace some special characters, make sure to revert this after you receive the data. See the table below for more details.

| Special character | Replacement in URL |
| ----------------- | ------------------ |
| Plus `+` | Minus `-` |
| Forward-Slash `/` | Underscore `_` |
| Equal Sign `=` | Colon `,` |
For more Information and examples please visit [Testo Interfaces](https://developers.testo.dev/app-to-app/ "Visit developers.testo.dev")

## Questions ?
For questions/comments to the developer please create an issue with the corresponding label!

## Extended schema
The extended schema is designed to hold all possibly necessary data a measurement can contain.

### Changelog

#### 1.0.5 (07/2019)
- Added optional property "id" to the measurement type.
- Added optional property "id" to the measurement property type.
- xmlid, description are now marked optional

#### 1.0.4 (12/2017)
- Added property `errors`

#### 1.0.3 (10/2017)
Added optional properties `xmlid`
- `channelunit` : add optional property `xmlid`
- an optional property `xmlid` has been added to `channelunit`
which contains a mapping from the `channelunit` property `name` to XML ID Unit
- `channeltype` : add optional property `xmlid`
- an optional property `xmlid` has been added to `channeltype`
which contains a mapping from the `channeltype` property `name` to XML ID Channel Name

#### 1.0.2
- the 'value' property of measurementvalue now allows null values, indicating an invalid value.


#### 1.0.1
- the definition of the channeltype has been changed in the following way:
- an additional property 'description' has been added, which now contains the value from 'name' but (possibly) translated into the current application language
- 'name' will now never be a translated string
- the documentation of properties of measurementvalue has been enhanced to reflect that in case the 'value' property contains an invalid value the 'description' property will contain a string like '----' or similar
- the 'value' property of measurementpropertyvalue can now be a number or a string


#### 1.0.0
- initial version of the schema


## Slim schema
The slim schema is designed to hold a big amount of data, this means it omits a lot of meta data and redundant information.

### Changelog
#### v1.0.6
First publicly available version of the schema.
14 changes: 14 additions & 0 deletions schema/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# tjf - schema definitions

The schemas nested within folders are remnants of a legacy system, retained primarily for compatibility reasons. However, for the majority of users, these schemas serve little purpose in the modern context and can be safely disregarded.

## measurementCollection
The schema represents a structured collection of individual measurements like defined in [slim-schema](#slim-schema), each independent of the others. This collection is further enriched with some additional features, similar to those in slim-schema but only a small subset.

## slim-schema
The schema delineates a comprehensive data structure exported by Testo applications. It encompasses various components, including measurements, device channels, customer and organization details, measuring point information, and measurement properties.

## measurement-slim
This JSON schema, crucially used by the Testo 300 device when exporting measurement data using a QR code, defines a structured data object.

Additionally, for those interested in delving deeper into the QR code functionality of the Testo 300 device, further information can be found at [this link](https://developers.testo.dev/t300/qrcode/).
119 changes: 119 additions & 0 deletions schema/measurementCollection-v1.1.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A collection of measurements",
"type": "object",
"properties": {
"additionalMeasurementInformation": {
"description": "Additional information about the measurement",
"type": "array",
"items": {
"$ref": "#/definitions/measurementadditionalproperty"
}
},
"measurements": {
"description": "An array of measurements that is part of this collection",
"type": "array",
"items": {
"$ref": "https://raw.githubusercontent.com/testo/tjf/public/schema/slim-schema-v1.2.0.json"
}
},
"customer": {
"description": "Customer contact information",
"$ref": "#/definitions/contact"
},
"organisation": {
"description": "Organisation contact information",
"$ref": "#/definitions/contact"
},
"images": {
"description": "An array of image filenames",
"type": "array",
"items": {
"type": "string"
}
},
"timeStamp": {
"description": "The time when the whole data set was created, unix timestamp in milliseconds",
"type": ["number","string"]
},
"type": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
]
}
},
"required": [
"additionalMeasurementInformation",
"timeStamp",
"type"
],
"definitions": {
"contact": {
"description": "An object containing contact information",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"phone": {
"type": "string"
},
"email": {
"type": "string"
},
"personOfContact": {
"type": "string"
},
"fax": {
"type": "string"
},
"homepage": {
"type": "string"
},
"logo": {
"type": "string"
}
}
},
"measurementadditionalproperty": {
"description": "A description of an additional property of a measurement",
"type": "object",
"properties": {
"name": {
"description": "The name of the property, translated into the current language of the application",
"type": "string"
},
"description": {
"description": "The description of the property, translated into the current language of the application",
"type": "string"
},
"value": {
"description": "Additional value",
"type": [ "string", "integer", "number", "array", "object", "boolean" ],
"optional": true
}
},
"required": [ "name" ],
"additionalProperties": false
}
}
}
Loading

0 comments on commit 20fc34c

Please sign in to comment.