#include <stdio.h>
#include <fcntl.h>

#include "cwkeyioctl.h"

unsigned int hz,speed;
void main (int argc, char **argv)
{
int fd,result;

  if (argc!=3) 
    exit (1);
  hz = atoi (argv[1]);
  speed = atoi (argv[2]);
  fd = open ("/dev/cwkeyer",O_RDONLY);
  if (!fd) {
    printf ("Error opening device (/dev/cwkeyer)\n");
    exit (1);
  }
  result = ioctl (fd,CWTONE,hz);
//  printf ("Result=%d\n",result);
  result = ioctl (fd,CWSPEED,speed);
//  printf ("Result=%d\n",result);
  close (fd);
}
