[LinuxPPS] (no subject)
clemens at dwf.com
clemens at dwf.com
Fri Apr 20 21:32:36 CEST 2007
OK, I haven't had a lot of time to play with this, but my attempts
to get it working have all failed.
I am building from the 2.6.20.6 kernel (tried 2.6.20 earlier), and use
xconfig to turn on the pps stuff. Ive tried it with the parallel port
stuff turned on/off. Ive fixed the problem with the change deck and
the include file netlink.h
In all cases, it acts as if the PPS stuff just isnt there.
Here is the top of my little test program:
{/usr/include/sys/timepps.h is a copy of the kernel include/linux/timepps.h)
---
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <err.h>
#include <sys/types.h>
#include <time.h>
#include <sys/timepps.h>
#include <string.h>
/* PPSAPI test */
int fd;
pps_info_t pi;
pps_params_t pp;
pps_handle_t ph;
int i, mode;
u_int olda, oldc;
double d = 0;
struct timespec timeout;
void exit();
char *cp;
int
main(int argc, char **argv)
{
#define STRING_LEN 32
int i;
char link[STRING_LEN] = "/dev/ttyS0",
path[STRING_LEN],
id [STRING_LEN];
/* if link is a symbolic link, get the REAL path and put it in path */
/* readlink returns the number of chars transfered, and no zero term */
if ((i=readlink (link, path, STRING_LEN-1)) > 0)
path[i] = '\0';
else
strncpy (path, link, STRING_LEN);
fprintf(stderr, "Link = %s\n", link);
fprintf(stderr, "i = %d\n", i);
fprintf(stderr, "Path at timeppsfindpath is %s\n", path);
fd = time_pps_findpath (path, STRING_LEN, id, STRING_LEN);
if (fd < 0) {
fprintf(stderr, "no available PPS source in the system\n");
exit(1);
}
printf("found PPS source #%d \"%s\" on \"%s\"\n", fd, id, path);
cp = path;
---
and in all cases I get the following output
a.out
Link = /dev/ttyS0
i = -1
Path at timeppsfindpath is /dev/ttyS0
no available PPS source in the system
---
So, I must be doing something stupid, can someone point
me in the right direction. About a year ago, when Rodolfo
first put up this linuxpps, I had everything working fine...
--
Reg.Clemens
reg at dwf.com
More information about the LinuxPPS
mailing list