summaryrefslogtreecommitdiff
path: root/host
diff options
context:
space:
mode:
authorlefranc2007-06-21 15:43:49 +0000
committerlefranc2007-06-21 15:43:49 +0000
commitec87dbdd67642c0328ee72d74a36f136e964bbbc (patch)
tree905238335c254a85a6b270019d38603974c2f401 /host
parentf5e5ae0163fc8c653be469b2fae04aac74b7f4a6 (diff)
- added logs for fcall process
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@352 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'host')
-rw-r--r--host/inc/station.h1
-rw-r--r--host/src/fcall.c14
2 files changed, 14 insertions, 1 deletions
diff --git a/host/inc/station.h b/host/inc/station.h
index 72777bc565..868aeccea1 100644
--- a/host/inc/station.h
+++ b/host/inc/station.h
@@ -57,6 +57,7 @@ typedef enum
STATION_LOG_NONE,
STATION_LOG_ERROR,
STATION_LOG_WARNING,
+ STATION_LOG_NOTICE,
STATION_LOG_INFO,
STATION_LOG_DEBUG,
STATION_LOG_NB
diff --git a/host/src/fcall.c b/host/src/fcall.c
index 5501369f30..bdfcd6d9e9 100644
--- a/host/src/fcall.c
+++ b/host/src/fcall.c
@@ -211,6 +211,8 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
/* check header content */
if(msg->hdr.fcall->type != FUNCTION_CALL_TYPE_REQ)
{
+ station_log(fcall->sci->station, STATION_LOG_WARNING, STATION_LOGTYPE_FCALL,
+ "%s bad type %x", __FUNCTION__, msg->hdr.fcall->type);
errno = EPROTOTYPE;
return -1;
}
@@ -224,6 +226,8 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
if((strlen((char *)(msg->data_begin)) == 0)
|| (strlen((char *)(msg->data_begin)) >= FUNCTION_CALL_ID_MAX_SIZE))
{
+ station_log(fcall->sci->station, STATION_LOG_WARNING, STATION_LOGTYPE_FCALL,
+ "%s bad id length", __FUNCTION__);
fcall->param.param_nb = 0;
errno = ENOENT;
return -1;
@@ -247,7 +251,9 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
}
if(function_index >= fcall->function_nb)
{
- errno = ENOSPC;
+ station_log(fcall->sci->station, STATION_LOG_NOTICE, STATION_LOGTYPE_FCALL,
+ "%s function '%s' not registered", __FUNCTION__, fcall->param.id);
+ errno = ENOENT;
return -1;
}
@@ -256,6 +262,8 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
{
if(msg->length == 0)
{
+ station_log(fcall->sci->station, STATION_LOG_WARNING, STATION_LOGTYPE_FCALL,
+ "%s no space into msg for param #%d", __FUNCTION__, index);
errno = ENOSPC;
return -1;
}
@@ -268,12 +276,16 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
}
/* call the function */
+ station_log(fcall->sci->station, STATION_LOG_INFO, STATION_LOGTYPE_FCALL,
+ "%s calling function '%s' with %d parameters", __FUNCTION__, fcall->function_table[function_index].id, param->param_nb);
if((*fcall->function_table[function_index].function)(
&param,
&msg,
fcall->function_table[function_index].data) < 0)
{
/* function returned error */
+ station_log(fcall->sci->station, STATION_LOG_NOTICE, STATION_LOGTYPE_FCALL,
+ "%s function '%s' returned -1", __FUNCTION__, fcall->function_table[function_index].id);
return -1;
}