Sha256: e3783657e5bad4f32fb346aad0f23a34951ddc3dc4addd65a3d830a75bce56c1

Contents?: true

Size: 1.42 KB

Versions: 18

Compression:

Stored size: 1.42 KB

Contents

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <CoreMotion/CoreMotion.h>

#include "ruby/ext/rho/rhoruby.h"

#define RAW_SENSORS_SERVICE_ALL @"all"
#define RAW_SENSORS_SERVICE_ACCELEROMETER @"accelerometer"
#define RAW_SENSORS_SERVICE_MAGNETOMETER @"magnetometer"
#define RAW_SENSORS_UPDATE_PERIOD @"minimumInterval"
#define RAW_SENSORS_CALLBACK_URL @"sensorEvent"



@interface RhoRawSensors: NSObject {
    CMMotionManager *motionManager;
    BOOL enableAccelerometer;
    BOOL enableMagnetometer;
    BOOL enableAll;
    
    NSTimer* timer;
    
    NSString* callbackURL;
    
    double acceleration_x;
    double acceleration_y;
    double acceleration_z;

    double magnetometer_x;
    double magnetometer_y;
    double magnetometer_z;
    
    
    int updatePeriod;
}


+ (RhoRawSensors*) getInstance;

- (VALUE) isAvailable:(NSString*)service_name;

- (VALUE) getProperty:(NSString*)property_name;

- (void) setProperty:(NSString*)property_name value:(NSString*)value;

- (void) getSensorData;

- (void) startPlatformUpdates;

- (void) stopPlatformUpdates;

- (void) onAccelerometerUpdate:(CMAccelerometerData*)accData error:(NSError*)error;

- (void) onMagnetometerUpdate:(CMMagnetometerData*)magData error:(NSError*)error;

- (void) onMotionUpdate:(CMDeviceMotion*)motion error:(NSError*)error;

- (void) fireCallback;

- (void) fireErrorCallback:(NSString*)message;

- (void) onTimerFired:(NSTimer*)theTimer;


@end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
rhodes-7.6.0 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-7.5.1 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-7.4.1 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-7.1.17 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-6.2.0 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-6.0.11 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-5.5.18 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-5.5.17 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-5.5.15 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-5.5.0.22 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-5.5.2 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-5.5.0.7 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-5.5.0.3 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-5.5.0 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
tauplatform-1.0.3 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
tauplatform-1.0.2 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
tauplatform-1.0.1 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h
rhodes-3.5.1.12 lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h