Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@playerdata/react-native-mcu-manager

Package Overview
Dependencies
Maintainers
3
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@playerdata/react-native-mcu-manager

React Native Wrappers for MCUMgr's Android / iOS client libraries

Source
npmnpm
Version
3.1.12
Version published
Maintainers
3
Created
Source

@playerdata/react-native-mcu-manager

React Native Wrappers for MCUMgr's Android / iOS client libraries

Getting started

Installation in managed Expo projects

For managed Expo projects, we hope this will Just Work :tm:.

The example app uses Expo Prebuild, so we've some confidence, but let us know how you get on.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npm install @playerdata/react-native-mcu-manager

Configure for iOS

Run npx pod-install after installing the npm package.

Configure for Android

Usage

import McuManager, { ProgressEvent, UploadEvents } from '@playerdata/react-native-mcu-manager';

const onUploadProgress = (progress: ProgressEvent) => {
  console.log("Upload progress: ", progress.bleId, progress.progress);
};

const onUploadStateChanged = (progress: ProgressEvent) => {
  console.log("Upload state change: ", progress.bleId, progress.state);
};

UploadEvents.addListener('uploadProgress', onUploadProgress);
UploadEvents.addListener('uploadStateChanged', onUploadStateChanged);

// bluetoothId is a MAC address on Android, and a UUID on iOS
McuManager.updateDevice(bluetoothId, fileUri)

Contributing

Contributions are very welcome!

There are many examples of expo modules in the expo repo packages like https://github.com/expo/expo/blob/main/packages/expo-camera/README.md

Development Workflow

Install dependencies:

npm install

You should use the example app to test your changes:

cd example

npx expo prebuild

From the top level of the repo, you can use npm run open:(ios|android) to open the appropriate IDE.

For Swift files, you'll find the source files at Pods > Development Pods > ReactNativeMcuManager in XCode.

For Kotlin, you'll find the source files at reactnativemcumanager under Android in Android Studio.

Make sure your code passes TypeScript and ESLint. Run the following to verify:

npm run typecheck
npm run lint

To fix formatting errors, run the following:

npm run lint --fix

Remember to add unit tests for your change if possible. Run the unit tests by:

npm run test

Keywords

react-native

FAQs

Package last updated on 07 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts