static void cmd_converse(Stream *chp, int argc, char* argv[]) { (void) argc; (void) argv; static FBUF packet; chprintf(chp, "***** CONVERSE MODE. Ctrl-D to exit *****\r\n"); radio_require(); mon_activate(true); fbq_t* outframes = hdlc_get_encoder_queue(); while (!shellGetLine(chp, buf, BUFSIZE)) { addr_t from, to; GET_PARAM(MYCALL, &from); GET_PARAM(DEST, &to); addr_t digis[7]; uint8_t ndigis = GET_BYTE_PARAM(NDIGIS); GET_PARAM(DIGIS, &digis); fbuf_new(&packet); ax25_encode_header(&packet, &from, &to, digis, ndigis, FTYPE_UI, PID_NO_L3); fbuf_putstr(&packet, buf); fbq_put(outframes, packet); } mon_activate(false); radio_release(); }
static void cmd_testpacket(Stream *chp, int argc, char *argv[]) { (void)argc; (void)argv; static FBUF packet; fbq_t* outframes = hdlc_get_encoder_queue(); addr_t from, to; addr_t digis[7]; radio_require(); sleep(100); GET_PARAM(MYCALL, &from); GET_PARAM(DEST, &to); uint8_t ndigis = GET_BYTE_PARAM(NDIGIS); GET_PARAM(DIGIS, &digis); fbuf_new(&packet); ax25_encode_header(&packet, &from, &to, digis, ndigis, FTYPE_UI, PID_NO_L3); fbuf_putstr(&packet, "The lazy brown dog jumps over the quick fox 1234567890"); chprintf(chp, "Sending (AX25 UI) test packet....\r\n"); fbq_put(outframes, packet); sleep(10); radio_release(); }
void fbq_signal(FBQ* q) { FBUF b; fbuf_new(&b); fbq_put(q, b); }