Porównaj commity

...

13 Commity
v1.0 ... main

Autor SHA1 Wiadomość Data
kk4das 24cc6a08e8
Update README.md 2023-03-10 10:09:34 -05:00
kk4das d5253d10dd
Delete .development 2023-03-08 21:23:01 -05:00
kk4das e22ef164df Updated version number 2023-01-24 22:21:37 -05:00
kk4das 054ffd5937 V1.3 - Added support for all IC-746 modes and frequencies 100MHz and greater 2023-01-24 22:11:39 -05:00
kk4das b9fa9c8970
Add missing / at line 1 2022-04-14 08:48:35 -04:00
kk4das 2c36b3f2d0
V1.0.2 2021-12-17 06:40:49 -08:00
kk4das 5afeedc713
Update IC746.h
V 1.0.2 fix for WSJTX Hamlib
2021-12-17 06:38:17 -08:00
kk4das 214bad35ca
Update IC746.cpp
Fix for latest WSJTX Hamlib
2021-12-17 06:36:12 -08:00
kk4das 1e2c86d971
Merge pull request #3 from awsh/main
updated to respond with a nack for unimplemented commands
2021-12-17 06:32:24 -08:00
awsh 61d0dcc701 updated to respond with a nack for unimplemented commands 2021-12-15 14:21:42 -05:00
kk4das 5e9c93da5a
Update library.properties 2021-03-21 15:11:18 -04:00
kk4das 5775abde49
Merge pull request #1 from njh/patch-1
Corrected url in library.properties
2021-03-21 12:46:02 -04:00
Nicholas Humfrey d46d0fb6c3
Corrected url in library.properties 2021-03-21 13:34:55 +00:00
5 zmienionych plików z 85 dodań i 28 usunięć

Wyświetl plik

@ -1,6 +1,16 @@
/*************************************************************************
IC746 CAT Library, by KK4DAS, Dean Souleles
V1.1 2/3/202
V1.3 1/21/2023
- Included all defined modes in Get/Set Mode (thanks to Mike, KA4CDN)
- Fix to allow frequencies greater than 100MHz -(thanks to Bob, KA1GT)
V1.2 10/22/2021
- Fixes bug that caused "WSJTX Rig Control Error" for versions after 2.2.2
- The problem was caused by an unsupported CIV command being sent by WSJTX
- This fix responds to unimplemented commands with a NACK instead of an ACK
- Bug was reported on the WSJTX groups board.
V1.1 2/3/2021
- various fixes, now works properly with OmniRig and flrig
- smeter now returns proper BCD code - calibrated to emulate ICOM responses
@ -33,10 +43,11 @@
#define DEBUG_CAT_DETAIL
//#define DEBUG_CAT_SMETER
#include <SoftwareSerial.h>
SoftwareSerial catDebug(6, 7); // RX, TX
SoftwareSerial catDebug(11,12); // RX, TX
String dbg;
#endif
//extern void displayBanner(String s);
// User supplied calback function work variables, must be static
static FuncPtrBoolean catSplit;
@ -104,8 +115,8 @@ static FuncPtrVoid catSwapVfo;
*/
void IC746::begin() {
Serial.begin(9600, SERIAL_8N2);
while (!Serial);;
Serial.flush();
// while (!Serial);;
// Serial.flush();
#ifdef DEBUG_CAT
catDebug.begin(9600);
@ -124,11 +135,15 @@ void IC746::begin(long br, int mode) {
SERIAL_7O1; SERIAL_8O1; SERIAL_5O2; SERIAL_6O2; SERIAL_7O2; SERIAL_8O2
*/
Serial.begin(br, mode);
Serial.flush();
// Serial.flush();
#ifdef DEBUG_CAT
catDebug.begin(9600);
dbg = "CAT Debug Ready";
catDebug.println(dbg.c_str());
delay(1000);
catDebug.println(dbg.c_str());
catDebug.println(dbg.c_str());
catDebug.println(dbg.c_str());
#endif
}
@ -237,7 +252,7 @@ void IC746::sendResponse(byte *buf, int len) {
// sendAck() - send back hard-code acknowledge message
//
void IC746::sendAck() {
byte ack[] = {CAT_CTRL_ADDR, CAT_RIG_ADDR, CAT_ACK};
byte ack[] = {CAT_RIG_ADDR, CAT_CTRL_ADDR, CAT_ACK};
send(ack, 3);
}
@ -245,7 +260,8 @@ void IC746::sendAck() {
// sendNack() - send back hard-code negative-acknowledge message
//
void IC746::sendNack() {
byte nack[] = {CAT_CTRL_ADDR, CAT_RIG_ADDR, CAT_NACK};
byte nack[] = {CAT_RIG_ADDR, CAT_CTRL_ADDR, CAT_NACK};
// displayBanner(String("Nack"));
send(nack, 3);
}
@ -497,6 +513,7 @@ void IC746::doSetFreq() {
///////////////////////////////////////////////////////////////////////////////////////////////////////
void IC746::doReadFreq() {
if (catGetFreq) {
// displayBanner(String("Read Freq"));
FreqtoBCD(catGetFreq()); // get the frequency, convert to BCD and stuff it in the response buffer
sendResponse(cmdBuf, CAT_SZ_FREQ);
}
@ -504,16 +521,22 @@ void IC746::doReadFreq() {
///////////////////////////////////////////////////////////////////////////////////////////////////////
// doSetMode() - process the CAT_SET_MODE command
// Call the user function to put the rig into the requested mode. Only USB or LSB are supported.
// Call the user function to put the rig into the requested mode.
// The rig must handle all of the possible modes
// CAT_MODE_LSB
// CAT_MODE_USB
// CAT_MODE_AM:
// CAT_MODE_CW - (LSB)
// CAT_MODE_RTTY - (LSB)
// CAT_MODE_FM
// CAT_MODE_CW_R - (Reverse - USB)
// CAT_MODE_RTTY_R - (Reverse - LSB)
///////////////////////////////////////////////////////////////////////////////////////////////////////
void IC746::doSetMode() {
if (catSetMode) {
switch (cmdBuf[CAT_IX_SUB_CMD]) {
case CAT_MODE_LSB:
case CAT_MODE_USB:
catSetMode(cmdBuf[CAT_IX_SUB_CMD]);
break;
}
catSetMode(cmdBuf[CAT_IX_SUB_CMD]);
}
sendAck();
}
@ -697,13 +720,17 @@ void IC746::check() {
doUnimplemented_2b();
break;
default: // For all other commands respond with an ACK
default: // For all other commands respond with an NACK
#ifdef DEBUG_CAT
String dbg;
dbg = "unimp cmd: ";
dbg += String(cmdBuf[CAT_IX_CMD], HEX);
dbg += " ";
dbg += String(cmdBuf[CAT_IX_SUB_CMD], HEX);
// displayBanner(dbg);
catDebug.println(dbg.c_str());
#endif
sendAck();
sendNack();
break;
}
}
@ -734,12 +761,15 @@ long IC746::BCDtoFreq() {
freq += 100000L * (cmdBuf[CAT_IX_FREQ + 2] >> 4);
freq += 1000000L * (cmdBuf[CAT_IX_FREQ + 3] & 0xf);
freq += 10000000L * (cmdBuf[CAT_IX_FREQ + 3] >> 4);
freq += 100000000L * (cmdBuf[CAT_IX_FREQ + 4] & 0xf);
freq += 1000000000L * (cmdBuf[CAT_IX_FREQ + 4] >> 4);
return freq;
}
void IC746::FreqtoBCD(long freq) {
byte ones, tens, hund, thou, ten_thou, hund_thou, mil, ten_mil;
byte ones, tens, hund, thou, ten_thou, hund_thou, mil, ten_mil, hund_mil, thou_mil;
ones = byte(freq % 10);
tens = byte((freq / 10L) % 10);
@ -754,11 +784,12 @@ void IC746::FreqtoBCD(long freq) {
cmdBuf[CAT_IX_FREQ + 2] = byte((hund_thou << 4)) | ten_thou;
mil = byte((freq / 1000000L) % 10);
ten_mil = byte(freq / 10000000L);
ten_mil = byte(freq / 10000000L) % 10;
cmdBuf[CAT_IX_FREQ + 3] = byte((ten_mil << 4)) | mil;
cmdBuf[CAT_IX_FREQ + 4] = 0; // fixed
hund_mil = byte((freq / 100000000L) % 10);
thou_mil = byte(freq / 1000000000L % 10); // Allow frequencies up to 9999.999999 MHz to be enterd
cmdBuf[CAT_IX_FREQ + 4] = byte((thou_mil << 4)) | hund_mil;
}
void IC746::SmetertoBCD(byte s) {

23
IC746.h
Wyświetl plik

@ -1,6 +1,14 @@
/*************************************************************************
IC746 CAT Library, by KK4DAS, Dean Souleles
V1.1 2/3/202
V1.3 1/24/2023
- Added support for frequencies 100MHz and above.
- Added support for setting and getting all IC-746 defined MODES
V1.2
- Fixes bug that caused WSJTX not to connect. Sends NACK on all unsupported
- commands. (Requires lastes hamlib build with WSJTX)
V1.1 2/3/2021
- various fixes, now works properly with OmniRig and flrig
- smeter now returns proper BCD code - calibrated to emulate ICOM responses
@ -81,12 +89,13 @@
// Mode Subcommand
#define CAT_MODE_LSB 0x00
#define CAT_MODE_USB 0x01
#define CAT_MODE_AM 0x02 // Not implemented
#define CAT_MODE_CW 0x03 // Not implemented
#define CAT_MODE_RTTY 0x04 // Not implemented
#define CAT_MODE_FM 0x05 // Not implemented
#define CAT_MODE_CW_R 0x06 // Not implemented
#define CAT_MODE_RTTY_R 0x07 // Not implemented
#define CAT_MODE_AM 0x02
#define CAT_MODE_CW 0x03 // LSB CW
#define CAT_MODE_RTTY 0x04 // LSB RTTY
#define CAT_MODE_FM 0x05
#define CAT_MODE_CW_R 0x07 // Reverse CW - USB
#define CAT_MODE_RTTY_R 0x08 // Reverse RTTY - USB
#define CAT_MODE_FILTER1 0x01 // Required for "read mode"
// VFO Subcommand

10
IC746CAT.ino 100644
Wyświetl plik

@ -0,0 +1,10 @@
// Dummy Sketch to allow editing of Nextion Lbrary files in the IDE
#include "IC746.h"
void setup() {
}
void loop() {
}

Wyświetl plik

@ -35,6 +35,13 @@ So far we have tested support for the following CAT capable software:
If you use find this library does not work with any particular CAT enabled software please let me know via the "Issues" tab on Github.
## Release Notes ##
Version 1.0.3 1/24/2023 - support for frequencies 100MHz and above. Support for setting and getting all defined IC746 modes.
Version 1.0.2 - Corrects bug that was causing new version of WSJTX not to connect. Sends NACK on all unsupported commands,
Version 1.0 - Initial release.
## Known limitations ##
Split frequency handling in WSJTX does not work as expected. The work-around is to configure WSJTX Split for either NONE or "Fake it". Split functionality has been tested and works as expected using CatBkt.

Wyświetl plik

@ -1,5 +1,5 @@
name=ICOM 746 CAT Control
version=1.0.0
version=1.0.3
author=Dean Souleles, KK4DAS, <kk4das@gmail.com>
maintainer=Dean Souleles, KK4DAS, <kk4das@gmail.com>
sentence=Simulate an ICOM 746 radio from the CAT point of view.