16 #ifndef ALEXA_CLIENT_SDK_BLUETOOTHIMPLEMENTATIONS_BLUEZ_INCLUDE_BLUEZ_PULSEAUDIOBLUETOOTHINITIALIZER_H_ 17 #define ALEXA_CLIENT_SDK_BLUETOOTHIMPLEMENTATIONS_BLUEZ_INCLUDE_BLUEZ_PULSEAUDIOBLUETOOTHINITIALIZER_H_ 19 #include <condition_variable> 26 #include "pulse/pulseaudio.h" 29 namespace bluetoothImplementations {
56 ,
public std::enable_shared_from_this<PulseAudioBluetoothInitializer> {
77 static std::shared_ptr<PulseAudioBluetoothInitializer>
create(
78 std::shared_ptr<avsCommon::utils::bluetooth::BluetoothEventBus> eventBus);
98 static void onStateChanged(pa_context* context,
void* userdata);
108 static void onModuleFound(pa_context* context,
const pa_module_info* info,
int eol,
void* userData);
117 static void onLoadPolicyResult(pa_context* context, uint32_t
index,
void* userdata);
126 static void onLoadDiscoverResult(pa_context* context, uint32_t index,
void* userdata);
135 static void onUnloadPolicyResult(pa_context* context,
int success,
void* userdata);
144 static void onUnloadDiscoverResult(pa_context* context,
int success,
void* userdata);
153 void handleLoadModuleResult(pa_context* context, uint32_t index,
const std::string& moduleName);
162 void handleUnloadModuleResult(pa_context* context,
int success,
const std::string& moduleName);
180 void setStateAndNotify(pa_context_state_t state);
205 std::condition_variable m_mainThreadCv;
211 std::shared_ptr<avsCommon::utils::bluetooth::BluetoothEventBus> m_eventBus;
214 pa_threaded_mainloop* m_paLoop;
218 bool m_paLoopStarted;
221 pa_context* m_context;
247 return "INITIALLY_LOADED";
251 return "LOADED_BY_SDK";
273 #endif // ALEXA_CLIENT_SDK_BLUETOOTHIMPLEMENTATIONS_BLUEZ_INCLUDE_BLUEZ_PULSEAUDIOBLUETOOTHINITIALIZER_H_ std::string moduleStateToString(const PulseAudioBluetoothInitializer::ModuleState &state)
Definition: PulseAudioBluetoothInitializer.h:242
std::ostream & operator<<(std::ostream &stream, const BlueZBluetoothDevice::BlueZDeviceState &state)
Definition: BlueZBluetoothDevice.h:371
void onEventFired(const avsCommon::utils::bluetooth::BluetoothEvent &event) override
Definition: PulseAudioBluetoothInitializer.h:54
Before we have queried the state of the module.
::std::string string
Definition: gtest-port.h:1097
Single-thread executor implementation.
Definition: Executor.h:45
Definition: BluetoothEventListenerInterface.h:29
The module was initially loaded.
ModuleState
The state of each module.
Definition: PulseAudioBluetoothInitializer.h:59
static std::shared_ptr< PulseAudioBluetoothInitializer > create(std::shared_ptr< avsCommon::utils::bluetooth::BluetoothEventBus > eventBus)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
~PulseAudioBluetoothInitializer()
The module has been loaded by the SDK.
Base class for a BluetoothEvent.
Definition: BluetoothEvents.h:66