public synchronized void startSetup(final EnrolleeDevice enrolledevice) throws IOException,ESException {
+ if (null == enrolledevice) {
+ throw new ESException("enrolledevice is NULL");
+ }
+
mEnrolleeDeviceList.add(enrolledevice);
// Starts the provisioning directly if the device is already on boarded on the network.
* @param enrolleedevice Device to be enrolled in network
*/
public synchronized void stopSetup(EnrolleeDevice enrolleedevice) throws ESException {
+
+ if (null == enrolleedevice) {
+ throw new ESException("enrolledevice is NULL");
+ }
+
if (mEnrolleeDeviceList.contains(enrolleedevice)) {
if (enrolleedevice.mState == EnrolleeState.DEVICE_ON_BOARDING_STATE) {
Log.i(TAG, "stopOnBoardingProcess for enrolleedevice");
* @return Instance of the Enrollee device created natively.
*/
- public EnrolleeDevice newEnrolleeDevice(ProvisioningConfig provConfig, OnBoardingConfig onboardingConfig) {
+ public EnrolleeDevice newEnrolleeDevice(ProvisioningConfig provConfig, OnBoardingConfig onboardingConfig) throws IllegalArgumentException {
- if (onboardingConfig.getConnType() != OnBoardingConfig.ConnType.WiFi) {
+ if (null == provConfig || null == onboardingConfig) {
+ throw new IllegalArgumentException("provConfig/onboardingConfig is NULL");
+ }
+ else if (onboardingConfig.getConnType() != OnBoardingConfig.ConnType.WiFi) {
throw new IllegalArgumentException("OnBoarding configuration is not supported");
}
-
return new EnrolleeDeviceWiFiOnboarding(mContext, onboardingConfig, provConfig);
}
* @param provConfig Contains details about the network to which Enrollee device is going to connect.
* @return Instance of the Enrollee device created natively.
*/
- public EnrolleeDevice newEnrolleeDevice(ProvisioningConfig provConfig){
+ public EnrolleeDevice newEnrolleeDevice(ProvisioningConfig provConfig) throws IllegalArgumentException {
+
+ if (null == provConfig) {
+ throw new IllegalArgumentException("provConfig is NULL");
+ }
return new EnrolleeDeviceWiFiOnboarding(mContext, new IpOnBoardingConnection(true), provConfig);
}
-
}