From: Nate B. <n0...@us...> - 2012-10-29 20:04:15
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 61a5a8b9698fc0a281794e41039025b781ec7369 (commit) via 06671cd6afb4cae9c1ddc9c2e76e744d5ce44dce (commit) from e2bb0106a21666507c334dcbb33d9e17ab5f9ac6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 61a5a8b9698fc0a281794e41039025b781ec7369 Author: Nate Bargmann <n0...@n0...> Date: Mon Oct 29 15:02:44 2012 -0500 NEWS: ADAT fixes, IC-R8500 AF_LEVEL diff --git a/NEWS b/NEWS index ffe1c94..89b51d3 100644 --- a/NEWS +++ b/NEWS @@ -17,7 +17,6 @@ Version 3.0 symlinked and put in the build-aux directory, building rigmem and rigmatrix are now user selectable at configure run time, building static libraries are disabled by default. - * IC-R8500: Add RIG_LEVEL_AF to has_set_level. TNX John, EI7IG Version 1.2.15.3 2012-11-01 @@ -26,6 +25,8 @@ Version 1.2.15.3 * Remove unsupported commands on IC-756 (non-Pro model) from AK6I * Fix set_split in netrigctl.c to properly accept the split value. TNX, N2ADR. + * IC-R8500: Add RIG_LEVEL_AF to has_set_level. TNX John, EI7IG + * ADAT updates from Frank, DG1SBG, needed for stable operation. Version 1.2.15.2 2012-08-05 commit 06671cd6afb4cae9c1ddc9c2e76e744d5ce44dce Author: Frank Goenninger <fra...@co...> Date: Sun Oct 28 15:02:14 2012 +0100 adat updates from Frank, DG1SBG Diffs for the ADAT TRX found to be required for stable operation of the ADAT backend. Signed-off-by: Nate Bargmann <n0...@n0...> diff --git a/adat/adat.c b/adat/adat.c index b759ba8..c0a41b6 100644 --- a/adat/adat.c +++ b/adat/adat.c @@ -535,17 +535,28 @@ static adat_cmd_list_t adat_cmd_list_open_adat = { 8, { + &adat_cmd_display_off, &adat_cmd_get_serial_nr, &adat_cmd_get_id_code, &adat_cmd_get_fw_version, &adat_cmd_get_gui_fw_version, &adat_cmd_get_hw_version, &adat_cmd_get_options, - &adat_cmd_set_callsign, + &adat_cmd_set_callsign + } +}; + +// -- CLOSE ADAT -- + +static adat_cmd_list_t adat_cmd_list_close_adat = +{ + 1, + { &adat_cmd_display_on } }; + // -- ADAT SPECIAL: RECOVER FROM ERROR -- static adat_cmd_list_t adat_cmd_list_recover_from_error = @@ -599,8 +610,8 @@ size_t trimwhitespace( char *out, size_t len, const char *str ) end++; // Set output size to minimum of trimmed string length and buffer size minus 1 - // out_size = (end - str) < len-1 ? (end - str) : len-1; BUG ! - out_size = (end - str) < len-1 ? (end - str) : len; + //out_size = (end - str) < len-1 ? (end - str) : len - 1; + out_size = strlen( str ); // Copy trimmed string and add null terminator memcpy(out, str, out_size); @@ -1506,8 +1517,6 @@ int adat_get_single_cmd_result( RIG *pRig ) "*** ADAT: %d acBuf ........ = 0x%08x\n", gFnLevel, acBuf ); - nBufLength = strlen( acBuf ); - pcBufEnd = acBuf + nBufLength - 1; pcPos = acBuf; if(( nRC == RIG_OK ) && ( pcPos != NULL )) @@ -1518,6 +1527,9 @@ int adat_get_single_cmd_result( RIG *pRig ) pcPos++; // No, please don't ask me why this // happens ... ;-) + nBufLength = strlen( pcPos ); + pcBufEnd = pcPos + nBufLength - 1; + pcResult = pcPos; // Save position if( pcPos < pcBufEnd ) @@ -2891,6 +2903,46 @@ int adat_open( RIG *pRig ) } // --------------------------------------------------------------------------- +// Function adat_close +// --------------------------------------------------------------------------- +// Status: RELEASED + +int adat_close( RIG *pRig ) +{ + int nRC = RIG_OK; + + gFnLevel++; + + rig_debug( RIG_DEBUG_TRACE, + "*** ADAT: %d %s (%s:%d): ENTRY. Params: pRig = 0x%08x\n", + gFnLevel, __func__, __FILE__, __LINE__, + pRig ); + + // Check Params + + if( pRig == NULL ) + { + nRC = -RIG_EARG; + } + else + { + // Now switch to interactive mode + + nRC = adat_transaction( pRig, &adat_cmd_list_close_adat ); + } + + // Done ! + + rig_debug( RIG_DEBUG_TRACE, + "*** ADAT: %d %s (%s:%d): EXIT. Return Code = %d\n", + gFnLevel, __func__, __FILE__, __LINE__, + nRC ); + gFnLevel--; + + return nRC; +} + +// --------------------------------------------------------------------------- // Function adat_get_info // --------------------------------------------------------------------------- // Status: RELEASED diff --git a/adat/adat.h b/adat/adat.h index a5b1e0d..6f1ab0a 100644 --- a/adat/adat.h +++ b/adat/adat.h @@ -510,7 +510,6 @@ int adat_parse_ptt( char *, int * ); int adat_ptt_rnr2anr( ptt_t, int * ); int adat_ptt_anr2rnr( int, ptt_t * ); - int adat_send( RIG *, char * ); int adat_receive( RIG *, char * ); @@ -559,6 +558,7 @@ int adat_init( RIG * ); int adat_cleanup( RIG * ); int adat_reset( RIG *, reset_t ); int adat_open( RIG * ); +int adat_close( RIG * ); int adat_set_conf( RIG *, token_t, const char *val ); int adat_get_conf( RIG *, token_t, char *val ); diff --git a/adat/adt_200a.c b/adat/adt_200a.c index 2572aa6..d4e17be 100644 --- a/adat/adt_200a.c +++ b/adat/adt_200a.c @@ -179,6 +179,7 @@ const struct rig_caps adt_200a_caps = .rig_cleanup = adat_cleanup, .rig_open = adat_open, .reset = adat_reset, + .rig_close = adat_close, .set_conf = adat_set_conf, .get_conf = adat_get_conf, ----------------------------------------------------------------------- Summary of changes: NEWS | 3 +- adat/adat.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++---- adat/adat.h | 2 +- adat/adt_200a.c | 1 + 4 files changed, 61 insertions(+), 7 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |