AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
DBusConnection.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_BLUETOOTHIMPLEMENTATIONS_BLUEZ_INCLUDE_BLUEZ_DBUSCONNECTION_H_
17 #define ALEXA_CLIENT_SDK_BLUETOOTHIMPLEMENTATIONS_BLUEZ_INCLUDE_BLUEZ_DBUSCONNECTION_H_
18 
19 #include <memory>
20 #include <mutex>
21 #include <vector>
22 
23 #include <gio/gio.h>
24 
25 namespace alexaClientSDK {
26 namespace bluetoothImplementations {
27 namespace blueZ {
28 
33 public:
38 
45  static std::unique_ptr<DBusConnection> create(GBusType connectionType = G_BUS_TYPE_SYSTEM);
46 
62  unsigned int subscribeToSignal(
63  const char* serviceName,
64  const char* interfaceName,
65  const char* member,
66  const char* firstArgumentFilter,
67  GDBusSignalCallback callback,
68  gpointer userData);
69 
75  GDBusConnection* getGDBusConnection();
76 
80  void close();
81 
82 private:
89  explicit DBusConnection(GDBusConnection* connection, GBusType connectionType);
90 
92  GDBusConnection* m_connection;
93 
95  const GBusType m_connectionType;
96 
98  std::mutex m_subscriptionsMutex;
99 
101  std::vector<guint> m_subscriptions;
102 };
103 
104 } // namespace blueZ
105 } // namespace bluetoothImplementations
106 } // namespace alexaClientSDK
107 
108 #endif // ALEXA_CLIENT_SDK_BLUETOOTHIMPLEMENTATIONS_BLUEZ_INCLUDE_BLUEZ_DBUSCONNECTION_H_
unsigned int subscribeToSignal(const char *serviceName, const char *interfaceName, const char *member, const char *firstArgumentFilter, GDBusSignalCallback callback, gpointer userData)
static std::unique_ptr< DBusConnection > create(GBusType connectionType=G_BUS_TYPE_SYSTEM)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0