diff --git a/EthernetGateway/EthernetGateway.ino b/EthernetGateway/EthernetGateway.ino index f6c2481..9059a07 100644 --- a/EthernetGateway/EthernetGateway.ino +++ b/EthernetGateway/EthernetGateway.ino @@ -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 diff --git a/libraries/MySensors/MyMessage.cpp b/libraries/MySensors/MyMessage.cpp index 7d34eb2..999521c 100644 --- a/libraries/MySensors/MyMessage.cpp +++ b/libraries/MySensors/MyMessage.cpp @@ -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;