Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
#define CONTOUR_USB_VENDOR_ID 0x1a79
#define CONTOUR_USB_PRODUCT_ID 0x6002
#define CONTOUR_USB_VENDOR_ID 0x1a79
#define CONTOUR_USB_PRODUCT_ID 0x6002
struct msg {
int direction;
unsigned char data[64];
struct msg {
int direction;
unsigned char data[64];
int send_msg(const struct msg *msg, int fd, int usage_code)
{
int ret;
int send_msg(const struct msg *msg, int fd, int usage_code)
{
int ret;
if (msg->direction != OUT) {
trace(0, "Message direction is not OUT\n");
exit(1);
}
if (msg->direction != OUT) {
trace(0, "Message direction is not OUT\n");
exit(1);
}
+ if (trace_level < 1 && msg_count <= MAX_MSGS) {
+ trace(0, "\r%d%%", msg_count * 100 / MAX_MSGS);
+ fflush(stdout);
+ }
usleep(30 * 1000);
trace(1, "Sending: ");
usleep(30 * 1000);
trace(1, "Sending: ");
int i, j;
struct msg msg, in;
msg.direction = OUT;
int i, j;
struct msg msg, in;
msg.direction = OUT;
+ trace(0, "Initializing..\n");
read_msgs(fd);
SET_FIRST_BYTE(0x01);
read_msgs(fd);
SET_FIRST_BYTE(0x01);
send_msg(&msg, fd, uc);
read_msgs(fd);
send_msg(&msg, fd, uc);
read_msgs(fd);
- trace(0, "Glucose readings:\n");
+ trace(0, "\nGlucose readings:\n");
usleep(100 * 1000);
do {
send_msg(&msg, fd, uc);
usleep(100 * 1000);
do {
send_msg(&msg, fd, uc);