Fix warnings in rftest executable

warning: ‘genericPowerPerAntena’ defined but not used [-Wunused-function]

    warning: ‘graph.text’ is used uninitialized [-Wuninitialized]

    warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
This commit is contained in:
Robert Schmidt
2025-09-29 09:04:02 +02:00
parent 252b19cddb
commit 124debc2c7
2 changed files with 17 additions and 6 deletions
+10 -4
View File
@@ -99,8 +99,9 @@ static void commonGraph(OAIgraph_t *graph, int type, FL_Coord x, FL_Coord y, FL_
}
static OAIgraph_t calibrationCommonGraph( void (*funct) (OAIgraph_t *graph, calibData_t *context),
int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label, FL_COLOR pointColor) {
OAIgraph_t graph;
int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label, FL_COLOR pointColor)
{
OAIgraph_t graph = {0};
commonGraph(&graph, type, x, y, w, h, label, pointColor);
graph.funct=funct;
return graph;
@@ -236,7 +237,9 @@ static void genericWaterFall (OAIgraph_t *graph, scopeSample_t *values, const in
graph->iteration++;
}
static void genericPowerPerAntena(OAIgraph_t *graph, const int nb_ant, const scopeSample_t **data, const int len) {
__attribute__((unused))
static void genericPowerPerAntena(OAIgraph_t *graph, const int nb_ant, const scopeSample_t **data, const int len)
{
float *values, *time;
oai_xygraph_getbuff(graph, &time, &values, len, 0);
@@ -263,7 +266,10 @@ static void gNBfreqWaterFall (OAIgraph_t *graph, calibData_t *context) {
0, 0,
"X axis:one frame in time");
}
static void timeResponse (OAIgraph_t *graph, calibData_t *context) {
__attribute__((unused))
static void timeResponse (OAIgraph_t *graph, calibData_t *context)
{
#if 0
const int len=2*phy_vars_gnb->frame_parms.ofdm_symbol_size;
float *values, *time;
+7 -2
View File
@@ -314,8 +314,13 @@ int main(int argc, char **argv) {
rfdevice.trx_start_func(&rfdevice);
while(!oai_exit) {
for (int i=0; i<antennas; i++)
read(fd, samplesTx[i], DFT*sizeof(c16_t));
for (int i=0; i<antennas; i++) {
ssize_t len = read(fd, samplesTx[i], DFT*sizeof(c16_t));
if (len < 0) {
fprintf(stderr, "error during read(): errno %d, %s\n", errno, strerror(errno));
exit(1);
}
}
rfdevice.trx_read_func(&rfdevice, &timestamp, samplesRx, DFT, antennas);
rfdevice.trx_write_func(&rfdevice, timestamp + TxAdvanceInDFTSize * DFT, samplesTx, DFT, antennas, 0);
}