Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the table for listeners to distinguish different message types. #188

Merged
merged 5 commits into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions up-l1/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,38 @@ end
deactivate T
----

In RegisterListener API, we have the source and sink `UUri` in the arguments.
However, not all the combinations of source and sink `UUri` are valid.

The following table are the valid combinations, which maps to the corresponding user case.

[%autowidth]
|===
| source `resource_id` | sink `resource_id` | Publish | Notification | Request | Response | Use Case

| [8000-FFFE] | None | V | | | | A uE listens for a specific published message
| [8000-FFFE] | 0 | | V | | | A uE listens for a specific notification message
| 0 | [1-7FFF] | | | V | | A uE listens for a specific request
| [1-7FFF] | 0 | | | | V | A uE listens for a specific response
| FFFF | 0 | | V | | V | A uE listens for all notifications and responses
| FFFF | FFFF | | V | V | V | uStreamer listens for all notifications, requests, and responses
evshary marked this conversation as resolved.
Show resolved Hide resolved
|===

Note that other combinations not in the table *MUST* never be used in RegisterListener API.
evshary marked this conversation as resolved.
Show resolved Hide resolved

Sometimes it's necessary to distinguish the message types which should be listened to.
We can get the message types by reorganizing the table above to the following one.

[%autowidth]
|===
| Message Type | Possible resource_id combinations {src_resource_id, sink_resource_id}

| Publish | {[8000-FFFE], None}
| Notification | {[8000-FFFE], 0}, {FFFF, 0}, {FFFF, FFFF}
| Request | {0, [1-7FFF]}, {FFFF, FFFF}
| Response | {[1-7FFF], 0}, (FFFF, 0), {FFFF, FFFF}
|===

[#unregister-listener]
=== UnregisterListener

Expand Down