Logo Search packages:      
Sourcecode: hamlib version File versions

static int tt565_send_morse ( RIG rig,
vfo_t  vfo,
const char *  msg 
)

Send a string as morse characters.

Parameters:
rig 
vfo 
msg A message string (<= 20 char)
Returns:
RIG_OK Orion keyer must be on for morse, but we do not have a "keyer on" function in hamlib (yet). Keyer will be forced on.
Orion can queue up to about 20 characters. We could batch a longer message into 20 char chunks, but there is no simple way to tell if message has completed. We could calculate a duration based on keyer speed and the text that was sent, but what we really need is a handshake for "message complete". Without it, you can't easily use the Orion as a code practice machine. For now, we let the user do the batching. Note that rig panel is locked up for duration of message.

Definition at line 1541 of file orion.c.

References EOM, RIG_OK, and tt565_transaction().

{
      int msg_len, retval, ic, cmdl;
      char morsecmd[8];
      static int keyer_set = 0;     /*Shouldn't be here!*/

/*  Force keyer on. */
      if (!keyer_set) {
          retval = tt565_transaction(rig, "*CK1" EOM, 5, NULL, NULL);
          if (retval != RIG_OK)
            return retval;
          keyer_set = 1;
          usleep(100000);     /* 100 msec - guess */
      }
      msg_len = strlen(msg);
      if (msg_len > 20) msg_len = 20;     /* sanity limit 20 chars */

      for (ic = 0; ic < msg_len; ic++) {
            cmdl = sprintf(morsecmd,"/%c" EOM, msg[ic]);
            retval = tt565_transaction(rig,morsecmd,cmdl,NULL,NULL);
            if (retval != RIG_OK)
                  return retval;
      }
      return RIG_OK;
}


Generated by  Doxygen 1.6.0   Back to index