-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/propagate platform connection (#74)
* Added Platform Status Service and the message to send * Integrated Platform Status Service * Sending CONNECTED/OFFLINE for platform connection status * Removed slash on topic * Changer order of connection * Bumped the version to v4.3.1 * Platform connection messages retained; Set as lastwill; * Removed const qualifier in function argument; Log message publish; Co-authored-by: nanavuletic <nenad.vuletic@wolkabout.com>
- Loading branch information
1 parent
0cdfce7
commit e738543
Showing
11 changed files
with
123 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
wolkgateway (4.3.0) stable; urgency=medium | ||
wolkgateway (4.3.1) stable; urgency=medium | ||
|
||
* Created WolkDefault and WolkExternal that provide different interfaces for custom subdevice data providing. | ||
* Introduced the FSFileRepository to provide info about FileManagement files from the File System. | ||
* Disabled the Gateway Update message sending and mechanisms as they have been found unnecessary. | ||
* Imported the newest WolkSDK-Cpp that introduces various fixes and improvements. | ||
* Moved the version file when firmware installing to a different location. Also, finishing the install method with `true` now reports success. | ||
* Introduced the custom data and device status protocols, that allow us to define custom MQTT topics/payloads for those messages. | ||
* Added the FileListener interface for FileManagementService to allow input into the File Management process and allow for hooks. | ||
* Made optimizations for the application to be built as a submodule. | ||
* Implemented sending of `p2d/connection_status` message to the local broker, to announce platform connection state to the modules. | ||
|
||
-- Wolkabout ELab <elab@wolkabout.com> Fri, 14 May 2021 00:00:00 +0100 | ||
-- Wolkabout ELab <elab@wolkabout.com> Wed, 08 Dec 2021 00:00:00 +0100 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2021 WolkAbout Technology s.r.o. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "PlatformStatusService.h" | ||
|
||
#include "core/connectivity/ConnectivityService.h" | ||
#include "core/model/Message.h" | ||
#include "core/utilities/Logger.h" | ||
#include "protocol/GatewayStatusProtocol.h" | ||
|
||
namespace wolkabout | ||
{ | ||
|
||
PlatformStatusService::PlatformStatusService(ConnectivityService& connectivityService, GatewayStatusProtocol& protocol) | ||
: m_connectivityService(connectivityService), m_protocol(protocol) | ||
{ | ||
} | ||
|
||
void PlatformStatusService::sendPlatformConnectionStatusMessage(bool connected) | ||
{ | ||
std::shared_ptr<Message> message = m_protocol.makePlatformConnectionStatusMessage(connected); | ||
if(!message) | ||
{ | ||
return; | ||
} | ||
|
||
if(!m_connectivityService.publish(message, true)) | ||
{ | ||
LOG(DEBUG) << "PlatformStatusService: Failed to send platform status message"; | ||
} | ||
else | ||
{ | ||
LOG(DEBUG) << "PlatformStatusService: Published platform status message"; | ||
} | ||
} | ||
|
||
} // namespace wolkabout |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2021 WolkAbout Technology s.r.o. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef PLATFORMSTATUSSERVICE_H | ||
#define PLATFORMSTATUSSERVICE_H | ||
|
||
namespace wolkabout | ||
{ | ||
class ConnectivityService; | ||
class GatewayStatusProtocol; | ||
|
||
class PlatformStatusService | ||
{ | ||
public: | ||
PlatformStatusService(ConnectivityService& connectivityService, GatewayStatusProtocol& protocol); | ||
void sendPlatformConnectionStatusMessage(bool connected); | ||
|
||
private: | ||
ConnectivityService& m_connectivityService; | ||
GatewayStatusProtocol& m_protocol; | ||
}; | ||
|
||
} // namespace wolkabout | ||
#endif // PLATFORMSTATUSSERVICE_H |