Removed device wrapper
This commit is contained in:
		
							
								
								
									
										29
									
								
								fuse.go
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								fuse.go
									
									
									
									
									
								
							@@ -14,35 +14,6 @@ import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type Device struct {
 | 
			
		||||
	dev *infinitime.Device
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (i Device) HeartRateBytes() ([]byte, error) {
 | 
			
		||||
	v, err := i.dev.HeartRate()
 | 
			
		||||
	return []byte(strconv.Itoa(int(v)) + "\n"), err
 | 
			
		||||
}
 | 
			
		||||
func (i Device) BatteryLevelBytes() ([]byte, error) {
 | 
			
		||||
	v, err := i.dev.BatteryLevel()
 | 
			
		||||
	return []byte(strconv.Itoa(int(v)) + "\n"), err
 | 
			
		||||
}
 | 
			
		||||
func (i Device) StepCountBytes() ([]byte, error) {
 | 
			
		||||
	v, err := i.dev.StepCount()
 | 
			
		||||
	return []byte(strconv.Itoa(int(v)) + "\n"), err
 | 
			
		||||
}
 | 
			
		||||
func (i Device) MotionBytes() ([]byte, error) {
 | 
			
		||||
	v, err := i.dev.Motion()
 | 
			
		||||
	return []byte(strconv.Itoa(int(v.X)) + " " + strconv.Itoa(int(v.Y)) + " " + strconv.Itoa(int(v.Z)) + "\n"), err
 | 
			
		||||
}
 | 
			
		||||
func (i Device) AddressBytes() ([]byte, error) {
 | 
			
		||||
	v := i.dev.Address()
 | 
			
		||||
	return []byte(v + "\n"), nil
 | 
			
		||||
}
 | 
			
		||||
func (i Device) VersionBytes() ([]byte, error) {
 | 
			
		||||
	v, err := i.dev.Version()
 | 
			
		||||
	return []byte(v + "\n"), err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func converterU8(ctx context.Context, in <-chan uint8) <-chan []byte {
 | 
			
		||||
	out := make(chan []byte, 2)
 | 
			
		||||
	go func() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user