1
0

finish project

This commit is contained in:
Rémi Heredero 2024-04-25 14:59:15 +02:00
parent 35b3457585
commit ecf4b3617e
2 changed files with 75 additions and 42 deletions

View File

@ -81,7 +81,7 @@ void MacSender(void *argument) {
// Send one msg from internal queue if exist // Send one msg from internal queue if exist
//if (osMemoryPoolGetCount(queue_macData_id) != 0) { // Message in Queue //if (osMemoryPoolGetCount(queue_macData_id) != 0) { // Message in Queue
retCode = osMessageQueueGet(queue_macData_id, &queueMsg, NULL, 0); retCode = osMessageQueueGet(queue_macData_id, &queueMsg, NULL, 0);
CheckRetCode(retCode, __LINE__, __FILE__, CONTINUE); //CheckRetCode(retCode, __LINE__, __FILE__, CONTINUE);
if(retCode == 0){ if(retCode == 0){
queueMsg.type = TO_PHY; queueMsg.type = TO_PHY;
retCode = osMessageQueuePut( retCode = osMessageQueuePut(
@ -237,6 +237,12 @@ void MacSender(void *argument) {
src.nothing = 0; src.nothing = 0;
length = strlen(queueMsg.anyPtr); length = strlen(queueMsg.anyPtr);
if(dst.addr != BROADCAST_ADDRESS) {
stationStatus.raw = gTokenInterface.station_list[dst.addr];
}
if( (stationStatus.chat == 1) || (dst.addr == BROADCAST_ADDRESS)) {
if(dst.addr == BROADCAST_ADDRESS) { if(dst.addr == BROADCAST_ADDRESS) {
status.read = 1; status.read = 1;
status.ack = 1; status.ack = 1;
@ -260,12 +266,8 @@ void MacSender(void *argument) {
retCode = osMemoryPoolFree(memPool, queueMsg.anyPtr); retCode = osMemoryPoolFree(memPool, queueMsg.anyPtr);
CheckRetCode(retCode, __LINE__, __FILE__, CONTINUE); CheckRetCode(retCode, __LINE__, __FILE__, CONTINUE);
stationStatus.raw = lastToken[dst.addr+1];
if(stationStatus.chat == 1) { if( (dst.addr != BROADCAST_ADDRESS) && (dst.sapi == CHAT_SAPI) ) {
if(dst.addr != BROADCAST_ADDRESS) {
if(dst.sapi == CHAT_SAPI) {
lastSentMsgPtr = osMemoryPoolAlloc(memPool, 0); lastSentMsgPtr = osMemoryPoolAlloc(memPool, 0);
if(lastSentMsgPtr == NULL) { if(lastSentMsgPtr == NULL) {
printf("Memory allocation failed #2\r\n"); printf("Memory allocation failed #2\r\n");
@ -274,7 +276,6 @@ void MacSender(void *argument) {
memcpy(lastSentMsgPtr, msg, length+4); memcpy(lastSentMsgPtr, msg, length+4);
// TODO test if station is online // TODO test if station is online
} }
}
queueMsg.anyPtr = msg; queueMsg.anyPtr = msg;
queueMsg.type = TO_PHY; queueMsg.type = TO_PHY;

View File

@ -159,7 +159,7 @@
<Type>0</Type> <Type>0</Type>
<LineNumber>18</LineNumber> <LineNumber>18</LineNumber>
<EnabledFlag>1</EnabledFlag> <EnabledFlag>1</EnabledFlag>
<Address>134311438</Address> <Address>134311450</Address>
<ByteObject>0</ByteObject> <ByteObject>0</ByteObject>
<HtxType>0</HtxType> <HtxType>0</HtxType>
<ManyObjects>0</ManyObjects> <ManyObjects>0</ManyObjects>
@ -173,9 +173,9 @@
<Bp> <Bp>
<Number>1</Number> <Number>1</Number>
<Type>0</Type> <Type>0</Type>
<LineNumber>263</LineNumber> <LineNumber>264</LineNumber>
<EnabledFlag>1</EnabledFlag> <EnabledFlag>1</EnabledFlag>
<Address>134256140</Address> <Address>134256144</Address>
<ByteObject>0</ByteObject> <ByteObject>0</ByteObject>
<HtxType>0</HtxType> <HtxType>0</HtxType>
<ManyObjects>0</ManyObjects> <ManyObjects>0</ManyObjects>
@ -184,11 +184,43 @@
<BreakIfRCount>1</BreakIfRCount> <BreakIfRCount>1</BreakIfRCount>
<Filename>.\mac_sender.c</Filename> <Filename>.\mac_sender.c</Filename>
<ExecCommand></ExecCommand> <ExecCommand></ExecCommand>
<Expression>\\tokenring_project\mac_sender.c\263</Expression> <Expression>\\tokenring_project\mac_sender.c\264</Expression>
</Bp> </Bp>
<Bp> <Bp>
<Number>2</Number> <Number>2</Number>
<Type>0</Type> <Type>0</Type>
<LineNumber>86</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134255102</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>.\mac_sender.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\tokenring_project\mac_sender.c\86</Expression>
</Bp>
<Bp>
<Number>3</Number>
<Type>0</Type>
<LineNumber>199</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\mac_sender.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>4</Number>
<Type>0</Type>
<LineNumber>199</LineNumber> <LineNumber>199</LineNumber>
<EnabledFlag>1</EnabledFlag> <EnabledFlag>1</EnabledFlag>
<Address>0</Address> <Address>0</Address>