}
}
-function Device(id, name, profile, services) {
+function Device(id, name, type, services) {
validator_.isConstructorCall(this, Device);
this.id = id;
this.name = name;
- this.profile = profile;
+ this.type = type;
this.services = services;
}
}
]);
- if (this.serviceState == ConnectionState.CONNECTED)
+ if (this.connectionState == ConnectionState.CONNECTED)
throw new WebAPIException('InvalidStateError', 'Service is connected already.');
var lid = this._serviceId;
}
]);
- if (this.serviceState != ConnectionState.CONNECTED) {
+ if (this.connectionsState != ConnectionState.CONNECTED) {
throw new WebAPIException('InvalidStateError', 'Service is not connected yet.');
}
if (native_.isFailure(result)) {
throw native_.getErrorObject(result);
} else {
- connectionState = ConnectionState.DISCONNECTED;
+ this.connectionState = ConnectionState.DISCONNECTED;
}
native_.callIfPossible(successCallback, this);
}
]);
- if (this.serviceState == ConnectionState.CONNECTED)
+ if (this.connectionState == ConnectionState.CONNECTED)
throw new WebAPIException('InvalidStateError', 'Service is connected already.');
var lid = this._serviceId;
}
]);
- if (this.serviceState == ConnectionState.CONNECTED)
+ if (this.connectionState == ConnectionState.CONNECTED)
throw new WebAPIException('InvalidStateError', 'Service is connected already.');
var lid = this._serviceId;
nullable: true
}
]);
- if (this.serviceState != ConnectionState.CONNECTED)
+ if (this.connectionState != ConnectionState.CONNECTED)
throw new WebAPIException('InvalidStateError', 'Service is not connected yet.');
var result = native_.call('AppCommunicationClientService_disconnect', {
native_.callIfPossible(errorCallback, native_.getErrorObject(result));
}
});
+
if (native_.isFailure(result)) {
throw native_.getErrorObject(result);
} else {
- connectionState = ConnectionState.DISCONNECTED;
+ this.connectionState = ConnectionState.DISCONNECTED;
}
native_.callIfPossible(successCallback, this);