// start advertising as IBeacon
964648
func (ble *BLE) StartAdvertisingIBeacon(uuid xpc.UUID, major, minor uint16, measuredPower int8) {
	var buf bytes.Buffer
	binary.Write(&buf, binary.BigEndian, uuid[:])
	binary.Write(&buf, binary.BigEndian, major)
	binary.Write(&buf, binary.BigEndian, minor)
	binary.Write(&buf, binary.BigEndian, measuredPower)

	ble.StartAdvertisingIBeaconData(buf.Bytes())
}
44707
func AdvertiseIBeacon(ctx context.Context, u UUID, major, minor uint16, pwr int8) error {
	if defaultDevice == nil {
		return ErrDefaultDevice
	}
	defer untrap(trap(ctx))
	return defaultDevice.AdvertiseIBeacon(ctx, u, major, minor, pwr)
}
384397
func (m *Monitor) Start(c *exec.Cmd) (chan runc.Exit, error) {
	ec := m.Subscribe()
	if err := c.Start(); err != nil {
		m.Unsubscribe(ec)
		return nil, err
	}
	return ec, nil
}
1357779
func (b *ButtonDriver) Start() (err error) {
	// subscribe to button A notifications
	b.adaptor().Subscribe(buttonACharacteristic, func(data []byte, e error) {
		b.Publish(b.Event(ButtonA), data)
	})

	// subscribe to button B notifications
	b.adaptor().Subscribe(buttonBCharacteristic, func(data []byte, e error) {
		b.Publish(b.Event(ButtonB), data)
	})

	return
}
151761
func (lb *LogBroker) Start(ctx context.Context) error {
	lb.mu.Lock()
	defer lb.mu.Unlock()

	if lb.cancelAll != nil {
		return errAlreadyRunning
	}

	lb.pctx, lb.cancelAll = context.WithCancel(ctx)
	lb.logQueue = watch.NewQueue()
	lb.subscriptionQueue = watch.NewQueue()
	lb.registeredSubscriptions = make(map[string]*subscription)
	lb.subscriptionsByNode = make(map[string]map[*subscription]struct{})
	return nil
}
1271453
func (instanceApi *InstanceApi) Start(id string) (bool, error) {
	_, err := instanceApi.entityService.Execute(id, INSTANCE_START_OPERATION, []byte{}, map[string]string{})
	return err == nil, err
}
807423
func (d *Device) AdvertiseNameAndServices(ctx context.Context, name string, uuids ...ble.UUID) error {
	if err := d.HCI.AdvertiseNameAndServices(name, uuids...); err != nil {
		return err
	}
	<-ctx.Done()
	d.HCI.StopAdvertising()
	return ctx.Err()
}
699009
func (c *cniProcessor) Start(ctx context.Context, eventInfo *common.EventInfo) error {
	contextID, err := generateContextID(eventInfo)
	if err != nil {
		return err
	}

	runtimeInfo, err := c.metadataExtractor(eventInfo)
	if err != nil {
		return err
	}

	if err := c.config.Policy.HandlePUEvent(ctx, contextID, common.EventCreate, runtimeInfo); err != nil {
		return err
	}

	if err := c.config.Policy.HandlePUEvent(ctx, contextID, common.EventStart, runtimeInfo); err != nil {
		return err
	}

	c.config.Collector.CollectContainerEvent(&collector.ContainerRecord{
		ContextID: contextID,
		IPAddress: runtimeInfo.IPAddresses(),
		Tags:      runtimeInfo.Tags(),
		Event:     collector.ContainerStart,
	})

	return nil
}
734334
func (h *HCI) AdvertiseServiceData16(id uint16, b []byte) error {
	ad, err := adv.NewPacket(adv.ServiceData16(id, b))
	if err != nil {
		return err
	}
	if err := h.SetAdvertisement(ad.Bytes(), nil); err != nil {
		return nil
	}
	return h.Advertise()
}
190374
func (u *uidProcessor) Start(ctx context.Context, eventInfo *common.EventInfo) error {

	return u.createAndStart(ctx, eventInfo, false)
}
173593
func Advertise(ctx context.Context, advertise discovery.Advertiser) {
	go func() {
		select {
		case <-time.After(AdvertiseBootDelay):
			discovery.Advertise(ctx, advertise, RelayRendezvous)
		case <-ctx.Done():
		}
	}()
}
533060
func (es *EventStream) Start() {
	if es.Events == nil {
		es.Events = make(chan []Event)
	}

	// register eventstream in the local registry for later lookup
	// in C callback
	cbInfo := registry.Add(es)
	es.registryID = cbInfo
	es.uuid = GetDeviceUUID(es.Device)
	es.start(es.Paths, cbInfo)
}
47482
func (l *ServiceListener) Start(sn *ServiceNode, instanceID int) bool {

	l.mu.Lock()
	defer l.mu.Unlock()

	logger := plog.WithFields(log.Fields{
		"serviceid":                   sn.ID,
		"servicename":                 sn.Name,
		"shouldhaveaddressassignment": sn.ShouldHaveAddressAssignment,
		"instanceid":                  instanceID,
	})

	// pick a host
	hostID, err := l.handler.SelectHost(sn)
	if err != nil {
		logger.WithError(err).Warn("Could not select host")
		return false
	}
	// CC-3656: If the strategy doesn't select a host, an invalid service state is created.
	if hostID == "" {
		// The selected strategy didn't select any hosts; we need to make this
		// obvious in the log so it can be corrected.
		strat, err := strategy.Get(string(sn.HostPolicy))
		if err == nil {
			logger = logger.WithField("strategy", strat.Name())
		}
		logger.Warn("No hosts available")
		return false
	}

	logger.WithField("hostid", hostID).Debug("Service instance scheduled to host")
	req := StateRequest{
		PoolID:     l.poolid,
		HostID:     hostID,
		ServiceID:  sn.ID,
		InstanceID: instanceID,
	}

	// make sure the state exists on neither the service nor the host
	DeleteState(l.conn, req)

	if err := CreateState(l.conn, req); err != nil {

		logger.WithError(err).Warn("Could not schedule service instance")
		return false
	}

	return true
}
1333596
func (b *BtcdFilteredChainView) Start() error {
	// Already started?
	if atomic.AddInt32(&b.started, 1) != 1 {
		return nil
	}

	log.Infof("FilteredChainView starting")

	// Connect to btcd, and register for notifications on connected, and
	// disconnected blocks.
	if err := b.btcdConn.Connect(20); err != nil {
		return err
	}
	if err := b.btcdConn.NotifyBlocks(); err != nil {
		return err
	}

	_, bestHeight, err := b.btcdConn.GetBestBlock()
	if err != nil {
		return err
	}

	b.bestHeightMtx.Lock()
	b.bestHeight = uint32(bestHeight)
	b.bestHeightMtx.Unlock()

	b.blockQueue.Start()

	b.wg.Add(1)
	go b.chainFilterer()

	return nil
}
1235282
func Start(plgn Plugin) {
	gob.Register(plgn)
	RegisterPlugin(plgn.GetMeta().Name, plgn)

	if len(os.Args) == 2 && os.Args[1] == PluginMeta {
		b, _ := json.Marshal(plgn.GetMeta())
		UIOutput(string(b))

	} else {

		plugin.Serve(&plugin.ServeConfig{
			HandshakeConfig: handshakeConfig,
			Plugins:         GetPlugins(),
		})
	}
}
337684
func (h *HCI) AdvertiseIBeacon(u ble.UUID, major, minor uint16, pwr int8) error {
	ad, err := adv.NewPacket(adv.IBeacon(u, major, minor, pwr))
	if err != nil {
		return err
	}
	if err := h.SetAdvertisement(ad.Bytes(), nil); err != nil {
		return nil
	}
	return h.Advertise()
}
341841
func (g *Gadget) Start(in <-chan Message, out chan<- Message) {
	g.out = out
	g.timerIn = make(chan bool)
	g.timerOut = make(chan bool)
	if g.Output != nil {
		if len(g.InitialValue) > 0 {
			g.readInitialValue()
		} else {
			g.off()
		}
		g.doOutputLoop(in)
	} else if g.Input != nil {
		g.doInputLoop(in)
	}
}