Skip to content

allow receive commands by CB notifications#1560

Merged
fgalan merged 44 commits intomasterfrom
task/notify_cmd
May 22, 2025
Merged

allow receive commands by CB notifications#1560
fgalan merged 44 commits intomasterfrom
task/notify_cmd

Conversation

@AlvaroVega
Copy link
Copy Markdown
Member

@AlvaroVega AlvaroVega commented Jan 25, 2024

This PR does not modify current commands based on CB registrations. It's backward compatible and adds a new way of receive command through a CB notification.

related issue #1455

  • Update doc

@AlvaroVega AlvaroVega changed the title [WIP] Task/notify cmd Task/notify cmd Feb 5, 2024
@AlvaroVega AlvaroVega changed the title Task/notify cmd allow receive commands by CB notifications Feb 5, 2024
@AlvaroVega AlvaroVega marked this pull request as ready for review February 5, 2024 15:29
@AlvaroVega AlvaroVega requested a review from fgalan February 5, 2024 15:30
Comment thread doc/devel/northboundinteractions.md Outdated

In this case relevant fields are just `targetEntityId`, `targetEntityType`, `cmd` and `params`.

The IoT Agent detects the selected attribute is a command, and replies to the Context Broker with a 200 OK (without payload).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that

[
    {
        "type": "device",
        "id": "Dev0001",
        "switch": {
            "type": "command",
            "value": ""
        }
    }
]

is not a valid response for a notification. It should be 200 OK or 204 No Content (maybe that later one is more appropiate).

(Actually it is not a valid response also for a update, in the "classic" mode, see https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#update-post-v2opupdate. It should be 204 No Content)

Comment thread doc/devel/northboundinteractions.md Outdated
Comment thread lib/model/Command.js
Comment on lines +34 to +42
execTs: { type: Date },
status: Object,
info: Object,
onDelivered: Object,
onOk: Object,
onError: Object,
onInfo: Object,
cmdExecution: Object,
dateExpiration: { type: Date },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that PR #1717 has been merged... should these fields also added to database model doc?

Comment thread CHANGES_NEXT_RELEASE Outdated
}
]
```
The IoT Agent detects the selected attribute is a command, and replies to the Context Broker with a 204 OK (without payload).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems documentation was not aligned with the code in this case.

Copy link
Copy Markdown
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member Author

@AlvaroVega AlvaroVega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fgalan
Copy link
Copy Markdown
Member

fgalan commented May 22, 2025

LGTM

@fgalan fgalan merged commit f76042c into master May 22, 2025
6 of 7 checks passed
@fgalan fgalan deleted the task/notify_cmd branch May 22, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants