Skip to content

Commit

Permalink
ready library for jitpack release
Browse files Browse the repository at this point in the history
  • Loading branch information
bgiori committed May 9, 2018
1 parent 3955874 commit 6382bb4
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 31 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Android McuManager

A transport agnostic implementation of the McuManager protocol (aka Newt Manager, Simple Management Protocol) for Android.

## Download

You may clone/download the repository and add the source as a module in your app, or simply use gradle.

### Gradle

Add jitpack as a maven repository under all projects (root `build.gradle`):

```
allprojects {
repositories {
// ...
maven { url 'https://jitpack.io' }
}
}
```

Add the dependency to your app:

```
dependencies {
// ...
implementation 'com.github.runtimeco:mcumgr-android:<latest-release>'
}
```

## Sample App Quick Start

Before integrating McuManager into your Android app, you may want to test the sample app with your device to make sure the device has been set up correctly.

// TODO

# Introduction

McuManager is a application layer protocol used to manage and montior microcontrollers running Apache Mynewt and Zephyr. More specifically, McuManagr implements over-the-air (OTA) firmware upgrades, log and stat collection, and file-system and configuration management.

# API Overview

Since most apps will be using Bluetooth Low Energy (BLE) as the transport and likely already contain custom application protocols running over BLE to control the remote device, the primary design goal of this library is to allow developers to integrate mcumgr-android into their custom BLE state machine. Furthermore, because McuManager is capable of running over mutliple transports (BLE, UDP) and allows for commands to be sent on top of [CoAP](https://tools.ietf.org/html/rfc7252) the transport implementation is separated from the packet formation.

// TODO


16 changes: 7 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2017-2018 Runtime Inc.
* Copyright (c) Intellinium SAS, 2014-present
*
* SPDX-License-Identifier: Apache-2.0
Expand All @@ -11,21 +12,18 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}

ext {
mcuMgrVersion = "0.7"
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Feb 13 14:01:39 CET 2018
#Wed May 09 12:42:42 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
38 changes: 34 additions & 4 deletions mcumgr-android-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group='com.github.runtimeco'

android {
compileSdkVersion 27
Expand All @@ -14,7 +16,8 @@ android {
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
versionName "0.7"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -26,12 +29,39 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'

// Test
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.9.3'
implementation 'com.fasterxml.jackson.core:jackson-core:2.9.3'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.3'
implementation 'no.nordicsemi.android:log:2.1.1'
}

// build a jar with source files
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}

// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}
29 changes: 13 additions & 16 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
/*
* Copyright (c) 2017-2018 Runtime Inc.
* Copyright (c) Intellinium SAS, 2014-present
*
* SPDX-License-Identifier: Apache-2.0
*
*/

/*
* Copyright (c) Intellinium SAS, 2014-present
*
* SPDX-License-Identifier: Apache-2.0
*/

apply plugin: 'com.android.application'
apply plugin: 'com.github.dcendents.android-maven'
group='com.github.runtimeco'

android {
compileSdkVersion 27
Expand All @@ -21,14 +18,8 @@ android {
targetSdkVersion 27
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -38,7 +29,13 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
compile project(path: ':mcumgr-android-lib')

// Test
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
testImplementation 'junit:junit:4.12'

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation project(path: ':mcumgr-android-lib')
}

0 comments on commit 6382bb4

Please sign in to comment.