Skip to content

Commit

Permalink
further development dmr.c
Browse files Browse the repository at this point in the history
  • Loading branch information
on4akh committed Jul 30, 2014
1 parent c2409df commit f7a8a1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion convbin.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bool * convertToBits(unsigned char packet[33]){
convPacket[i+1] = *(packet +i);
//sprintf(dmrPacket,"%s%02x:%02x:",dmrPacket,convPacket[i],convPacket[i+1]);
}
syslog(LOG_NOTICE,"DMR packet:%s",dmrPacket);
//syslog(LOG_NOTICE,"DMR packet:%s",dmrPacket);

//convert to bits
for (i=0;i<33;i++){
Expand Down
8 changes: 2 additions & 6 deletions dmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,13 @@ void *dmrListener(void *f){
break;
}

memcpy(dmrPacket,buffer+26,34); //copy the dmr part out of the Hyetra packet
bits = convertToBits(dmrPacket); //convert it to bits

if (slotType == 0x4444){ //Data header
syslog(LOG_NOTICE,"[%i-%s]Data header on slot %i src %i dst %i type %i",baseDmrPort + repPos,repeaterList[repPos].callsign,slot,srcId,dstId,callType);
dmrState[slot] = DATA;
repeaterList[repPos].sending[slot] = true;
memcpy(dmrPacket,buffer+26,34); //copy the dmr part out of the Hyetra packet
bits = convertToBits(dmrPacket); //convert it to bits
decodeBPTC1969(bits);
break;
}
Expand All @@ -330,17 +330,13 @@ void *dmrListener(void *f){
dmrState[slot] = IDLE;
repeaterList[repPos].sending[slot] = false;
syslog(LOG_NOTICE,"[%i-%s]1/2 rate data continuation on slot %i src %i dst %i type %i",baseDmrPort + repPos,repeaterList[repPos].callsign,slot,srcId,dstId,callType);
memcpy(dmrPacket,buffer+26,34); //copy the dmr part out of the Hyetra packet
bits = convertToBits(dmrPacket); //convert it to bits
break;
}
if (slotType == 0x6666 && dmrState[slot] == DATA){ // 3/4 rate data continuation
syslog(LOG_NOTICE,"[%i-%s]3/4 rate data continuation on slot %i src %i dst %i type %i",baseDmrPort + repPos,repeaterList[repPos].callsign,slot,srcId,dstId,callType);
//put idle when blocks to follow equals
dmrState[slot] = IDLE;
repeaterList[repPos].sending[slot] = false;
memcpy(dmrPacket,buffer+26,34); //copy the dmr part out of the Hyetra packet
bits = convertToBits(dmrPacket); //convert it to bits
break;
}
break;
Expand Down

0 comments on commit f7a8a1d

Please sign in to comment.