Open
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( |
| # pylint: disable=unused-argument | ||
| self.logger.info("OTAP process request received") | ||
| try: | ||
| request = wirepas_messaging.gateway.api.ProcessScratchpadRequest.from_payload( |
| self.logger.info("OTAP upload request received") | ||
| try: | ||
| request = wirepas_messaging.gateway.api.ProcessScratchpadRequest.from_payload( | ||
| request = wirepas_messaging.gateway.api.UploadScratchpadRequest.from_payload( |
| self.logger.info("OTAP status request received") | ||
| try: | ||
| request = wirepas_messaging.gateway.api.UploadScratchpadRequest.from_payload( | ||
| request = wirepas_messaging.gateway.api.GetScratchpadStatusRequest.from_payload( |
| self.logger.info("Gateway info request received") | ||
| try: | ||
| request = wirepas_messaging.gateway.api.SetConfigRequest.from_payload( | ||
| request = wirepas_messaging.gateway.api.GetGatewayInfoRequest.from_payload( |
| # pylint: disable=unused-argument | ||
| self.logger.info("Set config request received") | ||
| """ | ||
| This function doesn't need the decorator @deferred_thread as request is handled |
|
|
||
| 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): |
| send = True | ||
|
|
||
| if send: | ||
| # TODO list can contain more than max packets. Should be tested somwhere |
|
|
||
| def run(self): | ||
| """ | ||
| Main queue loop that is in charge of creating and sending the packet when needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)