forked from oe5hpm/openBCM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bcast.cpp
90 lines (76 loc) · 2.04 KB
/
bcast.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/***************************************************************
BayCom(R) Packet-Radio fuer IBM PC
OpenBCM-Mailbox
----------------------------------------------
Mailbox-Broadcast nach SAT-Verfahren
----------------------------------------------
Copyright (C) Dietmar Zlabinger
Reinberg-Heidenreichstein 31
A-3861 Eggern
Alle Rechte vorbehalten / All Rights Reserved
***************************************************************/
// NOT FINISHED - DO NOT USE!
#include "baycom.h"
#include "flexappl.h"
#ifdef BCAST
#define L2_BCAST_DEST "QST-1"
#define L2_BCAST_PID 0xbb
void bcast (char * befbuf)
//****************************************************************************
//
//****************************************************************************
{
boxqso_t *q = &qso[port];
int a;
char fn[20];
char ziel[30];
char target[11]; //target call
int i;
unsigned long n = 0;
char lcmd[40];
befbuf = nexttoken(befbuf, target, 10);
strupr(target); //must be uppercase
befbuf = nexttoken(befbuf, ziel, 29);
trace(report, "bcast", "connect %s", ziel);
timeout(1);
lastcmd("Connect");
if (makeconnect(m.mycall[0], ziel))
{
setsession();
*b->logincall = 0;
putf("%c%cBROADCAST %s\n", 0x80, 0xff, L2_BCAST_DEST);
putflush();
sprintf(fn, "bcast.bcm");
if (file_isreg(fn))
{
trace(report, "bcast", "sending %s", fn);
FILE *f = s_fopen(fn, "lrt");
lastcmd("TX");
while ((a = fgetc(f)) != EOF)
{
getclear_tnc();
timeout(1);
waitfor(e_ticsfull);
putv(a);
n++;
if (a == LF) //line by line mode
{
l2_set_pid(q->qsonum, BCAST_PID);
putflush();
sprintf(lcmd, "bcast %ld Bytes", n);
lastcmd(lcmd);
}
}
s_fclose(f);
}
lastcmd("Delay");
for (i = 0; i < 100; i++)
{
wdelay(226);
getclear_tnc();
}
mblogout(0);
mbdisconnect(1); //wait for data to be sent
}
}
#endif