SMACC2
Loading...
Searching...
No Matches
cb_monitor_connection.cpp
Go to the documentation of this file.
1// Copyright 2024 RobosoftAI Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
16
17namespace cl_gcalcli
18{
19
21{
22 RCLCPP_INFO(getLogger(), "[CbMonitorConnection] Starting connection monitoring");
23
25
26 if (!client_)
27 {
28 RCLCPP_ERROR(getLogger(), "[CbMonitorConnection] ClGcalcli client not available");
29 return;
30 }
31
33 if (!connection_)
34 {
35 RCLCPP_ERROR(getLogger(), "[CbMonitorConnection] CpGcalcliConnection not available");
36 return;
37 }
38
39 // Connect to connection state signals
42}
43
45{
46 RCLCPP_DEBUG(getLogger(), "[CbMonitorConnection] Stopping connection monitoring");
47}
48
50{
51 RCLCPP_WARN(getLogger(), "[CbMonitorConnection] Connection lost detected");
52}
53
55{
56 RCLCPP_INFO(getLogger(), "[CbMonitorConnection] Connection restored");
57}
58
59} // namespace cl_gcalcli
CpGcalcliConnection * getConnection()
smacc2::SmaccSignalConnection onConnectionLost(void(T::*callback)(), T *object)
smacc2::SmaccSignalConnection onConnectionRestored(void(T::*callback)(), T *object)
virtual rclcpp::Logger getLogger() const
void requiresClient(SmaccClientType *&storage)