Factor out sendBeastSettings(), use it in view1090.
This commit is contained in:
parent
11b6cdba06
commit
0526388bdc
4 changed files with 24 additions and 16 deletions
18
net_io.c
18
net_io.c
|
|
@ -784,6 +784,24 @@ static void handle_radarcape_position(float lat, float lon, float alt)
|
|||
}
|
||||
}
|
||||
|
||||
// Send some Beast settings commands to a client
|
||||
void sendBeastSettings(struct client *c, const char *settings)
|
||||
{
|
||||
int len;
|
||||
char *buf, *p;
|
||||
|
||||
len = strlen(settings) * 3;
|
||||
buf = p = alloca(len);
|
||||
|
||||
while (*settings) {
|
||||
*p++ = 0x1a;
|
||||
*p++ = '1';
|
||||
*p++ = *settings++;
|
||||
}
|
||||
|
||||
anetWrite(c->fd, buf, len);
|
||||
}
|
||||
|
||||
//
|
||||
//=========================================================================
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue