A Java library version of AromaShooter Controller SDK which is used to communicate with Aroma Shooter devices
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>
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);
/**
* 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
```java
// 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);
usbController.stopAllPorts();
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.