Enable developers to connect and control Aroma Shooter.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Sample
.gitignore
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE.md
README-JP.md
README.md

README.md

English / 日本語

Controller SDK for Java · Download License

A pure Java library version of AromaShooter Controller SDK which is used to communicate with Aroma Shooter devices

Table of Contents

  1. Supported devices
  2. Prerequisites
  3. Installation
  4. Usage
  5. Issues
  6. License

Supported devices

  • Aroma Shooter 1 USB
  • Aroma Shooter 1 RS-485

Prerequisites

  • JRE version: >= 1.8+
  • Donwload and install drivers based on your OS.

Installation

Gradle

  1. Firstly, add our repository on the top of your [rootProject]/build.gradle.
repositories {
    // ... other repositories
    maven { url "https://dl.bintray.com/aromajoin/maven/" }
}
  1. Then, add controller-sdk dependency.
dependencies {
    // ... other dependencies
    compile 'com.aromajoin.sdk:jvm:2.x.x'
}

Maven

<dependency>
  <groupId>com.aromajoin.sdk</groupId>
  <artifactId>jvm</artifactId>
  <version>2.x.x</version>
  <type>pom</type>
</dependency>

Binary files (.jar)

  1. Directly download the latest *.jar file from Bintray.
  2. Add it into your project's build path.

Usage

For details, please check our Sample project (Recommended way.)

Setup

// Initialize an USB Aroma Shooter instance
USBASController usbController = new USBASController();

Scan and connect device

usbController.scanAndConnect(new DiscoverCallback() {
    @Override
    public void onDiscovered(List<AromaShooter> aromaShooters) {
        for(AromaShooter aromaShooter : aromaShooters){
            // Detected Aroma Shooter.
        }
    }

    @Override
    public void onFailed(String msg) {
       // Failed on scanning.
    }
});

Connected devices

List<AromaShooter> connectedDevices = usbController.getConnectedDevices();

Diffuse

/**
 * Diffuses aroma at device's ports.
 * @param duration     diffusing duration in milliseconds.
 * @param booster      whether booster is used or not.
 * @param ports        cartridge numbers to diffuse aroma. Value: 1 ~ 6.
 */
// For example, the following codes will diffuse aroma at cartridge 2 and 5 fro 3 seconds.
usbController.diffuseAll(3000, true, 2, 5);

Stop

Stop all ports of current connected devices if they are diffusing

usbController.stopAllPorts();

Disconnect

Disconnect all devices.

usbController.disconnectAll();

Issues

If you get any issues or require any new features, please create a new issue.

License

The Apache License (Apache)
Copyright (c) 2017 Aromajoin Corporation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.