yes Spada / Mbed OS programme

EnvironmentalService.h

Committer:
loicguibert
Date:
2019-04-02
Revision:
14:c5578b5edabe
Child:
15:aac1b3950a9e

File content as of revision 14:c5578b5edabe:

#pragma once

#include "ble/BLE.h"
// for logging
#include "Logger.h"

class EnvironmentalService {
public:
  //typedef int8_t BatteryLevelType_t;
  
  /**
   * @brief   BatteryService constructor.
   * @param   ble Reference to BLE device.
   */
  EnvironmentalService(BLE& ble, Logger& logger);
  
  /**
   * Called after initialization of the BLE module for adding the service
   * to the GATT server
   */
  void addServiceToGattServer(void);
   
  /**
   * @brief   Update battery level characteristic.
   * @param   newBatteryLevelVal New battery level measurement.
   */
  void updateEnvironmentalService(/*BatteryLevelType_t newBatteryLevelVal*/);

private:
  // data members
  BLE& m_ble;
  bool m_serviceAdded;

  //BatteryLevelType_t m_batteryLevel;
  
  // characteristics belonging to the service
  //ReadOnlyGattCharacteristic<BatteryLevelType_t> m_batteryLevelCharacteristic;
    
  // logger instance
  Logger& m_logger;
};