-
Notifications
You must be signed in to change notification settings - Fork 42
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
Multipacket #186
base: master
Are you sure you want to change the base?
Multipacket #186
Conversation
This is still WIP. In order to test a new wheel must be generated for wirepas messaging based on PR
It is needed to reuse same code to handle multiple packets
def _on_collection_message_received(self, client, userdata, message): | ||
self.logger.info("Collection message received") | ||
try: | ||
collection_message = wirepas_messaging.gateway.api.GenericCollection.from_payload( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (94 > 79 characters)
# pylint: disable=unused-argument | ||
self.logger.info("OTAP process request received") | ||
try: | ||
request = wirepas_messaging.gateway.api.ProcessScratchpadRequest.from_payload( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (90 > 79 characters)
try: | ||
request = wirepas_messaging.gateway.api.ProcessScratchpadRequest.from_payload( | ||
request = wirepas_messaging.gateway.api.UploadScratchpadRequest.from_payload( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (89 > 79 characters)
try: | ||
request = wirepas_messaging.gateway.api.UploadScratchpadRequest.from_payload( | ||
request = wirepas_messaging.gateway.api.GetScratchpadStatusRequest.from_payload( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (92 > 79 characters)
try: | ||
request = wirepas_messaging.gateway.api.SetConfigRequest.from_payload( | ||
request = wirepas_messaging.gateway.api.GetGatewayInfoRequest.from_payload( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (87 > 79 characters)
# pylint: disable=unused-argument | ||
self.logger.info("Set config request received") | ||
""" | ||
This function doesn't need the decorator @deferred_thread as request is handled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (87 > 79 characters)
|
||
if send: | ||
# TODO list can contain more than max packets. Should be tested somwhere | ||
if self.on_packets_ready_cb(self._messages_list, self.filter_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (87 > 79 characters)
send = True | ||
|
||
if send: | ||
# TODO list can contain more than max packets. Should be tested somwhere |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (92 > 79 characters)
|
||
def run(self): | ||
""" | ||
Main queue loop that is in charge of creating and sending the packet when needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (88 > 79 characters)
Brief description
Implement collection of generic message.
For now groups are defined in the code directly for testing purpose. Dynamic config will be added in one of the next steps.
This change required the PR: wirepas/backend-apis#124
Remaining items
.Add grouping configuration (from API and config file)
Save group config in case of restart
Define the final topics for collection message
Fix synchro in packet queue to avoid group of messages exceeding the max number of element
Try to determine the final size of a packet group without serializing the message to avoid too much computing (with some margin)