#ifndef BLE_BATTERY_SERVICE_H__
#define BLE_BATTERY_SERVICE_H__

#include <stdint.h>
#include <stdbool.h>
#include "ble.h"
#include "ble_srv_common.h"


#define BATTERY_UUID_BASE			{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xF0, 0x0F, 0xEE, \
									0xDD, 0xCC, 0xBB, 0xAA, 0x00, 0x00, 0x00, 0x00}
#define BATTERY_UUID_SERVICE		0x1501
#define BATTERY_UUID_PACK_CHAR		0x1601
#define BATTERY_UUID_CELL_CHAR		0x1602

struct ble_battery_service_handle_t
{
	uint16_t					service_handle;     /**< Handle of Our Service (as provided by the BLE stack). */
	uint16_t					conn_handle; 
	ble_gatts_char_handles_t	pack_char_handles;
	ble_gatts_char_handles_t	cell_char_handles[3];
	float voltage_pack_last;
	float voltage_cell_last[3];
};

void ble_battery_service_init(struct ble_battery_service_handle_t * p_battery_service);
void update_battery_values(struct ble_battery_service_handle_t *p_battery_service);
void ble_battery_on_ble_evt(struct ble_battery_service_handle_t * p_battery_service, ble_evt_t * p_ble_evt);




#endif // BLE_BATTERY_SERVICE_H__

/** @} */
