//printf("kickptt %i %i %i\n",o->txkeyed,o->txchankey,o->txtestkey);
if (!o) return;
if (!o->pttkick) return;
- write(o->pttkick[1],&c,1);
+ if (write(o->pttkick[1],&c,1) < 0) {
+ ast_log(LOG_ERROR, "write() failed: %s\n", strerror(errno));
+ }
}
/*
*/
{
char c;
- read(o->pttkick[0],&c,1);
+ if (read(o->pttkick[0],&c,1) < 0) {
+ ast_log(LOG_ERROR, "read() failed: %s\n", strerror(errno));
+ }
}
if(o->wanteeprom)
{
tbuff[i]= ((i16*)(f->data.ptr))[i/2];
tbuff[i+1]= o->txkeyed*M_Q13;
}
- fwrite(tbuff,2,f->datalen,ftxcapraw);
+ if (fwrite(tbuff,2,f->datalen,ftxcapraw) != f->datalen) {
+ ast_log(LOG_ERROR, "write() failed: %s\n", strerror(errno));
+ }
//fwrite(f->data,1,f->datalen,ftxcapraw);
}
#endif
return f;
#if DEBUG_CAPTURES == 1
- if (o->b.rxcapraw && frxcapraw) fwrite((o->usbradio_read_buf + AST_FRIENDLY_OFFSET),1,FRAME_SIZE * 2 * 2 * 6,frxcapraw);
+ if ((o->b.rxcapraw && frxcapraw) && (fwrite((o->usbradio_read_buf + AST_FRIENDLY_OFFSET),1,FRAME_SIZE * 2 * 2 * 6,frxcapraw) != FRAME_SIZE * 2 * 2 * 6)) {
+ ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno));
+ }
#endif
#if 1
#endif
#if DEBUG_CAPTURES == 1 && XPMR_DEBUG0 == 1
- if (o->b.txcap2 && ftxcaptrace) fwrite((o->pmrChan->ptxDebug),1,FRAME_SIZE * 2 * 16,ftxcaptrace);
+ if ((o->b.txcap2 && ftxcaptrace) && (fwrite((o->pmrChan->ptxDebug),1,FRAME_SIZE * 2 * 16,ftxcaptrace) != FRAME_SIZE * 2 * 16)) {
+ ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno));
+ }
#endif
// 160 samples * 2 bytes/sample * 2 chan * 6x oversampling to 48KS/s
#endif
#if DEBUG_CAPTURES == 1 && XPMR_DEBUG0 == 1
- if (frxcaptrace && o->b.rxcap2 && o->pmrChan->b.radioactive) fwrite((o->pmrChan->prxDebug),1,FRAME_SIZE * 2 * 16,frxcaptrace);
+ if ((frxcaptrace && o->b.rxcap2 && o->pmrChan->b.radioactive) && (fwrite((o->pmrChan->prxDebug),1,FRAME_SIZE * 2 * 16,frxcaptrace) != FRAME_SIZE * 2 * 16 )) {
+ ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno));
+ }
#endif
cd = 0;
PmrRx(pChan,iBuff,oBuff);
- fwrite((void *)pChan->prxDebug,2,numSamples*numChannels,hOutput);
+ if (fwrite((void *)pChan->prxDebug,2,numSamples*numChannels,hOutput) != numSamples * numChannels) {
+ ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno));
+ }
}
pChan->b.txCapture=0;
pChan->b.rxCapture=0;