changed myicm to icm

pull/1/head
Tom Early 9 years ago
parent 96d5577d7e
commit cacb0cf2cd

@ -455,7 +455,7 @@ static void readFrom20000()
if ((memcmp(net_buf.pkt_id, "DSTR", 4) != 0) || if ((memcmp(net_buf.pkt_id, "DSTR", 4) != 0) ||
(net_buf.flag[0] != 0x73) || (net_buf.flag[0] != 0x73) ||
(net_buf.flag[1] != 0x12) || (net_buf.flag[1] != 0x12) ||
(net_buf.vpkt.myicm.icm_id != 0x20)) { /* voice type */ (net_buf.vpkt.icm.icm_id != 0x20)) { /* voice type */
FD_CLR(insock, &readfd); FD_CLR(insock, &readfd);
break; break;
} }
@ -466,13 +466,13 @@ static void readFrom20000()
written_to_q = true; written_to_q = true;
traceit("Start G2: streamid=%04x, flags=%02x:%02x:%02x, my=%.8s, sfx=%.4s, ur=%.8s, rpt1=%.8s, rpt2=%.8s\n", traceit("Start G2: streamid=%04x, flags=%02x:%02x:%02x, my=%.8s, sfx=%.4s, ur=%.8s, rpt1=%.8s, rpt2=%.8s\n",
net_buf.vpkt.myicm.streamid, net_buf.vpkt.icm.streamid,
net_buf.vpkt.hdr.flag[0], net_buf.vpkt.hdr.flag[1], net_buf.vpkt.hdr.flag[2], net_buf.vpkt.hdr.flag[0], net_buf.vpkt.hdr.flag[1], net_buf.vpkt.hdr.flag[2],
net_buf.vpkt.hdr.mycall, net_buf.vpkt.hdr.sfx, net_buf.vpkt.hdr.urcall, net_buf.vpkt.hdr.mycall, net_buf.vpkt.hdr.sfx, net_buf.vpkt.hdr.urcall,
net_buf.vpkt.hdr.rpt1, net_buf.vpkt.hdr.rpt2); net_buf.vpkt.hdr.rpt1, net_buf.vpkt.hdr.rpt2);
/* save the streamid that is winning */ /* save the streamid that is winning */
streamid = net_buf.vpkt.myicm.streamid; streamid = net_buf.vpkt.icm.streamid;
if (net_buf.vpkt.hdr.flag[0] != 0x01) { if (net_buf.vpkt.hdr.flag[0] != 0x01) {
@ -515,12 +515,12 @@ static void readFrom20000()
seq_no = 0; seq_no = 0;
} else if (len == 29) { } else if (len == 29) {
if (busy20000) { if (busy20000) {
if (net_buf.vpkt.myicm.streamid == streamid) { if (net_buf.vpkt.icm.streamid == streamid) {
if (net_buf.vpkt.myicm.ctrl == ctrl_in) { if (net_buf.vpkt.icm.ctrl == ctrl_in) {
/* do not update written_to_q, ctrl_in */ /* do not update written_to_q, ctrl_in */
; // traceit("dup\n"); ; // traceit("dup\n");
} else { } else {
ctrl_in = net_buf.vpkt.myicm.ctrl; ctrl_in = net_buf.vpkt.icm.ctrl;
written_to_q = true; written_to_q = true;
if (seq_no == 0) { if (seq_no == 0) {
@ -546,7 +546,7 @@ static void readFrom20000()
frame_pos_to_dvap = 0; frame_pos_to_dvap = 0;
dr.frame.streamid = stream_id_to_dvap; dr.frame.streamid = stream_id_to_dvap;
dr.frame.framepos = frame_pos_to_dvap; dr.frame.framepos = frame_pos_to_dvap;
if ((net_buf.vpkt.myicm.ctrl & 0x40) != 0) if ((net_buf.vpkt.icm.ctrl & 0x40) != 0)
dr.frame.framepos |= 0x40U; dr.frame.framepos |= 0x40U;
dr.frame.seq = seq_to_dvap; dr.frame.seq = seq_to_dvap;
memcpy(&dr.frame.vad.voice, net_buf.vpkt.vasd.voice, 12); memcpy(&dr.frame.vad.voice, net_buf.vpkt.vasd.voice, 12);
@ -560,8 +560,8 @@ static void readFrom20000()
if (seq_no == 21) if (seq_no == 21)
seq_no = 0; seq_no = 0;
if ((net_buf.vpkt.myicm.ctrl & 0x40) != 0) { if ((net_buf.vpkt.icm.ctrl & 0x40) != 0) {
traceit("End G2: streamid=%04x\n", net_buf.vpkt.myicm.streamid); traceit("End G2: streamid=%04x\n", net_buf.vpkt.icm.streamid);
streamid = 0; streamid = 0;
@ -1110,13 +1110,13 @@ static void ReadDVAPThread()
net_buf.flag[1] = 0x12; net_buf.flag[1] = 0x12;
net_buf.nothing2[0] = 0x00; net_buf.nothing2[0] = 0x00;
net_buf.nothing2[1] = 0x30; net_buf.nothing2[1] = 0x30;
net_buf.vpkt.myicm.icm_id = 0x20; net_buf.vpkt.icm.icm_id = 0x20;
net_buf.vpkt.myicm.dst_rptr_id = 0x00; net_buf.vpkt.icm.dst_rptr_id = 0x00;
net_buf.vpkt.myicm.snd_rptr_id = 0x01; net_buf.vpkt.icm.snd_rptr_id = 0x01;
net_buf.vpkt.myicm.snd_term_id = SND_TERM_ID; net_buf.vpkt.icm.snd_term_id = SND_TERM_ID;
streamid_raw = (rand_r(&aseed) % 65535U) + 1U; streamid_raw = (rand_r(&aseed) % 65535U) + 1U;
net_buf.vpkt.myicm.streamid = streamid_raw; net_buf.vpkt.icm.streamid = streamid_raw;
net_buf.vpkt.myicm.ctrl = 0x80; net_buf.vpkt.icm.ctrl = 0x80;
sequence = 0; sequence = 0;
calcPFCS((unsigned char *)&(net_buf.vpkt.hdr), net_buf.vpkt.hdr.pfcs); calcPFCS((unsigned char *)&(net_buf.vpkt.hdr), net_buf.vpkt.hdr.pfcs);
sendto(insock, &net_buf, 58, 0, (struct sockaddr *)&outaddr, sizeof(outaddr)); sendto(insock, &net_buf, 58, 0, (struct sockaddr *)&outaddr, sizeof(outaddr));
@ -1137,9 +1137,9 @@ static void ReadDVAPThread()
net_buf.counter = C_COUNTER; net_buf.counter = C_COUNTER;
net_buf.nothing2[1] = 0x13; net_buf.nothing2[1] = 0x13;
net_buf.vpkt.myicm.ctrl = sequence++; net_buf.vpkt.icm.ctrl = sequence++;
if (the_end) if (the_end)
net_buf.vpkt.myicm.ctrl = sequence | 0x40; net_buf.vpkt.icm.ctrl = sequence | 0x40;
memcpy(&net_buf.vpkt.vasd, &dr.frame.vad.voice, 12); memcpy(&net_buf.vpkt.vasd, &dr.frame.vad.voice, 12);
sendto(insock, &net_buf, 29, 0, (struct sockaddr *)&outaddr, sizeof(outaddr)); sendto(insock, &net_buf, 29, 0, (struct sockaddr *)&outaddr, sizeof(outaddr));

@ -881,13 +881,13 @@ static void runit()
// Let the repeater re-initialize // Let the repeater re-initialize
end_of_audio.counter = toRptr[i].G2_COUNTER; end_of_audio.counter = toRptr[i].G2_COUNTER;
if (i == 0) if (i == 0)
end_of_audio.vpkt.myicm.snd_term_id = 0x03; end_of_audio.vpkt.icm.snd_term_id = 0x03;
else if (i == 1) else if (i == 1)
end_of_audio.vpkt.myicm.snd_term_id = 0x01; end_of_audio.vpkt.icm.snd_term_id = 0x01;
else else
end_of_audio.vpkt.myicm.snd_term_id = 0x02; end_of_audio.vpkt.icm.snd_term_id = 0x02;
end_of_audio.vpkt.myicm.streamid = toRptr[i].streamid; end_of_audio.vpkt.icm.streamid = toRptr[i].streamid;
end_of_audio.vpkt.myicm.ctrl = toRptr[i].sequence | 0x40; end_of_audio.vpkt.icm.ctrl = toRptr[i].sequence | 0x40;
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
sendto(srv_sock, end_of_audio.pkt_id, 29, 0, (struct sockaddr *)&toRptr[i].band_addr, sizeof(struct sockaddr_in)); sendto(srv_sock, end_of_audio.pkt_id, 29, 0, (struct sockaddr *)&toRptr[i].band_addr, sizeof(struct sockaddr_in));
@ -2750,9 +2750,9 @@ int main(int argc, char **argv)
end_of_audio.flag[1] = 0x12; end_of_audio.flag[1] = 0x12;
end_of_audio.nothing2[0] = 0x00; end_of_audio.nothing2[0] = 0x00;
end_of_audio.nothing2[1] = 0x13; end_of_audio.nothing2[1] = 0x13;
end_of_audio.vpkt.myicm.icm_id = 0x20; end_of_audio.vpkt.icm.icm_id = 0x20;
end_of_audio.vpkt.myicm.dst_rptr_id = 0x00; end_of_audio.vpkt.icm.dst_rptr_id = 0x00;
end_of_audio.vpkt.myicm.snd_rptr_id = 0x01; end_of_audio.vpkt.icm.snd_rptr_id = 0x01;
memset(end_of_audio.vpkt.vasd.voice, '\0', 9); memset(end_of_audio.vpkt.vasd.voice, '\0', 9);
end_of_audio.vpkt.vasd.text[0] = 0x70; end_of_audio.vpkt.vasd.text[0] = 0x70;
end_of_audio.vpkt.vasd.text[1] = 0x4f; end_of_audio.vpkt.vasd.text[1] = 0x4f;

@ -38,7 +38,7 @@ typedef struct pkt_tag {
unsigned char snd_term_id; unsigned char snd_term_id;
uint16_t streamid; uint16_t streamid;
unsigned char ctrl; unsigned char ctrl;
} myicm; } icm;
union { union {
struct { struct {
unsigned char flag[3]; unsigned char flag[3];

Loading…
Cancel
Save

Powered by TurnKey Linux.