Cortex Library for Mobile
  • Getting Started
  • Objective-C API for iOS
    • CortexLib class
    • CortexClient class
    • CortexClientDelegate protocol
  • Java API for Android
    • EmotivLibraryLoader class
    • CortexLib class
    • CortexClient class
  • Additional JSON methods
    • loginWithAuthenticationCode
    • logout
    • queryVirtualHeadsets
    • createVirtualHeadset
    • deleteVirtualHeadset
    • updateVirtualHeadset
    • triggerVirtualHeadsetEvent
    • Virtual headset object
    • freeUpRecords
  • Release Notes
Powered by GitBook
On this page
  • start
  • stop
  • setCortexLogHandler
  1. Objective-C API for iOS

CortexLib class

PreviousObjective-C API for iOSNextCortexClient class

Last updated 4 years ago

#import <EmotivCortexLib/CortexLib.h>

Use CortexLib to initialize the Cortex library.

start

+ (bool)start:(CortexStartedHandler)handler;

Call this static method to initialize the Cortex library. You must call it exactly once. You must call it before creating an instance of the . The library starts asynchronously. When it is started, the library calls the handler you provided.

typedef void (^CortexStartedHandler)(void);

stop

+ (void)stop;

Call this static method to stop the Cortex library. You must call it exactly once.

setCortexLogHandler

+ (void)setCortexLogHandler:(CortexLogLevel)logLevel handler:(CortexLogHandler)handler;

Call this method if you want to receive the log messages from the Cortex library.

Calling this method is optional. However, if you want to call it, then you must do it before calling the method start.

The parameter logLevel controls how much log messages you will receive.

  • KInfo: get all the messages

  • KWarning: only get the warnings and the error messages

  • KError: only get the error messages

typedef enum CortexLogLevel : NSUInteger {
    kInfo = 1,
    kWarning = 2,
    kError = 3
} CortexLogLevel;

The parameter handler is a callback that will receive the log messages.

typedef void (^CortexLogHandler)(NSString*);
CortexClient class