Hamlib/icom/frame.h
Michael Black 1767cb5c43 Icom frame patch
I'm implementing several changes to support some functionality for the
IC7300.  In order to minimize the review process I'm submitting this
small one separately (still working on finish the IC7300 but it's some
fairly extensive changes since ICOM has changed the protocol for several
things).

For the IC7300 turning power on requires ~150 0xfe's be sent to wake up
the rig.  This causes a buffer overflow condition in icom/frame.c.  This
patch increases the buffer size and ensures no overflow.

73
Mike W9MDB
2016-05-16 16:45:23 -05:00

39 lines
1.5 KiB
C

/*
* Hamlib CI-V backend - low level communication header
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _FRAME_H
#define _FRAME_H 1
#define MAXFRAMELEN 56
/*
* helper functions
*/
int make_cmd_frame(char frame[], char re_id, char ctrl_id, char cmd, int subcmd, const unsigned char *data, int data_len);
int icom_transaction (RIG *rig, int cmd, int subcmd, const unsigned char *payload, int payload_len, unsigned char *data, int *data_len);
int read_icom_frame(hamlib_port_t *p, unsigned char rxbuffer[], int rxbuffer_len);
int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width, unsigned char *md, signed char *pd);
void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode, pbwidth_t *width);
#endif /* _FRAME_H */