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
+1 -1
View File
@@ -83,7 +83,7 @@ EthernetServer server = EthernetServer(IP_PORT);
MyGateway gw(RADIO_CE_PIN, RADIO_SPI_SS_PIN, INCLUSION_MODE_TIME);
// Uncomment this constructor if you have leds and include button attached to your gateway
//Gateway gw(RADIO_CE_PIN, RADIO_SPI_SS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN);
//MyGateway gw(RADIO_CE_PIN, RADIO_SPI_SS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN);
char inputString[MAX_RECEIVE_LENGTH] = ""; // A string to hold incoming commands from serial/ethernet interface
+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;