Difference between revisions of "Callibri Motion Assistant Quickstart"

From Neurotech Software Development Kit
Jump to: navigation, search
Line 1: Line 1:
 +
This page describes simple steps for starting use Callibri MotionAssistant device in yours application.
 +
To get more information about device classes see [[Motion Assistant Device| MotionAssistant device page]]
 +
 
To start using neurotech software development kit first [[Including SDK Library|include]] appropriate library into your project.
 
To start using neurotech software development kit first [[Including SDK Library|include]] appropriate library into your project.
  
Line 37: Line 40:
  
  
For more information see [[MotionAssistantConnection class]]
+
For more information see [[MotionAssistantConnection Class|MotionAssistantConnection class page]]
 +
 
 +
=== Using Device ===
 
@interface NCMotionAssistantConnection : NSObject
 
@interface NCMotionAssistantConnection : NSObject
  

Revision as of 07:06, 3 March 2017

This page describes simple steps for starting use Callibri MotionAssistant device in yours application. To get more information about device classes see MotionAssistant device page

To start using neurotech software development kit first include appropriate library into your project.

Android

iOS

Connection

For distinct types of devices it is prefered to use specialized scanner classes. Use NCMotionAssistantConnection class to scan for MotionAssistant devices. It will scan BTLE devices and notify about only MotionAssistant devices been found.

To instantiate scanner object define proertie of type NCMotionAssistantConnection in your class and use its default constructor for initialization. Possibly use one instance for scanner for all scan operations in your application instance, there is no need to create scanner objects multiple times to scan several times for example.

private var maConnection: NCMotionAssistantConnection

init(){
   maConnection = NCMotionAssistantConnection()
}

You will be able to retreive devices in two way: by subscribbing scan notifications and by calling method wich receives device address as a parameter.

To subscribe scan notifications use setDeviceFoundCallback method:

maConnection.setScanStateChangedCallback(onDeviceFound)

where onDeviceFound is a callback method which handles device found event

private func onDeviceFound(maDevice: NCMotionAssistantDevice?){
        //you code here
    }


For more information see MotionAssistantConnection class page

Using Device

@interface NCMotionAssistantConnection : NSObject

-(void)startScan:(int)timeout; -(void)stopScan; -(NCMotionAssistantDevice *)getDeviceByAddress:(const NSString*)address; -(void)setScanStateChangedCallback:(void(^)(bool isScanning)) scanStateChangedCallback; -(void)setDeviceFoundCallback:(void(^)(NCMotionAssistantDevice *)) deviceFoundCallback;

@end

@interface NCMotionAssistantDevice : NSObject

-(id) initWithNativeDevice: (void*) device;

-(void) motionAssistantStart; -(void) motionAssistantStop; -(bool) getMotionAssistantState; -(void) setMotionAssistantParams:(int) gyroStart gyroStop:(int)gyroStop limb:(NCMotionAssistantLimb)limb minStimulationPause:(int)minStimulationPause maxStimulationDuration:(int)maxStimulationDuration; -(void) setGyroStartThreshold:(int) gyroStart; -(void) setGyroStopThreshold:(int) gyroStop; -(void) setLimbForStimulation:(NCMotionAssistantLimb) limb; -(void) setMinAssistantStimulationPause:(int) stimulationPause; -(void) setMaxAssistantStimulusDuration:(int) maxStimulDuration; -(int) getGyroStartThreshold; -(int) getGyroStopThreshold; -(NCMotionAssistantLimb) getLimbForStimulation; -(int) getMinAssistantStimulationPause; -(int) getMaxAssistantStimulusDuration; -(void) stimulationStart; -(void) stimulationStop; -(bool) getStimulatorState; -(void) doCalibration; -(void) setStimulatorParams:(int) amplitude pulse_duration:(int) pulse_duration frequency:(int) frequency stim_duration:(int) stim_duration; -(void) setCurrentAmplitude:(int) current; -(void) setPulseDuration:(int) pulseDuration; -(void) setPulseFrequency:(int) pulseFrequency; -(void) setStimulationDuration:(int) stimulationDuration; -(int) getCurrentAmplitude; -(int) getPulseDuration; -(int) getPulseFrequency; -(int) getStimulationDuration; -(void) setAssistantParamsChangedCallback:(void(^)(int gyroStart, int gyroStop, NCMotionAssistantLimb limb, int minStimulationPause, int maxStimulusDuration)) assistantParamsChangedCallback; -(void) setStimulationParamsChangedCallback:(void(^)(int amplitude, int pulse_duration, int frequency, int stimul_duration)) stimulParamsChangedCallback; -(void) setAssistantStateChangedCallback:(void(^)(bool isOn)) assistantStateChangedCallback; -(void) setStimulatorStateChangedCallback:(void(^)(bool isOn)) stimulatorStateChangedCallback;

@end