예제 #1
0
파일: main.c 프로젝트: benpicco/RIOT-old
void send_tcp_bandwidth_test(char *str)
	{
	timex_t start, end, total;
	double secs;

	int i = 0, count;
	char command[80];
//	char msg_string[] = "abcdefghijklmnopqrstuvwxyz0123456789!-";
	char msg_string[] = "abcdefghijklmnopqrstuvwxyz0123456789!-=/%$";

	sscanf(str, "tcp_bw %i", &count);
	ltc4150_start();
	printf("Start power: %f\n", ltc4150_get_total_mAh());
	start = vtimer_now();
	for (i = 0; i < count; i++)
		{
		sprintf(command, "send_tcp %s%.5i", msg_string, i);
		send_tcp_msg(command);
		}
	end = vtimer_now();
	total = timex_sub(end, start);
	secs = total.microseconds / 1000000.0f;
	printf("Used power: %f\n", ltc4150_get_total_Joule());
	printf("Start: %lu, End: %lu, Total: %lu\n", start.microseconds, end.microseconds, total.microseconds);
	printf("Time: %f seconds, Bandwidth: %f byte/second\n", secs, (count*48)/secs);
	}
예제 #2
0
파일: sc_ltc4150.c 프로젝트: 4120976/RIOT
void _get_current_handler(int argc, char **argv)
{
    (void) argc;
    (void) argv;

    printf("Power usage: %.4f mA (%.4f mA avg/ %.4f mAh total / %i usec)\n",
           ltc4150_get_current_mA(), ltc4150_get_avg_mA(), ltc4150_get_total_mAh(), ltc4150_get_interval());
}
예제 #3
0
파일: main.c 프로젝트: SilkeRieger/projects
int main(void)
{
    ltc4150_start();

    hwtimer_tick_id = hwtimer_set(tick_ticks,
                                  test_ltc_tick,
                                  (void *) thread_pid);

    while (1) {
        thread_sleep();
        printf("Power usage: %.4f mA (%.4f mA avg/ %.4f mAh total / %i usec)\n",
                ltc4150_get_current_mA(), ltc4150_get_avg_mA(),
                ltc4150_get_total_mAh(), ltc4150_get_interval());
    }

    return 0;
}
예제 #4
0
void _get_current_handler(char* unused) {
	printf("Power usage: %.4f mA (%.4f mA avg/ %.4f mAh total / %i usec)\n", ltc4150_get_current_mA(), ltc4150_get_avg_mA(), ltc4150_get_total_mAh(), ltc4150_get_interval());
}