cloud-of-things/cot-java-rest-sdk

OperationStatus cannt map the status WAITING_FOR_CONNECTION

crmolinaz opened this issue · 2 comments

Hi,
when try to register a device in the cloud as parent device, there is a method in DeviceControlApi.createNewDevice that receive an operation as parameter. This method also, doesnt get the result fron the CoT, is a bug too. Then, when i do the request manually, i try to check the status of the operation and get this error that describe below:

java.lang.IllegalArgumentException: No enum constant com.telekom.m2m.cot.restsdk.devicecontrol.OperationStatus.WAITING_FOR_CONNECTION

In the class OperationStatus doesnt exists a map for that value, can you please fix this? also will be nice to have the other bug mentioned before, because the method DeviceControlApi.createNewDevice doesnt get the response from the CoT, is returning the same parameter given.

Thanks.

WAITING_FOR_CONNECTION is not a valid status of an Operation, I think. It's only a status for a NewDeviceRequest. I'm not sure how this exception could be produced.
But it doesn't seem logical that the createNewDevice method takes an Operation as a parameter, much less to return that parameter.

I checked out the documentation on the cumulocity website and I found that the object that I need is a newDeviceRequestResponse that has a similar structure to Operations.

An operation can handle just 4 states, so this issue should be closed.

Thanks for the answer, I was waiting since November.