deviceStorage.updateDevice

Boolean deviceStorage.updateDevice(String deviceId, Device updateThisDevice)

Update device in list by authority id

Params

parameter type description
deviceId deviceId Id string used to look up a specific device

Output

type description
Boolean Returns true if device was successfully updated, otherwise false including if device is not in list

Examples

DeviceStorage deviceStorage = new DeviceStorage();
Device device = new Device("10.10.10.10", "80", false, "username", "password");

Console.WriteLine(device.ToString());

deviceStorage.addDevice(device);
deviceStorage.updateDevice(device.authority, new Device("10.10.10.10", "80", false, "username2", "password2"));

Device updatedDevice = devices.getDevice(device.authority);

Console.WriteLine(updatedDevice.ToString());