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); 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 // 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 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); itoa(iValue, buffer, MAX_PAYLOAD);
break; break;
case P_UINT16: case P_UINT16:
ltoa(uiValue, buffer, MAX_PAYLOAD); utoa(uiValue, buffer, MAX_PAYLOAD);
break; break;
case P_LONG32: case P_LONG32:
ltoa(lValue, buffer, MAX_PAYLOAD); ltoa(lValue, buffer, MAX_PAYLOAD);
break; break;
case P_ULONG32: case P_ULONG32:
ltoa(ulValue, buffer, MAX_PAYLOAD); ultoa(ulValue, buffer, MAX_PAYLOAD);
break; break;
case P_CUSTOM: case P_CUSTOM:
// TODO: Ok, what do we do here? We should probably convert this to hex // 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) { MyMessage* MyMessage::set(unsigned int value) {
miSetPayloadType(P_INT16); miSetPayloadType(P_UINT16);
miSetLength(2); miSetLength(2);
uiValue = value; uiValue = value;
return this; return this;
} }
MyMessage* MyMessage::set(int value) { MyMessage* MyMessage::set(int value) {
miSetPayloadType(P_UINT16); miSetPayloadType(P_INT16);
miSetLength(2); miSetLength(2);
iValue = value; iValue = value;
return this; return this;