00001
00007 #include "ccsinterface.h"
00008 #include <conv-ccs.h>
00009
00010 #if(CMK_CCS_AVAILABLE)
00011 #include <stdlib.h>
00012
00013 static int shouldReply=0;
00014 static CcsDelayedReply theReply;
00015
00016 extern "C" void CApplicationDepositNode0Data(char *data)
00017 {
00018 char *reply;
00019 int len;
00020
00021 if(shouldReply == 0) {
00022 return;
00023 }
00024
00025 len = strlen(data) + 8;
00026 reply = (char *)malloc(len * sizeof(char));
00027 strcpy(reply, "namdpr ");
00028 strcat(reply, data);
00029
00030
00031 CcsSendDelayedReply(theReply, strlen(reply) + 1, reply);
00032 shouldReply=0;
00033 free(reply);
00034 }
00035
00036
00037 void CApplicationRequestData(void)
00038 {
00039 shouldReply=1;
00040 theReply=CcsDelayReply();
00041 }
00042
00043 void CApplicationInit(void)
00044 {
00045 CcsRegisterHandler("perf_app",(CmiHandler)CApplicationRequestData);
00046 }
00047
00048 #endif