 void mqttReconnect();
 
 void myAsyncPacketHandler(T_DPA_PACKET *dpaAnswerPkt);
-uint8_t sendMyDpaRequest(T_DPA_PACKET *DpaRequest, UINT8 DataSize, UINT16 Timeout);
-void simpleDpaCmd (uint16_t Addr, uint8_t Peripheral, uint8_t Cmd);
+uint8_t sendMyDpaRequest(T_DPA_PACKET *DpaRequest, uint8_t DataSize, uint16_t Timeout);
+void simpleDpaCmd(uint16_t Addr, uint8_t Peripheral, uint8_t Cmd);
+void systemTimerIterruptHandler(void);
 #if defined(__PIC32MX__)
-  uint32_t systemTimerIterruptHandler(uint32_t CurrentTime);
-#else
-  void systemTimerIterruptHandler(void);
+uint32_t systemTimerIterruptHandlerPic32(uint32_t CurrentTime);
 #endif
 
 /*

 * @param payload
 * @param length
 */
void mqttCallback(char* topic, byte* payload, unsigned int length) {
    Serial.print("Message arrived [");
    Serial.print(topic);
    Serial.print("] ");
    for (uint16_t i = 0; i < length; i++) {
        Serial.print((char) payload[i]);
    }
    Serial.println();
}
//=============================================================================

/**
 * Check MQTT connection and reconnect
 */
void mqttReconnect() {
    Serial.print("Attempting MQTT connection...");
    // Attempt to connect
    if (client.connect("iqrfClient")) {
        Serial.println("connected");
        // Once connected, publish an announcement...
        client.publish("outTopic", "hello world");
        // ... and resubscribe
        client.subscribe("inTopic");
    } else {
        Serial.print("failed, rc=");
        Serial.print(client.state());
        Serial.println(" try again in 5 seconds");
    }
}
//=============================================================================

 * Variables
 */
typedef struct {
	// Timer
	volatile uint16_t SwTimer;
	uint16_t SwTimerPreset;
	volatile bool SwTimerAck;
#if defined(__PIC32MX__)
	uint32_t SwTimerTimmingInterval;
#endif
	// DPA
	uint8_t State;
	uint8_t AsyncPacketFlag;
	T_DPA_PACKET MyDpaRequest;
} APP_VARS;
APP_VARS AppVars;

