Coder Social home page Coder Social logo

amazon-freertos-ble-android-sdk's Introduction

FreeRTOS BLE Mobile SDK for Android

Maven Central

Introduction

Using the Android SDK for FreeRTOS Bluetooth Devices, you can create mobile applications that do the following:

  • Scan for and connect to nearby BLE devices running FreeRTOS

  • Perform WiFi provisioning of the FreeRTOS BLE devices after connecting to them ( Only supported for Espressif ESP32-DevKitC )

  • Act as a proxy for transmitting MQTT messages between a device running FreeRTOS and the AWS IoT cloud

System requirements

  • Android 6.0 (API level 23) or higher

  • Bluetooth 4.2 or higher

  • Android Studio

Setting Up the SDK

  1. Set the SDK as a dependency for the application.

Option 1: install from maven In your app's build.gradle file, add the following into dependencies block: (replace x.y.z with Maven Central)

    implementation('software.amazon.freertos:amazonfreertossdk:x.y.z')

Option 2: Build the sdk locally. In your app's build.gradle file, add the following into dependencies block:

    implementation project(':amazonfreertossdk')

In project's settings.gradle file, add ':amazonfreertossdk'

    include ':app', ':amazonfreertossdk'
  1. In your app's AndroidManifest.xml file, add following permissions:
<uses-permission android:name="android.permission.BLUETOOTH"/>
    <!-- initiate device discovery and manipulate bluetooth settings -->
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
    <!-- allow scan BLE -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <!-- AWS Mobile SDK -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  1. Turn on phone's Location Services.

In addition to adding location permissions, this is required by android to perform a successful BLE scan.

Contents

BLE Helper Functions

The SDK includes some functions that help you perform BLE operations with FreeRTOS devices:

    startScanDevices
    stopScanDevices
    connectToDevice
    disconnectFromDevice

Once the connection to the device is established, you get an AmazonFreeRTOSDevice object, and you can use this object to do WiFi provisioning or Mqtt proxy.

WiFi Provisioning Service

Provision the WiFi credential on the FreeRTOS device through the app. It provides 4 functions:

    ListNetwork
    SaveNetwork
    EditNetwork
    DeleteNetwork

MQTT Proxy Service

The MQTT proxy service controls the MQTT proxy. It allows the device to send and receive MQTT messages from the AWS IoT cloud through the phone, when this feature is enabled.

You can find the API documentation for these functions in the docs directory of this repository and on github pages.

Demo Application

The SDK includes a demo application that demonstrates some of the main features of the SDK. You can find the demo in app.

License

This library is licensed under the Apache 2.0 License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.