#include <gio/gio.h>
#include <string>
#include <list>
#include "GattService.h"
#include "GattInterface.h"
#include "DBusObject.h"
#include "GattCharacteristic.h"
namespace ggk {
GattService::GattService(DBusObject &owner, const std::string &name)
: GattInterface(owner, name)
{
}
DBusObject &GattService::gattServiceEnd()
{
return getOwner().getParent();
}
GattCharacteristic &GattService::gattCharacteristicBegin(const std::string &pathElement, const GattUuid &uuid, const std::vector<const char *> &flags)
{
DBusObject &child = owner.addChild(DBusObjectPath(pathElement));
GattCharacteristic &characteristic = *child.addInterface(std::make_shared<GattCharacteristic>(child, *this, "org.bluez.GattCharacteristic1"));
characteristic.addProperty<GattCharacteristic>("UUID", uuid);
characteristic.addProperty<GattCharacteristic>("Service", owner.getPath());
characteristic.addProperty<GattCharacteristic>("Flags", flags);
return characteristic;
}
};