// NewAdaptor creates a Tinkerboard Adaptor
487448
func NewAdaptor() *Adaptor {
	c := &Adaptor{
		name:  gobot.DefaultName("Tinker Board"),
		mutex: &sync.Mutex{},
	}

	c.setPins()
	return c
}
461248
func NewAdapter(params gormdb.DbInfo) *Adapter {
	a := &Adapter{}
	gormdb.InitDBWithParameters(params)
	a.db = gormdb.DB

	return a
}
1305450
func (s *Server) RestfulHandlerAdapter(adapter RestfulHandlerAdapter) {
	if adapter != nil {
		s.restfulAdapter = adapter
	}
}
1052602
func NewAdaptor(port string) *Adaptor {
	return &Adaptor{
		name: gobot.DefaultName("LeapMotion"),
		port: port,
		connect: func(host string) (io.ReadWriteCloser, error) {
			return websocket.Dial("ws://"+host+"/v3.json", "", "http://"+host)
		},
	}
}
941882
func NewActor(v2Actor V2Actor, v3Actor V3Actor) *Actor {
	return &Actor{
		V2Actor: v2Actor,
		V3Actor: v3Actor,
	}
}
669139
func NewARPCollector() (Collector, error) {
	return &arpCollector{
		entries: prometheus.NewDesc(
			prometheus.BuildFQName(namespace, "arp", "entries"),
			"ARP entries by device",
			[]string{"device"}, nil,
		),
	}, nil
}
1123391
func NewAdaptorWithAuth(host, clientID, username, password string) *Adaptor {
	return &Adaptor{
		name:          "MQTT",
		Host:          host,
		autoReconnect: false,
		cleanSession:  true,
		useSSL:        false,
		clientID:      clientID,
		username:      username,
		password:      password,
	}
}
82675
func NewExampleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
	return NewFilteredExampleInformer(client, namespace, resyncPeriod, indexers, nil)
}
473666
func NewAdapterMock(filePath string) *AdapterMock {
	a := AdapterMock{}
	a.filePath = filePath
	return &a
}
996499
func NewPocketBeagleAdaptor() *PocketBeagleAdaptor {
	a := NewAdaptor()
	a.SetName(gobot.DefaultName("PocketBeagle"))
	a.pinMap = pocketBeaglePinMap
	a.pwmPinMap = pocketBeaglePwmPinMap
	a.analogPinMap = pocketBeagleAnalogPinMap

	return &PocketBeagleAdaptor{
		Adaptor: a,
	}
}
956502
func NewClientAdaptor(address string) *ClientAdaptor {
	return &ClientAdaptor{
		name:             gobot.DefaultName("BLEClient"),
		address:          address,
		DeviceName:       "default",
		connected:        false,
		withoutResponses: false,
	}
}
1221702
func NewRawAdapter(route *router.Route) (router.LogAdapter, error) {
	transport, found := router.AdapterTransports.Lookup(route.AdapterTransport("udp"))
	if !found {
		return nil, errors.New("bad transport: " + route.Adapter)
	}
	conn, err := transport.Dial(route.Address, route.Options)
	if err != nil {
		return nil, err
	}
	tmplStr := "{{.Data}}\n"
	if os.Getenv("RAW_FORMAT") != "" {
		tmplStr = os.Getenv("RAW_FORMAT")
	}
	tmpl, err := template.New("raw").Funcs(funcs).Parse(tmplStr)
	if err != nil {
		return nil, err
	}
	return &Adapter{
		route: route,
		conn:  conn,
		tmpl:  tmpl,
	}, nil
}
43312
func SetAdapterConfig(name string, config map[string]interface{}) {
	lock.Lock()
	a := adapters[name]
	a.Config = config
	adapters[name] = a
	lock.Unlock()
}
1229421
func NewConverter(fromEncoding string, toEncoding string) (converter *Converter, err error) {
	converter = new(Converter)

	// convert to C strings
	toEncodingC := C.CString(toEncoding)
	fromEncodingC := C.CString(fromEncoding)

	// open an iconv descriptor
	converter.context, err = C.iconv_open(toEncodingC, fromEncodingC)

	// free the C Strings
	C.free(unsafe.Pointer(toEncodingC))
	C.free(unsafe.Pointer(fromEncodingC))

	// check err
	if err == nil {
		// no error, mark the context as open
		converter.open = true
	}

	return
}
113147
func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{}, store Store, resyncPeriod time.Duration) *Reflector {
	r := &Reflector{
		name:          name,
		listerWatcher: lw,
		store:         store,
		expectedType:  reflect.TypeOf(expectedType),
		period:        time.Second,
		resyncPeriod:  resyncPeriod,
		clock:         &clock.RealClock{},
	}
	return r
}
809370
func NewAttr(name, attrType string, required bool) *Spec {
	return AttrSpec(&Attr{
		Name:     name,
		Type:     attrType,
		Required: required,
	})
}
368037
func NewAdaptor() *Adaptor {
	r := &Adaptor{
		mutex:           &sync.Mutex{},
		name:            gobot.DefaultName("RaspberryPi"),
		digitalPins:     make(map[int]*sysfs.DigitalPin),
		pwmPins:         make(map[int]*PWMPin),
		PiBlasterPeriod: 10000000,
	}
	content, _ := readFile()
	for _, v := range strings.Split(string(content), "\n") {
		if strings.Contains(v, "Revision") {
			s := strings.Split(string(v), " ")
			version, _ := strconv.ParseInt("0x"+s[len(s)-1], 0, 64)
			r.i2cDefaultBus = 1
			r.spiDefaultBus = 0
			r.spiDefaultChip = 0
			r.spiDefaultMode = 0
			r.spiDefaultMaxSpeed = 500000
			if version <= 3 {
				r.revision = "1"
				r.i2cDefaultBus = 0
			} else if version <= 15 {
				r.revision = "2"
			} else {
				r.revision = "3"
			}
		}
	}

	return r
}