summaryrefslogtreecommitdiff
path: root/host/src/netclock.c
diff options
context:
space:
mode:
authorlefranc2007-07-04 13:11:04 +0000
committerlefranc2007-07-04 13:11:04 +0000
commit5d4f887e342adb7bf578533772a7817ea2fc7913 (patch)
tree8f9fb8e07556f0a03b831b6cb95d6b2b3f887367 /host/src/netclock.c
parent1ef1f3bbd6caf7a0acb38b660760d214834aa578 (diff)
- added pointer to get netclock msg id into netclock_schedule() prototype
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@439 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'host/src/netclock.c')
-rw-r--r--host/src/netclock.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/host/src/netclock.c b/host/src/netclock.c
index 7b0ae452e8..6b8fa13910 100644
--- a/host/src/netclock.c
+++ b/host/src/netclock.c
@@ -82,6 +82,7 @@ int netclock_init(netclock_ctx_t *netclock, sci_ctx_t *sci)
* \param tick next tick to start the event
* \param function pointer to the callback function to process the received message
* \param data user data to be included into callback function as 'data' parameter
+ * \param id pointer filled with id used to create the netclock msg
* \return 0 if ok, -1 if failed with errno:
* - EINVAL if netclock or msg is null, or if tick < current_tick
* - ENOSPC if there is no more place to register a callback function
@@ -92,7 +93,9 @@ int netclock_schedule(
netclock_type_t type,
tick_t schedule_tick,
void (*callback_function)(void *data),
- void *callback_data)
+ void *callback_data,
+ netclock_id_t *id
+ )
{
sci_msg_t msg;
unsigned char buffer[256];
@@ -102,7 +105,8 @@ int netclock_schedule(
|| (type >= NETWORK_CLOCK_TYPE_NB)
|| (schedule_tick < netclock->sci->station->current_tick_tck)
|| (callback_function == NULL)
- || (callback_data == NULL))
+ || (callback_data == NULL)
+ || (id == NULL))
{
errno = EINVAL;
return -1;
@@ -122,6 +126,7 @@ int netclock_schedule(
netclock->callback_nb++;
/* fill the netclock message part */
+ *id = netclock->current_id;
netclock_fill_hdr(netclock, &msg, type, 0, schedule_tick);
/* fill the sci message part */