示例#1
0
func NewBridgingState() *BridgingState {
	svc := BridgingState{}
	svc.Service = New(TypeBridgingState)

	svc.Reachable = characteristic.NewReachable()
	svc.AddCharacteristic(svc.Reachable.Characteristic)

	svc.LinkQuality = characteristic.NewLinkQuality()
	svc.AddCharacteristic(svc.LinkQuality.Characteristic)

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

	svc.Category = characteristic.NewCategory()
	svc.AddCharacteristic(svc.Category.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
}