New "kissutil" application.

This commit is contained in:
wb2osz 2017-09-11 22:28:54 -04:00
parent 678b09df3f
commit 9d2c993f49
3 changed files with 18 additions and 7 deletions

9
kiss.c
View File

@ -94,7 +94,7 @@ void kisspt_set_debug (int n)
return; return;
} }
void kisspt_send_rec_packet (int chan, unsigned char *fbuf, int flen, int client) void kisspt_send_rec_packet (int chan, int kiss_cmd, unsigned char *fbuf, int flen, int client)
{ {
return; return;
} }
@ -367,6 +367,9 @@ static int kisspt_open_pt (void)
* Inputs: chan - Channel number where packet was received. * Inputs: chan - Channel number where packet was received.
* 0 = first, 1 = second if any. * 0 = first, 1 = second if any.
* *
* kiss_cmd - Usually KISS_CMD_DATA_FRAME but we can also have
* KISS_CMD_SET_HARDWARE when responding to a query.
*
* pp - Identifier for packet object. * pp - Identifier for packet object.
* *
* fbuf - Address of raw received frame buffer * fbuf - Address of raw received frame buffer
@ -386,7 +389,7 @@ static int kisspt_open_pt (void)
*--------------------------------------------------------------------*/ *--------------------------------------------------------------------*/
void kisspt_send_rec_packet (int chan, unsigned char *fbuf, int flen, int client) void kisspt_send_rec_packet (int chan, int kiss_cmd, unsigned char *fbuf, int flen, int client)
{ {
unsigned char kiss_buff[2 * AX25_MAX_PACKET_LEN + 2]; unsigned char kiss_buff[2 * AX25_MAX_PACKET_LEN + 2];
int kiss_len; int kiss_len;
@ -415,7 +418,7 @@ void kisspt_send_rec_packet (int chan, unsigned char *fbuf, int flen, int clien
flen = (int)(sizeof(stemp)) - 1; flen = (int)(sizeof(stemp)) - 1;
} }
stemp[0] = (chan << 4) + 0; stemp[0] = (chan << 4) | kiss_cmd;
memcpy (stemp+1, fbuf, flen); memcpy (stemp+1, fbuf, flen);
if (kisspt_debug >= 2) { if (kisspt_debug >= 2) {

View File

@ -520,9 +520,14 @@ static THREAD_F connect_listen_thread (void *arg)
* Inputs: chan - Channel number where packet was received. * Inputs: chan - Channel number where packet was received.
* 0 = first, 1 = second if any. * 0 = first, 1 = second if any.
* *
// TODO: add kiss_cmd
*
* fbuf - Address of raw received frame buffer * fbuf - Address of raw received frame buffer
* or a text string. * or a text string.
* *
* kiss_cmd - Usually KISS_CMD_DATA_FRAME but we can also have
* KISS_CMD_SET_HARDWARE when responding to a query.
*
* flen - Number of bytes for AX.25 frame. * flen - Number of bytes for AX.25 frame.
* When called from kiss_rec_byte, flen will be -1 * When called from kiss_rec_byte, flen will be -1
* indicating a text string rather than frame content. * indicating a text string rather than frame content.
@ -544,7 +549,7 @@ static THREAD_F connect_listen_thread (void *arg)
*--------------------------------------------------------------------*/ *--------------------------------------------------------------------*/
void kissnet_send_rec_packet (int chan, unsigned char *fbuf, int flen, int tcpclient) void kissnet_send_rec_packet (int chan, int kiss_cmd, unsigned char *fbuf, int flen, int tcpclient)
{ {
unsigned char kiss_buff[2 * AX25_MAX_PACKET_LEN]; unsigned char kiss_buff[2 * AX25_MAX_PACKET_LEN];
int kiss_len; int kiss_len;
@ -597,7 +602,7 @@ void kissnet_send_rec_packet (int chan, unsigned char *fbuf, int flen, int tcpcl
assert (flen < (int)(sizeof(stemp))); assert (flen < (int)(sizeof(stemp)));
stemp[0] = (chan << 4) + 0; stemp[0] = (chan << 4) | kiss_cmd;
memcpy (stemp+1, fbuf, flen); memcpy (stemp+1, fbuf, flen);
if (kiss_debug >= 2) { if (kiss_debug >= 2) {

View File

@ -258,6 +258,9 @@ void kissserial_init (struct misc_config_s *mc)
* Inputs: chan - Channel number where packet was received. * Inputs: chan - Channel number where packet was received.
* 0 = first, 1 = second if any. * 0 = first, 1 = second if any.
* *
* kiss_cmd - Usually KISS_CMD_DATA_FRAME but we can also have
* KISS_CMD_SET_HARDWARE when responding to a query.
*
* pp - Identifier for packet object. * pp - Identifier for packet object.
* *
* fbuf - Address of raw received frame buffer * fbuf - Address of raw received frame buffer
@ -277,7 +280,7 @@ void kissserial_init (struct misc_config_s *mc)
*--------------------------------------------------------------------*/ *--------------------------------------------------------------------*/
void kissserial_send_rec_packet (int chan, unsigned char *fbuf, int flen, int client) void kissserial_send_rec_packet (int chan, int kiss_cmd, unsigned char *fbuf, int flen, int client)
{ {
unsigned char kiss_buff[2 * AX25_MAX_PACKET_LEN + 2]; unsigned char kiss_buff[2 * AX25_MAX_PACKET_LEN + 2];
int kiss_len; int kiss_len;
@ -309,7 +312,7 @@ void kissserial_send_rec_packet (int chan, unsigned char *fbuf, int flen, int c
flen = (int)(sizeof(stemp)) - 1; flen = (int)(sizeof(stemp)) - 1;
} }
stemp[0] = (chan << 4) + 0; stemp[0] = (chan << 4) | kiss_cmd;
memcpy (stemp+1, fbuf, flen); memcpy (stemp+1, fbuf, flen);
if (kissserial_debug >= 2) { if (kissserial_debug >= 2) {