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

Added MQTTv5 UTransport methods #1

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

matthewd0123
Copy link

  • Added UTransport (send, registerlistener, unregisterlistener) methods
  • Added pub/sub examples for testing.
  • Updated README with information on installation and use.
  • Added necessary legal/contributing documents
  • Added publish workflow

* Added UTransport (send, registerlistener, unregisterlistener) methods
* Added pub/sub examples for testing.
* Updated README with information on installation and use.
* Added necessary legal/contributing documents
* Added publish workflow
@matthewd0123
Copy link
Author

#2

@matthewd0123 matthewd0123 marked this pull request as draft March 19, 2024 03:45
---

=== Using UTransport APIs

Choose a reason for hiding this comment

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

In this scenario you have this listed as mqtt5_subscriber. Would an mqtt5_subscriber be initialized the same way as it is done in Creating a Instance of MQTT5UTransport?

All Properties in UAttributes will be mapped to MQTT Publish Properties. As Such, I have added this into the UTransport.

nb: I am using the in-built Base64ProtobufSerializer() methods to serialize and deserialize the UUIDs (id and reqid). This implementation may change.
* Testing Send and RegisterListener using paho.mqtt FakeBroker and Pytest
* Support all userproperties mapping to UAttributes
@matthewd0123 matthewd0123 marked this pull request as ready for review May 13, 2024 12:32

return UStatus(code=UCode.OK, message="OK")

def register_listener(self, topic: UUri, listener: UListener) -> UStatus:

Choose a reason for hiding this comment

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

I believe that there is a PR currently out for 1.5.8 that updates the register_listener, unregister_listener and receive functions to use a source_filter and a sink_filter. @sophokles73 and @stevenhartley, is this correct that the uTransport spec change is expected to get in for 1.5.8?

Choose a reason for hiding this comment

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

yes, the corresponding PR is eclipse-uprotocol/up-spec#134 which will go into 1.5.8

@@ -0,0 +1,100 @@
# Copyright (C) 2021

Choose a reason for hiding this comment

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

This file and some other files in test have this license. Is this the correct license?

Choose a reason for hiding this comment

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

No, it refers to the EPL but uProtocol uses the Apache Software License 2.0. It should be

# SPDX-FileCopyrightText: 2021 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0

Copy link
Author

Choose a reason for hiding this comment

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

@devkelley @sophokles73 for some of the files in tests folder, I have brought in test code from the paho.mqtt.python project, which is an eclipse project (https://github.com/eclipse/paho.mqtt.python/tree/master/tests). I have used the licensing that they used in some of their files. Can one of you let me know if there is a different way to reference that I'm using their code, or if it's even allowed to take code from other eclipse projects?

Choose a reason for hiding this comment

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

Hmm, that is a good question. I am sure it depends partly on the EPL-2.0 license and what that stipulates. This FAQ seems to imply that it is okay to include as long as you include where you got the code from and the license (https://www.eclipse.org/legal/epl-2.0/faq.php). That being said it would probably be good to verify with someone from eclipse foundation

* Update MQTT Client and examples to 1.5.8
* Format to align with ruff standards
* Add linter to workflow
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.

None yet

3 participants