Ejemplo n.º 1
0
func NewAccessoryInformation() *AccessoryInformation {
	svc := AccessoryInformation{}
	svc.Service = New(TypeAccessoryInformation)

	svc.Identify = characteristic.NewIdentify()
	svc.AddCharacteristic(svc.Identify.Characteristic)

	svc.Manufacturer = characteristic.NewManufacturer()
	svc.AddCharacteristic(svc.Manufacturer.Characteristic)

	svc.Model = characteristic.NewModel()
	svc.AddCharacteristic(svc.Model.Characteristic)

	svc.Name = characteristic.NewName()
	svc.AddCharacteristic(svc.Name.Characteristic)

	svc.SerialNumber = characteristic.NewSerialNumber()
	svc.AddCharacteristic(svc.SerialNumber.Characteristic)

	return &svc
}
func NewTunneledBTLEAccessoryService() *TunneledBTLEAccessoryService {
	svc := TunneledBTLEAccessoryService{}
	svc.Service = New(TypeTunneledBTLEAccessoryService)

	svc.Name = characteristic.NewName()
	svc.AddCharacteristic(svc.Name.Characteristic)

	svc.AccessoryIdentifier = characteristic.NewAccessoryIdentifier()
	svc.AddCharacteristic(svc.AccessoryIdentifier.Characteristic)

	svc.TunneledAccessoryStateNumber = characteristic.NewTunneledAccessoryStateNumber()
	svc.AddCharacteristic(svc.TunneledAccessoryStateNumber.Characteristic)

	svc.TunneledAccessoryConnected = characteristic.NewTunneledAccessoryConnected()
	svc.AddCharacteristic(svc.TunneledAccessoryConnected.Characteristic)

	svc.TunneledAccessoryAdvertising = characteristic.NewTunneledAccessoryAdvertising()
	svc.AddCharacteristic(svc.TunneledAccessoryAdvertising.Characteristic)

	svc.TunnelConnectionTimeout = characteristic.NewTunnelConnectionTimeout()
	svc.AddCharacteristic(svc.TunnelConnectionTimeout.Characteristic)

	return &svc
}