![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: DeviceIntegration.cpp
- Revision:
- 77:f6717e4eccc4
- Parent:
- 72:c5709ae7b193
- Child:
- 91:48069375dffa
--- a/DeviceIntegration.cpp Wed Feb 25 10:06:11 2015 +0000 +++ b/DeviceIntegration.cpp Tue Mar 03 14:10:09 2015 +0000 @@ -85,20 +85,20 @@ return false; if (_client.send(record) != SMARTREST_SUCCESS) { - aWarning("Send failed."); + aWarning("Send failed.\r\n"); _client.stop(); return false; } if (_client.receive(received) != SMARTREST_SUCCESS) { - aError("No device found."); + aError("No device found.\r\n"); _client.stop(); return false; } _client.stop(); if (received.values() == 0) { - aWarning("Received no values."); + aError("Received no values.\r\n"); return false; } @@ -107,7 +107,7 @@ } if (received.value(0).integerValue() != 200) { - puts("Bad response."); + aError("Bad response.\r\n"); return false; } @@ -121,7 +121,7 @@ ComposedRecord record; ParsedRecord received; - puts("Creating device..."); + aInfo("Creating device...\r\n"); IntegerValue msgId(101); CharValue imei(_deviceInfo.imei()); @@ -129,25 +129,25 @@ return false; if (_client.send(record) != SMARTREST_SUCCESS) { - puts("Send failed."); + aError("Failed to sending data when creating device.\r\n"); _client.stop(); return 0; } if (_client.receive(received) != SMARTREST_SUCCESS) { - puts("No device found."); + aError("No device found.\r\n"); _client.stop(); return false; } _client.stop(); if (received.values() != 3) { - puts("Bad received data."); + aError("Received incomplete data when creating device.\r\n"); return false; } if (received.value(0).integerValue() != 201) { - puts("Bad received data."); + aError("Received invalid data when creating device.\r\n"); return false; } @@ -160,7 +160,7 @@ ComposedRecord record; ParsedRecord received; - puts("Adding global identifier..."); + aInfo("Adding global identifier...\r\n"); IntegerValue msgId(102); IntegerValue deviceId(_deviceId); @@ -169,25 +169,25 @@ return false; if (_client.send(record) != SMARTREST_SUCCESS) { - puts("Sending failed."); + aWarning("Adding global identifier failed.\r\n"); _client.stop(); return false; } if (_client.receive(received) != SMARTREST_SUCCESS) { - puts("Failed."); + aError("Received data failed when adding global identifier.\r\n"); _client.stop(); return false; } _client.stop(); if (received.values() != 3) { - puts("Received bad data."); + aError("Received incomplete data when adding global identifier.\r\n"); return false; } if (received.value(0).integerValue() != 200) { - puts("Received bad data."); + aError("Received invalid data when adding global identifier.\r\n"); return false; } @@ -208,25 +208,25 @@ return false; if (_client.send(record) != SMARTREST_SUCCESS) { - puts("Send failed."); + aError("Sending data failed when updating device.\r\n"); _client.stop(); return false; } if (_client.receive(received) != SMARTREST_SUCCESS) { - puts("Update failed."); + aError("Updating device failed.\r\n"); _client.stop(); return false; } _client.stop(); if (received.values() != 3) { - puts("Bad received data."); + aError("Received incomplete data when updating device.\r\n"); return false; } if (received.value(0).integerValue() != 201) { - puts("Bad received data."); + aError("Received invalid data when updating device.\r\n"); return false; }