Skip to content

Commit

Permalink
fix(senML): handle timestamp only object
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Sep 26, 2024
1 parent 1ebabf0 commit 55a4547
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
47 changes: 47 additions & 0 deletions features/ButtonPresses.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
exampleContext:
fingerprint: 92b.y7i24q
fingerprint_deviceId: oob-352656108602296
ts: 1694503339523
APIURL: https://api.hello.nordicsemi.cloud
---

# Publish Button presses

> Button presses are special in that they only have a Time resource and use the
> instance ID to signify the ID of the pressed button.
## Background

Given I have the fingerprint for a `PCA20065` device in `fingerprint`

And I connect to the websocket using fingerprint `${fingerprint}`

## Receive published button press

Given I store `$millis()` into `ts`

When the device `${fingerprint_deviceId}` does a `POST` to this CoAP resource
`/msg/d2c/raw` with this SenML payload

```json
[
{
"bn": "14220/1/",
"bt": "$number{$floor(ts/1000)}"
}
]
```

Soon I should receive a message on the websocket that matches

```json
{
"@context": "https://github.com/hello-nrfcloud/proto/lwm2m/object/update",
"ObjectID": 14220,
"ObjectInstanceID": 1,
"Resources": {
"99": "$number{$floor(ts/1000)}"
}
}
```
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"@hello.nrfcloud.com/lambda-helpers": "2.0.30",
"@hello.nrfcloud.com/nrfcloud-api-helpers": "6.0.2",
"@hello.nrfcloud.com/proto": "15.3.0",
"@hello.nrfcloud.com/proto-map": "16.1.7",
"@hello.nrfcloud.com/proto-map": "16.1.8",
"@middy/core": "5.5.0",
"@middy/input-output-logger": "5.5.0",
"@sinclair/typebox": "0.33.12",
Expand Down

0 comments on commit 55a4547

Please sign in to comment.