You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.3 KiB

  1. /**
  2. * @file TinyGsmGPS.tpp
  3. * @author Adrian Cervera Andes
  4. * @license LGPL-3.0
  5. * @copyright Copyright (c) 2021 Adrian Cervera Andes
  6. * @date Jan 2021
  7. */
  8. #ifndef SRC_TINYGSMBLUETOOTH_H_
  9. #define SRC_TINYGSMBLUETOOTH_H_
  10. #include "TinyGsmCommon.h"
  11. #define TINY_GSM_MODEM_HAS_BLUETOOTH
  12. template <class modemType>
  13. class TinyGsmBluetooth {
  14. public:
  15. /*
  16. * Bluetooth functions
  17. */
  18. bool enableBluetooth() {
  19. return thisModem().enableBluetoothImpl();
  20. }
  21. bool disableBluetooth() {
  22. return thisModem().disableBluetoothImpl();
  23. }
  24. bool setBluetoothVisibility(bool visible) {
  25. return thisModem().setBluetoothVisibilityImpl(visible);
  26. }
  27. bool setBluetoothHostName(const char* name) {
  28. return thisModem().setBluetoothHostNameImpl(name);
  29. }
  30. /*
  31. * CRTP Helper
  32. */
  33. protected:
  34. inline const modemType& thisModem() const {
  35. return static_cast<const modemType&>(*this);
  36. }
  37. inline modemType& thisModem() {
  38. return static_cast<modemType&>(*this);
  39. }
  40. /*
  41. * Bluetooth functions
  42. */
  43. bool enableBluetoothImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED;
  44. bool disableBluetoothImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED;
  45. bool setBluetoothVisibilityImpl(bool visible) TINY_GSM_ATTR_NOT_IMPLEMENTED;
  46. bool setBluetoothHostNameImpl(const char* name) TINY_GSM_ATTR_NOT_IMPLEMENTED;
  47. };
  48. #endif // SRC_TINYGSMBLUETOOTH_H_