// GetDevices returns a slice of all devices known to the protocol, or
// common.ErrNotFound if no devices are currently known.
515495
func (p *V2) GetDevices() ([]common.Device, error) {
	p.RLock()
	defer p.RUnlock()
	if len(p.devices) == 0 {
		return nil, common.ErrNotFound
	}
	devices := make([]common.Device, len(p.devices))
	i := 0
	for _, device := range p.devices {
		devices[i] = device
		i++
	}

	return devices, nil
}
443187
func (s *DeviceDefinitionVersion) SetDevices(v []*Device) *DeviceDefinitionVersion {
	s.Devices = v
	return s
}
242050
func (_m *DBClient) GetAllDeviceReports() ([]models.DeviceReport, error) {
	ret := _m.Called()

	var r0 []models.DeviceReport
	if rf, ok := ret.Get(0).(func() []models.DeviceReport); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]models.DeviceReport)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
201017
func (c *Client) GetDeviceServiceByName(n string) (contract.DeviceService, error) {
	conn := c.Pool.Get()
	defer conn.Close()

	var d contract.DeviceService
	err := getObjectByHash(conn, db.DeviceService+":name", n, unmarshalDeviceService, &d)
	return d, err
}
686307
func (d *driver) LocalDevices(
	ctx types.Context,
	opts *types.LocalDevicesOpts) (*types.LocalDevices, error) {

	devMap, err := utils.GetMappedRBDs(ctx)
	if err != nil {
		return nil, err
	}

	ld := &types.LocalDevices{Driver: d.Name()}
	if len(devMap) > 0 {
		ld.DeviceMap = devMap
	}

	return ld, nil
}
688867
func (d *driver) LocalDevices(
	ctx types.Context,
	opts *types.LocalDevicesOpts) (*types.LocalDevices, error) {

	buckets, err := d.getMountedBuckets(ctx)
	if err != nil {
		return nil, err
	}
	return &types.LocalDevices{Driver: s3fs.Name, DeviceMap: buckets}, nil
}
1050568
func (i *instanceManager) Devices() []*device.DeviceGroup {
	i.deviceLock.RLock()
	defer i.deviceLock.RUnlock()
	return i.devices
}
248558
func (m *Stub) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error) {
	return &pluginapi.DevicePluginOptions{PreStartRequired: m.preStartContainerFlag}, nil
}
1006824
func (_m *DBClient) GetDevicesWithLabel(l string) ([]models.Device, error) {
	ret := _m.Called(l)

	var r0 []models.Device
	if rf, ok := ret.Get(0).(func(string) []models.Device); ok {
		r0 = rf(l)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]models.Device)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(l)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
57423
func (surface *Surface) GetDevice() *Device {
	ret := wrapDevice(C.cairo_surface_get_device(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
454726
func (m *ManagerImpl) GetDevices(podUID, containerName string) []*podresourcesapi.ContainerDevices {
	m.mutex.Lock()
	defer m.mutex.Unlock()
	return m.podDevices.getContainerDevices(podUID, containerName)
}
398873
func (sb *storageBackend) BlockDevices(machine names.MachineTag) ([]BlockDeviceInfo, error) {
	return getBlockDevices(sb.mb.db(), machine.Id())
}
260892
func (s deviceService) FetchDevices(opts ...DeviceRequestOption) (*DeviceResponse, error) {
	request := &deviceRequestOpts{}
	for _, option := range opts {
		if err := option(request); err != nil {
			return nil, err
		}
	}
	var response DeviceResponse
	req, err := s.client.NewRequest("POST", fetchDevicesPath, request)
	if err != nil {
		return nil, err
	}
	err = s.client.Do(req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}
576063
func (_m *Protocol) GetDevices() ([]common.Device, error) {
	ret := _m.Called()

	var r0 []common.Device
	if rf, ok := ret.Get(0).(func() []common.Device); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]common.Device)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
397709
func (device *Device) VisitDevices(visitor func(*Device)) {
	visitor(device)
	for i := range device.Devices {
		device.Devices[i].VisitDevices(visitor)
	}
}
123489
func (c *Client) GetLights() (lights []common.Light, err error) {
	devices, err := c.GetDevices()
	if err != nil {
		return lights, err
	}

	for _, dev := range devices {
		if light, ok := dev.(common.Light); ok {
			lights = append(lights, light)
		}
	}

	if len(lights) == 0 {
		return lights, common.ErrNotFound
	}

	return lights, nil
}
394605
func GetDevice(db sqlx.Queryer, devEUI lorawan.EUI64) (Device, error) {
	var d Device
	err := sqlx.Get(db, &d, "select * from device where dev_eui = $1", devEUI[:])
	if err != nil {
		return d, handlePSQLError(err, "select error")
	}

	return d, nil
}