Hi Stan
Can you check the return value from the following line in the ECHO_PING_REPLY case in fnHandleICP()?
fnWrite( INTERNAL_ROUTE, int_message, HEADER_LENGTH + 2); // we send details to the owner of the ping request
If the destination task can be found it will return (HEADER_LENGTH + 2), which is 7.
If it can't find a destination task to deliver to it will return 0.
This will give you an indication of whether it is a problem with the task name or not.
I just did a test. It is possible to command a ping in the demo project from the command line menu (UART, TELNET or USB). This worked normally, using the maintenance task as owner task.
I then modified the maintenance task to have a name like the one that you use. It also worked correctly so I didn't see any relationship to the name of the task. These are the two changes I made, please check that it corresponds to your code.
Original:
#define TASK_DEBUG 'm'
{ "maintenace",fnDebug, SMALL_QUEUE, (DELAY_LIMIT)(NO_DELAY_RESERVE_MONO), 0, UTASKER_STOP}, // Task used for debug messages (started by application)
Changed:
#define TASK_DEBUG '_'
{ "_maintenace",fnDebug, SMALL_QUEUE, (DELAY_LIMIT)(NO_DELAY_RESERVE_MONO), 0, UTASKER_STOP}, // Task used for debug messages (started by application)
Also check the method used to read the input in the task. Perhaps it is being woken by the message but the message not being handled correctly?
This is how the maintenance task does it:
while ( fnRead( PortIDInternal, ucInputMessage, HEADER_LENGTH )) { // check input queue
switch ( ucInputMessage[ MSG_SOURCE_TASK ] ) { // switch depending on message source
...
case TASK_ICMP:
fnRead( PortIDInternal, ucInputMessage, ucInputMessage[MSG_CONTENT_LENGTH]); // read the contents
if (ucInputMessage[ 0 ] == PING_RESULT) {
fnPingSuccess((USOCKET)ucInputMessage[ 1 ]);
}
break;
...
}
}
I notice that you are accessing ptrTaskTable->ucEvent. This is used only as a timer event (which is not generally accessed by user code) so this may explain the problem. It will also always have the value 0 when access by the task since it is reset before the task is scheduled.
Regards
Mark