hmm, I think maybe my problem is in output()
here it is
Code:
int output(unsigned char *data) {
int num_bytes =2;
// use the rfcomm_pcb passed into the rfcomm_connected function as the 'global' pcb
// Put data into rfcomm_pcb payload, send it out then free the buffer
struct pbuf *p;
p = pbuf_alloc(PBUF_RAW, num_bytes, PBUF_RAM);
memcpy( ((u8_t *)p->payload) , data, num_bytes); // <----------is this whats stuffing?
if (0) {
printf("\n sending via rfcomm... \n");
int i;
for (i=0; i< num_bytes; i++) {
printf("data[%d] = %d \n", i, ((u8_t *)p->payload)[i] );
}
}
if(rfcomm_cl(global_pcb)) {
// why 6 credits??
// printf("using uih_credits = 6 \n");
rfcomm_uih_credits(global_pcb, 6, p);
} else {
rfcomm_uih(global_pcb, rfcomm_cn(global_pcb), p);
}
pbuf_free(p);
return ERR_OK;
}
thanks for your help