1.0.15 • Published 2 years ago

react-native-neurosdk v1.0.15

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

react-native-neurosdk

Getting started

$ npm install react-native-neurosdk --save

Mostly automatic installation

$ react-native link react-native-neurosdk

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-neurosdk and add RNNeurosdk.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNNeurosdk.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNNeurosdkPackage; to the imports at the top of the file
  • Add new RNNeurosdkPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-neurosdk'
    project(':react-native-neurosdk').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-neurosdk/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-neurosdk')

Usage

See sample: https://gitlab.com/brainbit-inc/brainbit-examples/-/tree/master/react_native/BrainBit

We are recommended to use classes from sample names DeviceEnumerator, Device and Channels or use library manually like:

import RNNeurosdk from 'react-native-neurosdk';

// to start search device
RNNeurosdk.CreateDeviceEnumerator(); 

// to create and connect device
RNNeurosdk.CreateDevice(deviceInfo);
RNNeurosdk.Connect(deviceInfo);

// to create bond with BrainBit Black 
RNNeurosdk.BondTo(deviceInfo.address);

// to read data from channel
batteryChannel.addLengthChanged(length =>{
  batteryChannel.totalLength().then(totalLength =>{
    batteryChannel.readData(totalLength.totalLength - 1,1).then((data)=>{
		console.log("Power: " + data[0]);
     });
   }); 
});

// and more
1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.12

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago