Fixed a couple of issues reported by a-lurker

This commit is contained in:
Henrik Ekblad
2014-05-28 22:27:36 +02:00
parent 6201d3cd54
commit c81a47c1f9
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -44,13 +44,13 @@ char* MyMessage::getString(char *buffer) {
itoa(iValue, buffer, MAX_PAYLOAD);
break;
case P_UINT16:
ltoa(uiValue, buffer, MAX_PAYLOAD);
utoa(uiValue, buffer, MAX_PAYLOAD);
break;
case P_LONG32:
ltoa(lValue, buffer, MAX_PAYLOAD);
break;
case P_ULONG32:
ltoa(ulValue, buffer, MAX_PAYLOAD);
ultoa(ulValue, buffer, MAX_PAYLOAD);
break;
case P_CUSTOM:
// TODO: Ok, what do we do here? We should probably convert this to hex
@@ -198,14 +198,14 @@ MyMessage* MyMessage::set(long value) {
}
MyMessage* MyMessage::set(unsigned int value) {
miSetPayloadType(P_INT16);
miSetPayloadType(P_UINT16);
miSetLength(2);
uiValue = value;
return this;
}
MyMessage* MyMessage::set(int value) {
miSetPayloadType(P_UINT16);
miSetPayloadType(P_INT16);
miSetLength(2);
iValue = value;
return this;