aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Communication
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-11-13 10:46:15 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-11-13 10:46:15 +0200
commit00525cc261ec117e2eb78ac2a4525fa3da92d399 (patch)
tree9f4c311d915b0305f31925bab4d87a97cf82d790 /Software/Embedded_SW/Embedded/Communication
parent8d4920307ed4bbb6760245728934b91e249fe6c4 (diff)
parent996422d12e0a40aa408757989232f0225dc29a28 (diff)
downloadTango-00525cc261ec117e2eb78ac2a4525fa3da92d399.tar.gz
Tango-00525cc261ec117e2eb78ac2a4525fa3da92d399.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Communication')
-rw-r--r--Software/Embedded_SW/Embedded/Communication/CommunicationTask.c8
-rw-r--r--Software/Embedded_SW/Embedded/Communication/Container.c17
2 files changed, 15 insertions, 10 deletions
diff --git a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
index 2b551108d..b27ab687d 100644
--- a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
+++ b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
@@ -15,7 +15,7 @@ static void (*callback)(char* buffer, size_t length);
Mailbox_Handle CommunicationRxMsgQ = NULL;
Mailbox_Handle CommunicationTxMsgQ = NULL;
-#define COMMUNICATION_NUM_MSGS 15
+#define COMMUNICATION_NUM_MSGS 20
typedef struct CommRxMessage{
//uint16_t messageId;
uint16_t msgSize;
@@ -157,7 +157,7 @@ void communicationTask(UArg arg0, UArg arg1)
}
}
-int UnSentMessages=0;
+int UnSentMessages=0, deliveryfailure = 0;
bool CommunicationTaskSendMessage(char* buffer,size_t length)
{
CommTxMessageStruc Message;
@@ -173,11 +173,14 @@ bool CommunicationTaskSendMessage(char* buffer,size_t length)
if (retcode == false)
{
my_free(buffer);
+ deliveryfailure++;
+ CommunicationMailboxFlush();
}
return retcode;
}
+int memoryrelease = 0;
void CommunicationMailboxFlush(void)
{
int i;
@@ -189,6 +192,7 @@ void CommunicationMailboxFlush(void)
UnSentMessages--;
LOG_ERROR(Message.msgSize,"Flushing Message");
my_free(Message.Buff);
+ memoryrelease+=Message.msgSize;
}
}
}
diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c
index 408e88a3d..337e7c368 100644
--- a/Software/Embedded_SW/Embedded/Communication/Container.c
+++ b/Software/Embedded_SW/Embedded/Communication/Container.c
@@ -44,12 +44,13 @@
#include "Common/report/report.h"
#include "Connection.h"
-/*
-uint32_t TxmsgId[50] = {0};
-uint32_t TxLength[50] = {0};
-uint32_t TxAddr[50] = {0};
+#define MAX_CONT_LOG 300
+
+uint32_t TxmsgId[MAX_CONT_LOG+1] = {0};
+uint32_t TxLength[MAX_CONT_LOG+1] = {0};
+uint32_t TxAddr[MAX_CONT_LOG+1] = {0};
byte Txindex = 0;
-uint32_t msgId[50] = {0};
+/*uint32_t msgId[50] = {0};
uint32_t Length[50] = {0};
uint32_t DataLength[50] = {0};
byte index = 0;
@@ -75,12 +76,12 @@ MessageContainer createContainer(MessageType type, char* token, protobuf_c_boole
container.data.data = response_buffer;
container.data.len = response_size;
- /*TxmsgId[Txindex] = type;
+ TxmsgId[Txindex] = type;
TxLength[Txindex] = response_size;
TxAddr[Txindex] = response_buffer;
- if (Txindex++>=50)
+ if (Txindex++>=MAX_CONT_LOG)
Txindex = 0;
-*/
+
//free(response);
return container;
}