AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Static Public Member Functions | List of all members
alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage Class Reference

A concrete implementation of BluetoothStorageInterface using SQLite. More...

#include <SQLiteBluetoothStorage.h>

Inheritance diagram for alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage:
Collaboration graph
[legend]

Public Member Functions

BluetoothStorageInterface
bool createDatabase () override
 
bool open () override
 
void close () override
 Close the database. More...
 
bool clear () override
 
bool getUuid (const std::string &mac, std::string *uuid) override
 
bool getCategory (const std::string &uuid, std::string *category) override
 
bool getMac (const std::string &uuid, std::string *mac) override
 
bool getMacToUuid (std::unordered_map< std::string, std::string > *macToUuid) override
 
bool getMacToCategory (std::unordered_map< std::string, std::string > *macToCategory) override
 
bool getUuidToMac (std::unordered_map< std::string, std::string > *uuidToMac) override
 
bool getUuidToCategory (std::unordered_map< std::string, std::string > *uuidToCategory) override
 
bool getOrderedMac (bool ascending, std::list< std::string > *macs) override
 
bool insertByMac (const std::string &mac, const std::string &uuid, bool overwrite=true) override
 
bool updateByCategory (const std::string &uuid, const std::string &category) override
 
bool remove (const std::string &mac) override
 
- Public Member Functions inherited from alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface
virtual ~BluetoothStorageInterface ()=default
 Destructor. More...
 

Static Public Member Functions

static std::shared_ptr< BluetoothStorageInterface > createBluetoothStorageInterface (const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &configurationRoot)
 
static std::unique_ptr< SQLiteBluetoothStoragecreate (const avsCommon::utils::configuration::ConfigurationNode &configurationRoot)
 

Detailed Description

A concrete implementation of BluetoothStorageInterface using SQLite.

Member Function Documentation

◆ clear()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::clear ( )
overridevirtual

Clear the database and remove all data.

Returns
A bool indicate success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ close()

void alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::close ( )
overridevirtual

◆ create()

static std::unique_ptr<SQLiteBluetoothStorage> alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::create ( const avsCommon::utils::configuration::ConfigurationNode configurationRoot)
static

Create an instance of a SQLiteBluetoothStorage object.

Deprecated:
Parameters
configurationRootA ConfigurationNode containing the location of the .db file. Should take the form: "bluetooth" : { "databaseFilePath" : "<filePath>" }

◆ createBluetoothStorageInterface()

static std::shared_ptr<BluetoothStorageInterface> alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::createBluetoothStorageInterface ( const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &  configurationRoot)
static

Create an instance of a BluetoothStorageInterface object.

Parameters
configurationRootA shared pointer to a ConfigurationNode containing the location of the .db file. Should take the form: "bluetooth" : { "databaseFilePath" : "<filePath>" }

◆ createDatabase()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::createDatabase ( )
overridevirtual

Create the database.

Returns
A bool indicate success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ getCategory()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::getCategory ( const std::string &  uuid,
std::string *  category 
)
overridevirtual

Retrieve the category associated with a UUID.

Parameters
uuidThe UUID in which the associated category will be retrieved.
[out]categoryThe category of the associated UUID.
Returns
A bool indicating success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ getMac()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::getMac ( const std::string &  uuid,
std::string *  mac 
)
overridevirtual

Retrieve the MAC associated with a UUID.

Parameters
uuidThe UUID in which the associated mac will be retrieved.
[out]macThe MAC address of the associated UUID.
Returns
A bool indicating success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ getMacToCategory()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::getMacToCategory ( std::unordered_map< std::string, std::string > *  macToCategory)
overridevirtual

Retrieve a map of MAC to Category.

Parameters
[out]macToCategoryA map of MAC to Category mappings.
Returns
A bool indicating success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ getMacToUuid()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::getMacToUuid ( std::unordered_map< std::string, std::string > *  macToUuid)
overridevirtual

Retrieve a map of MAC to UUID.

Parameters
[out]macToUuidA map of MAC to UUID mappings.
Returns
A bool indicating success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ getOrderedMac()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::getOrderedMac ( bool  ascending,
std::list< std::string > *  macs 
)
overridevirtual

Gets a list of MAC Addresses ordered by their insertion order into the database.

Parameters
ascendingWhether list is in ascending or descending order.
[out]macsThe ordered macs.
Returns
A bool indicating success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ getUuid()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::getUuid ( const std::string &  mac,
std::string *  uuid 
)
overridevirtual

Retrieve the UUID associated with a MAC.

Parameters
macThe MAC address of the associated UUID.
[out]uuidThe UUID in which the associated mac will be retrieved.
Returns
A bool indicating success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ getUuidToCategory()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::getUuidToCategory ( std::unordered_map< std::string, std::string > *  uuidToCategory)
overridevirtual

Retrieve a map of UUID to Category.

Parameters
[out]uuidToCategoryA map of UUID to Category mappings.
Returns
A bool indicating success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ getUuidToMac()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::getUuidToMac ( std::unordered_map< std::string, std::string > *  uuidToMac)
overridevirtual

Retrieve a map of UUID to MAC.

Parameters
[out]uuidToMacA map of UUID to MAC mappings.
Returns
A bool indicating success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ insertByMac()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::insertByMac ( const std::string &  mac,
const std::string &  uuid,
bool  overwrite = true 
)
overridevirtual

Insert into the database a MAC and UUID row. If an existing entry has the same MAC address, the operation should fail unless overwrite is specified.

Parameters
macThe MAC address.
uuidThe UUID.
overwriteWhether or not to overwrite an existing entry with the same MAC address.
Returns
A bool indicating success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ open()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::open ( )
overridevirtual

Open the database.

Returns
A bool indicate success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ remove()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::remove ( const std::string &  mac)
overridevirtual

Remove the entry by the MAC address. The operation is considered successful if the entry no longer exists after this call, including the case where the entry did not exist prior.

Parameters
macThe MAC address.
Returns
A bool indicating success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.

◆ updateByCategory()

bool alexaClientSDK::acsdkBluetooth::SQLiteBluetoothStorage::updateByCategory ( const std::string &  uuid,
const std::string &  category 
)
overridevirtual

Update an existing entry with category given a UUID. If there is no existing entry, the operation should fail.

Parameters
uuidThe UUID.
categoryThe category.
Returns
A bool indicating success.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothStorageInterface.


The documentation for this class was generated from the following file:

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