2
0
mirror of synced 2025-02-22 22:38:18 +00:00

exp/sensor: reorg package to create space for darwin/arm,arm64 impl

Change-Id: I41e4088a92fff2f411dd82102fc3c421d2679c21
Reviewed-on: https://go-review.googlesource.com/13582
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Burcu Dogan 2015-08-12 10:16:13 -07:00
parent df7e121d2f
commit b5583e233e
5 changed files with 44 additions and 3 deletions

View File

@ -2,12 +2,14 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build android
#include <stdlib.h>
#include <jni.h>
#include <android/sensor.h>
#include "sensors_android.h"
#include "android.h"
void android_createManager(int looperId, android_SensorManager* dst) {
ASensorManager* manager = ASensorManager_getInstance();

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build android
package sensor
/*
@ -10,7 +12,7 @@ package sensor
#include <stdlib.h>
#include <android/sensor.h>
#include "sensors_android.h"
#include "android.h"
*/
import "C"
import (

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build android
#ifndef SENSORS_ANDROID_H
#define SENSORS_ANDROID_H

View File

@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !android
// +build darwin
// +build arm arm64
package sensor

34
exp/sensor/notmobile.go Normal file
View File

@ -0,0 +1,34 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build linux,!android darwin,!arm,!arm64
package sensor
import (
"errors"
"time"
)
type manager struct {
}
func (m *manager) initialize() {
}
func (m *manager) enable(t Type, delay time.Duration) error {
return errors.New("sensor: no sensors available")
}
func (m *manager) disable(t Type) error {
return errors.New("sensor: no sensors available")
}
func (m *manager) read(e []Event) (n int, err error) {
return 0, errors.New("sensor: no sensor data available")
}
func (m *manager) close() error {
return nil
}