diff --git a/apps/aqhome-tool/flash.c b/apps/aqhome-tool/flash.c index 87eea0f..dd4269c 100644 --- a/apps/aqhome-tool/flash.c +++ b/apps/aqhome-tool/flash.c @@ -39,6 +39,8 @@ #define FLASH_TOOL_MAX_REPEAT 16 +#define DEBUG_FLASH + static int _doFlash(GWEN_DB_NODE *dbArgs); static GWEN_MSG *_waitForFlashReadyMessageForUid(GWEN_MSG_ENDPOINT_MGR *emgr, GWEN_MSG_ENDPOINT *epTcp, @@ -246,6 +248,7 @@ int _doFlash(GWEN_DB_NODE *dbArgs) while(flashRecord) { int rv; + DBG_ERROR(NULL, "Sending flash record at %08x", AQH_FlashRecord_GetAddress(flashRecord)); rv=_sendFlashData(emgr, epTcp, flashRecord, pageSize, timeoutInSeconds); if (rv!=0) { DBG_ERROR(NULL, "Error sending flash data (%d)", rv); @@ -351,6 +354,11 @@ int _sendFlashData(GWEN_MSG_ENDPOINT_MGR *emgr, GWEN_MSG *msgOut; int rv; +#ifdef DEBUG_FLASH + DBG_ERROR(NULL, " Sending message: addr=%04x, data len=%d, pagesize=%d", address, sendLen, pageSize); + GWEN_Text_LogString((const char*) ptr, sendLen, NULL, GWEN_LoggerLevel_Error); +#endif + msgNode=AQH_FlashDataMsg_new(0, 0xc1, AQH_MSG_TYPE_FLASH_DATA, address, ptr, sendLen); if (msgNode==NULL) { DBG_ERROR(NULL, "Error creating message");