SurfaceSdk functions
Getters
SurfaceSdk.sharedInstance()?.getCurrentResult()
- This method will returnd the current result.
SurfaceSdk.sharedInstance()?.getCSV()
- This method will returnd the measurement CSV.
Setters
SurfaceSdk.sharedInstance().setAccessKey(“YOUR_KEY”, andAccessKeySecret: “YOUR_SECRET”)
- This method will initialize your access key and secret key you must call this method in the AppDelegate of your application.
Measuring functions
SurfaceSdk.sharedInstance().startSensors()
- This method will start the sensors for the given session.
SurfaceSdk.sharedInstance().stopSensors()
- This method will stop the sensors for the given session.
SurfaceSdk.sharedInstance().startStopMeasure();
- This method will start or stop the measurement according to the current status. if the measurement already started the startStopMeasureing will stop the measurement and inform the onMeasureStopped otherwise startStopMeasureing will start the measuring and it will inform onMeasureStarted
SurfaceSdk.sharedInstance().stopMeasurement()
- This method will stop the measurement.
The MeasureListenerSurface Protocol
func onMeasureCanBeStarted()
- This callback will be called when measure process can be started.
func onMeasureCanBeStopped()
- This callback will be called when the measurement process can be stopped.
func onMeasureCantBeStarted()
- This callback will be called when the measurement process can’t be started.
func onMeasureCantBeStopped()
- This callback will be called when the measurement process can’t be stopped
func onMeasureStarted()
- This callback will be called when the measure process just started
func onMeasureStopped()
- This callback will be called when the measure process stopped and the result is being calculated
func onMeasureFinished(_ result: NSNumber!, error:Error!)
- This callback will be called when the measure process and result calculation are finished
Errors:
- ERROR_TIME_OUT=1 – indicates that the measurement was too long.
The user should measure again faster and shorter. - ERROR_VELOCITY_SLOW=2 – indicating the measurement was done too slow. The user should make the measurement again -faster.
- ERROR_VELOCITY_DIRECTION=3 – indicating that the algorithm didn’t find an unambiguous direction meaning the user measured while the phone was not parallel to the measurement direction. The user should measure again, making sure the phone is parallel to the measurement direction.
- ERROR_VELOCITY_NOISY=4 – indicating the measurement had some noise. The user should perform the measurement as flawlessly as possible without hitting anything.
- ERROR_VELOCITY_SHORT_SIGNAL=5 – indicating the measurement was too short (or almost no movement). The user should measure again longer distance.
- ERROR_VELOCITY_SILENCE_SIGNAL=6 – indicating the measurement had some noise. The user should perform the measurement flawlessly as possible without hitting anything.
- ERROR_GENERAL_SERVER=7 – indicates a general server error. The user should measure again.
Comments
0 comments
Please sign in to leave a comment.