Use Case 2 - Remote Patient Health Monitoring

Use Case 2 - Remote Patient Health Monitoring (requiring BLE connection, reading, and writing)

In this use case, you can:

  1. Onboard a device.

  2. Connect to the device.

  3. Perform service discovery.

  4. Write a characteristic.

  5. Read the characteristic.

  6. Disconnect from the device.

The following workflow covers the sequence of operations:

  1. Onboard a device using the SCIM API.

  2. Connect to the device and discover GATT services using the NIPC Connect API.

  3. Write a GATT characteristic to the device using the Data Write API.

  4. Read a GATT characteristic to the device using the Data Read API.

  5. Disconnect the device from the AP using the NIPC Disconnect API.

Onboarding a Device

API Definition

API

Description

POST /scim/v2/Devices

This is the API for onboarding a device.

Request Format for Onboarding the Device without Pairing


curl -k --location 'https: //10.195.78.33:8081/scim/v2/Devices' \
--header 'x-api-key: 5a9095d0457f24518bba93c50d69efe5' \
--header 'Content-Type: application/json' \
--data '
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:Device",
"urn:ietf:params:scim:schemas:extension:ble:2.0:Device",
"urn:ietf:params:scim:schemas:extension:endpointapps:2.0:Device"
],
"deviceDisplayName": "BLE Heart Monitor",
"adminState": true,
"urn:ietf:params:scim:schemas:extension:ble:2.0:Device": {
"versionSupport": [
"5.3"
],
"deviceMacAddress": "EF:00:00:00:00:00",
"isRandom": false,
"mobility": false,
"pairingMethods": [
"urn:ietf:params:scim:schemas:extension:pairingNull:2.0:Device"
],
"urn:ietf:params:scim:schemas:extension:pairingNull:2.0:Device": null
},
"urn:ietf:params:scim:schemas:extension:endpointAppsExt:2.0:Device": {
"onboardingUrl": "onboardApplication",
"deviceControlUrl": [
"controlApplication"
],
"dataReceiverUrl": []
}
}
'

Response Format for Onboarding the Device without Pairing


{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:Device",
"urn:ietf:params:scim:schemas:extension:ble:2.0:Device",
"urn:ietf:params:scim:schemas:extension:endpointapps:2.0:Device"
],
"id": "f837c89a-e1dd-4b90-a446-06016c0d2b75",
"deviceDisplayName": "BLE Heart Monitor",
"adminState": true,
"urn:ietf:params:scim:schemas:extension:ble:2.0:Device": {
"versionSupport": [
"5.3"
],
"deviceMacAddress": "CA:2B:5C:EC:95:46",
"isRandom": false,
"pairingMethods": [
"urn:ietf:params:scim:schemas:extension:pairingNull:2.0:Device"
],
"mobility": false,
"urn:ietf:params:scim:schemas:extension:pairingNull:2.0:Device": null
},
"urn:ietf:params:scim:schemas:extension:endpointAppsExt:2.0:Device": {
"onboardingUrl": "onboardApplication",
"deviceControlUrl": [
"controlApplication"
],
"dataReceiverUrl": []
}
}

Request Format for Onboarding the Device with Pairing


{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:Device",
"urn:ietf:params:scim:schemas:extension:ble:2.0:Device",
"urn:ietf:params:scim:schemas:extension:endpointapps:2.0:Device"
],
"deviceDisplayName": "BLE Heart Monitor",
"adminState": true,
"urn:ietf:params:scim:schemas:extension:ble:2.0:Device": {
"versionSupport": [
"5.3"
],
"deviceMacAddress": "CA:2B:5C:EC:95:46",
"isRandom": false,
"mobility": true,
"pairingMethods": [
"urn:ietf:params:scim:schemas:extension:pairingJustWorks:2.0:Device"
],
"urn:ietf:params:scim:schemas:extension:pairingJustWorks:2.0:Device": {
"key": null
}
},
"urn:ietf:params:scim:schemas:extension:endpointAppsExt:2.0:Device": {
"onboardingUrl": "onboardApplication",
"deviceControlUrl": [
"controlApplication"
],
"dataReceiverUrl": []
}
}

Response Format for Onboarding the Device with Pairing


{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:Device",
"urn:ietf:params:scim:schemas:extension:ble:2.0:Device",
"urn:ietf:params:scim:schemas:extension:endpointapps:2.0:Device"
],
"id": "f837c89a-e1dd-4b90-a446-06016c0d2b75",
"deviceDisplayName": "BLE Heart Monitor",
"adminState": true,
"urn:ietf:params:scim:schemas:extension:ble:2.0:Device": {
"versionSupport": [
"5.3"
],
"deviceMacAddress": "CA:2B:5C:EC:95:46",
"isRandom": false,
"pairingMethods": [
"urn:ietf:params:scim:schemas:extension:pairingJustWorks:2.0:Device"
],
"mobility": true,
"urn:ietf:params:scim:schemas:extension:pairingJustWorks:2.0:Device": {
"key": null
}
},
"urn:ietf:params:scim:schemas:extension:endpointAppsExt:2.0:Device": {
"onboardingUrl": "onboardApplication",
"deviceControlUrl": [
"controlApplication"
],
"dataReceiverUrl": []
}
}

Connecting to a Device

To connect to a BLE device and discover its services, perform the following:

  1. Use the Device ID:

    The device ID is "f837c89a-e1dd-4b90-a446-06016c0d2b75".

  2. Connect the BLE device from the AP:

    Use the device ID to establish a connection with the BLE device from the AP.

  3. Discover Services:

    Discover the services with the following service UUIDs:

    • 1800

    • 2002

    • 1822

    • 180F

API Definition

API

Description

/control/connectivity/connect

This API is used to connect to a device.

Request Format


{
"technology": "ble",
"id": "f837c89a-e1dd-4b90-a446-06016c0d2b75",
"ble": {
"services": [
{
"serviceID": "1800"
},
{
"serviceID": "2022"
},
{
"serviceID": "1822"
},
{
"serviceID": "180F"
}
]
},
"controlApp": "controlApplication"
}

Response Format


{
"status": "SUCCESS",
"id": "f837c89a-e1dd-4b90-a446-06016c0d2b75",
"requestID": "75310f89-79c6-4e7b-93cb-f58a8f18fc57",
"services": [
{
"serviceID": "1800",
"characteristics": [
{
"characteristicID": "3443",
"descriptors": [
{
"descriptorID": "9059"
}
],
"flags": [
"read",
"write",
"notify"
]
}
]
},
{
"serviceID": "2022",
"handle": 1,
"characteristics": [
{
"characteristicID": "8065",
"descriptors": [
{
"descriptorID": "9620"
}
],
"flags": [
"read",
"write",
"notify"
]
}
]
},
{
"serviceID": "1822",
"handle": 2,
"characteristics": [
{
"characteristicID": "8912",
"descriptors": [
{
"descriptorID": "1554"
}
],
"flags": [
"read",
"write",
"notify"
]
}
]
},
{
"serviceID": "180F",
"handle": 3,
"characteristics": [
{
"characteristicID": "2810",
"descriptors": [
{
"descriptorID": "1517"
}
],
"flags": [
"read",
"write",
"notify"
]
}
]
}
]
}

Writing a Characteristic to the Device

API Definition

API

Description

/control/data/write

This API is used to write a characteristic to the device.

Request Format


{
"technology": "ble",
"id": " f837c89a-e1dd-4b90-a446-06016c0d2b75",
"value": "0001",
"ble": {
"serviceID": "1800",
"characteristicID": "2A00"
},
"controlApp": "controlApplication"
}

Response Format


{
"status": "SUCCESS",
"id": " f837c89a-e1dd-4b90-a446-06016c0d2b75",
"requestID": "191bc8f1-927f-4fb0-b0b5-7944ea5b34f0",
"value": "0001"
}

Reading a Characteristic to the Device

API Definition

API

Description

/control/data/read

This API is used to read a characteristic to the device.

Request Format


{
"technology": "ble",
"id": " f837c89a-e1dd-4b90-a446-06016c0d2b75",
"ble": {
"serviceID": "1800",
"characteristicID": "2A00"
},
"controlApp": "controlApplication"
}

Response Format


{
"status": "SUCCESS",
"id": " f837c89a-e1dd-4b90-a446-06016c0d2b75",
"requestID": "8ba846aa-6133-4392-b911-9850a90791f2",
"value": "2342432"
}

Disconnecting the Device

API Definition

API

Description

/control/connectivity/disconnect

This API is used to disconnect the device.

Request Format


{
"technology": "ble",
"id": " f837c89a-e1dd-4b90-a446-06016c0d2b75",
"controlApp": "controlApplication"
}

Response Format


{
"status": "SUCCESS",
"id": " f837c89a-e1dd-4b90-a446-06016c0d2b75",
"requestID": "cb838a8d-775b-4e71-874d-1aa22e61f9af"
}