*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#define _BSD_SOURCE
+#define _DEFAULT_SOURCE 1
#include <termios.h>
#include <unistd.h>
#include <sys/types.h>
#define US_PER_CHAR (1000000 / BPS)
int
-skytraq_write(int fd, const char *data, int len)
+skytraq_write(int fd, const void *d, int len)
{
- const char *d = data;
+ const char *data = d;
int r;
- int us;
skytraq_dbg_printf (0, "%4d: ", len);
if (len < 70)
r = write(fd, data, this_time);
if (r <= 0)
return r;
- us = r * US_PER_CHAR;
usleep(r * US_PER_CHAR);
data += r;
len -= r;
int i;
uint8_t cksum;
- int target_baudrate;
+ int target_baudrate = 0;
switch(baudrate)
{
case 4800: