Revision 7930ec45
som/net_helper-ml.c | ||
---|---|---|
47 | 47 |
static uint8_t *sendingBuffer[NH_BUFFER_SIZE]; |
48 | 48 |
// pointers to the received msgs + sender nodeID |
49 | 49 |
static uint8_t *receivedBuffer[NH_BUFFER_SIZE][2]; |
50 |
|
|
50 |
/**/ static int recv_counter =0; |
|
51 | 51 |
|
52 | 52 |
/** |
53 | 53 |
* Look for a free slot in the received buffer and allocates it for immediate use |
... | ... | |
172 | 172 |
p = (msgData_cb *)arg; |
173 | 173 |
if (p == NULL) return; |
174 | 174 |
mlSendData(connectionID,(char *)(sendingBuffer[p->bIdx]),p->mSize,p->msgType,NULL); |
175 |
///**/fprintf(stderr,"Sent message of type # %c and size %d\n", |
|
176 |
// ((char*)sendingBuffer[p->bIdx])[0]+'0', p->mSize); |
|
175 | 177 |
free(sendingBuffer[p->bIdx]); |
176 | 178 |
sendingBuffer[p->bIdx] = NULL; |
177 | 179 |
// fprintf(stderr,"Net-helper: Message # %d for connection %d sent!\n ", p->bIdx,connectionID); |
... | ... | |
208 | 210 |
static void recv_data_cb(char *buffer, int buflen, unsigned char msgtype, recv_params *arg) { |
209 | 211 |
// TODO: lacks a void* arg... moreover: recv_params has a msgtype, but there is also a msgtype explicit argument... |
210 | 212 |
// fprintf(stderr, "Net-helper : called back with some news...\n"); |
213 |
/**/ ++recv_counter; |
|
211 | 214 |
char str[SOCKETID_STRING_SIZE]; |
212 | 215 |
if (arg->remote_socketID != NULL) |
213 | 216 |
mlSocketIDToString(arg->remote_socketID,str,SOCKETID_STRING_SIZE); |
... | ... | |
215 | 218 |
sprintf(str,"!Unknown!"); |
216 | 219 |
if (arg->nrMissingBytes || !arg->firstPacketArrived) { |
217 | 220 |
fprintf(stderr, "Net-helper : corrupted message arrived from %s\n",str); |
221 |
/**/ fprintf(stderr, "\tMessage # %d -- Message type: %c -- Missing # %d frags\n", |
|
222 |
recv_counter, buffer[0],arg->nrMissingBytes, arg->firstPacketArrived?" => Missing first!":""); |
|
218 | 223 |
} |
219 | 224 |
else { |
220 | 225 |
// fprintf(stderr, "Net-helper : message arrived from %s\n",str); |
Also available in: Unified diff