// sent on the waterfall port void send_meta(conn_t *c, u1_t cmd, u4_t p1, u4_t p2) { meta_t meta; meta_set(&meta, cmd, p1, p2); assert(c->type == STREAM_WATERFALL); app_to_web(c, (char*) &meta, 4+2+8); }
void send_msg(conn_t *c, const char *msg, ...) { va_list ap; char *s; va_start(ap, msg); vasprintf(&s, msg, ap); va_end(ap); printf("send_msg %d: <%s>\n", c->rx_channel, s); app_to_web(c, s, strlen(s)); free(s); }
void send_msg(conn_t *c, bool debug, const char *msg, ...) { va_list ap; char *s; va_start(ap, msg); vasprintf(&s, msg, ap); va_end(ap); if (debug) cprintf(c, "send_msg: <%s>\n", s); app_to_web(c, s, strlen(s)); free(s); }
void send_meta_bytes(conn_t *c, u1_t cmd, u1_t *bytes, int nbytes) { meta_t meta; assert(c->type == STREAM_WATERFALL); assert(nbytes <= NMETA); strncmp(meta.hdr, "FFT ", 4); meta.flag = 0xff; meta.cmd = cmd; memcpy(meta.bytes, bytes, nbytes); app_to_web(c, (char*) &meta, 4+2+nbytes); }