A Java library version of AromaShooter Controller SDK which is used to communicate with Aroma Shooter devices
- Aroma Shooter 1 USB
- JRE version: >= 1.8+
- Donwload and install drivers based on your OS.
- Firstly, add our repository on the top of your [rootProject]/build.gradle.
repositories {
// ... other repositories
maven { url "https://dl.bintray.com/aromajoin/maven/" }
}
- Then, add
controller-sdk
dependency.
dependencies {
// ... other dependencies
compile 'com.aromajoin.sdk:jvm:2.x.x'
}
<dependency>
<groupId>com.aromajoin.sdk</groupId>
<artifactId>jvm</artifactId>
<version>2.x.x</version>
<type>pom</type>
</dependency>
- Directly download the latest *.jar file from Bintray.
- Add it into your project's build path.
For details, please check our Sample project (Recommended).
// Initialize an instance of USBASController
USBASController usbController = new USBASController();
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.
}
});
List<AromaShooter> connectedDevices = usbController.getConnectedDevices();
/**
* Diffuses aroma at specific ports from all connected devices.
* @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 for 3 seconds.
usbController.diffuseAll(3000, true, 2, 5);
- Diffuse scents method for AS2 (AromaShooter 2) devices only
Port port1 = new Port(1, 100);
Port port2 = new Port(2, 50);
usbController.diffuseAll(3000, 0, 100, [port1, port2]);
Stop all ports of current connected devices if they are diffusing
usbController.stopAllPorts();
Disconnect all devices.
usbController.disconnectAll();
If you get any issues or require any new features, please create a new issue.
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.