/*******************************************************************************
* BRtc.h Real Time Clock interface
* T.Barnaby, BEAM Ltd, 19/5/04
*******************************************************************************
*/
#include <BRtc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/rtc.h>
BRtc::BRtc(){
ofd = -1;
orate = 0;
}
BRtc::~BRtc(){
if(ofd > 0)
close(ofd);
}
BError BRtc::init(int rate){
BError err;
orate = rate;
if((ofd = open("/dev/rtc", O_RDONLY)) < 0)