comparison gsm-fw/services/etm/etm_api.c @ 972:6de5661d1fe1

gsm-fw/services/etm/etm_api.c: same fix in etm_pkt_send() as in tcs211-c139
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Fri, 13 Nov 2015 19:29:16 +0000
parents f9ac53d8e999
children
comparison
equal deleted inserted replaced
971:53114af707f2 972:6de5661d1fe1
251 *********************************************************************************/ 251 *********************************************************************************/
252 252
253 int etm_pkt_send(T_ETM_PKT *pkt) 253 int etm_pkt_send(T_ETM_PKT *pkt)
254 { 254 {
255 extern unsigned char etm_trace_user_id; 255 extern unsigned char etm_trace_user_id;
256 uint8 *buf, cksum = 0, sendsize, size; 256 uint8 *buf, cksum = 0;
257 uint16 sendsize, size;
257 int error = ETM_OK; 258 int error = ETM_OK;
258 259
259 buf = (uint8 *) &pkt->mid; 260 buf = (uint8 *) &pkt->mid;
260 sendsize = size = pkt->size + 2; //one for mid, one for status 261 sendsize = size = pkt->size + 2; //one for mid, one for status
261 262
262 tr_etm(TgTrEtmLow, "ETM API: _pkt_send: size(%d)", sendsize); 263 tr_etm(TgTrEtmLow, "ETM API: _pkt_send: size(%d)", sendsize);
263 264
264 while (size-- ) { 265 while (size-- ) {
265 cksum ^= *buf++; 266 cksum ^= *buf++;
267 *buf = cksum; 268 *buf = cksum;
268 269
269 sendsize += 1; // one for checksum 270 sendsize += 1; // one for checksum
270 271
271 tr_etm_hexdump(TgTrEtmLow, &pkt->mid, sendsize); 272 tr_etm_hexdump(TgTrEtmLow, &pkt->mid, sendsize);
272 273
273 error = rvt_send_trace_cpy((uint8 *) &pkt->mid, etm_trace_user_id, 274 error = rvt_send_trace_cpy((uint8 *) &pkt->mid, etm_trace_user_id,
274 sendsize, RVT_BINARY_FORMAT); 275 sendsize, RVT_BINARY_FORMAT);
275 if(error < 0) 276 if(error < 0)
276 tr_etm(TgTrFatal, "ETM API: _pkt_send: ERROR(%d)", error); 277 tr_etm(TgTrFatal, "ETM API: _pkt_send: ERROR(%d)", error);
277 278
278 return error; 279 return error;