Exemplo n.º 1
0
void rxlev_stat_dump(const struct rxlev_stats *st)
{
	int i;

	for (i = NUM_RXLEVS-1; i >= 0; i--) {
		int16_t arfcn = -1;

		printf("ARFCN with RxLev %u: ", i);
		while ((arfcn = rxlev_stat_get_next(st, i, arfcn)) >= 0) {
			printf("%u ", arfcn);
		}
		printf("\n");
	}
}
Exemplo n.º 2
0
int ipac_rxlevstat2whitelist(uint16_t *buf, const struct rxlev_stats *st, uint8_t min_rxlev,
			     uint16_t max_num_arfcns)
{
	int i;
	unsigned int num_arfcn = 0;

	for (i = NUM_RXLEVS-1; i >= min_rxlev; i--) {
		int16_t arfcn = -1;

		while ((arfcn = rxlev_stat_get_next(st, i, arfcn)) >= 0) {
			*buf++ = htons(arfcn);
			num_arfcn++;

		}

		if (num_arfcn > max_num_arfcns)
			break;
	}

	return num_arfcn;
}