A Java library version of AromaShooter Controller SDK which is used to communicate with Aroma Shooter devices
- Aroma Shooter 1 USB version
- Aroma Shooter 2
- USB
- JRE version: >= 1.8+
- Donwload and install drivers based on your OS.
Please add controller-sdk
dependency.
dependencies {
// ... other dependencies
compile 'com.aromajoin.sdk:jvm:2.4.0'
}
<dependency>
<groupId>com.aromajoin.sdk</groupId>
<artifactId>jvm</artifactId>
<version>2.4.0</version>
<type>pom</type>
</dependency>
- Directly download the latest controller-sdk-java.jar file.
- 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(duration, booster, ports);
- Diffuse scents method for AS2 (AromaShooter 2) devices only
/**
* Diffuses aroma at specific ports from all connected devices.
* @param duration diffusing duration in milliseconds.
* @param boosterIntensity booster port. Value: 0~100.
* @param fanIntensity fan port. Value: 0~100.
* @param ports array of ports. Value: Port(portNumber, portIntensity)
*/
controller.diffuseAll(duration, boosterIntensity, fanIntensity, ports);
- Other diffuse methods
// Diffuse one Aroma Shooter
controller.diffuse(aromaShooter, duration, booster, ports);
// Diffuse one Aroma Shooter with its serial number input
controller.diffuse(aromaShooterSerial, duration, booster, ports);
// Diffuse one Aroma Shooter with intensity (Aroma Shooter 2 supported only)
controller.diffuse(aromaShooter, durationMilliSec, boosterIntensity, fanIntensity, ports);
// Diffuse one Aroma Shooter with intensity and serial number input (Aroma Shooter 2 supported only)
controller.diffuse(aromaShooterSerial, durationMilliSec, boosterIntensity, fanIntensity, ports);
- Stop all ports of current connected devices if they are diffusing
usbController.stopAllPorts();
- Stop all ports of one device if it is diffusing scents
usbController.stopAllPorts(aromaShooter);
Disconnect all devices.
usbController.disconnectAll();
If you get any issues or require any new features, please create a new issue.
Please check the LICENSE file for the details.