wirepas / wm-sdk

SDK to develop applications on the MCU running Wirepas Stack
Other
44 stars 33 forks source link

Change the TX and RX power signal #56

Open alopezal97 opened 1 year ago

alopezal97 commented 1 year ago

Hello. I'm two days triyng to figure it out this problem. Basically, I want to change the TX power. From all info that i search, I discover that there is a table that you can modifiy, as seen in the picture (please don't mind the second column of numbers, I'm just playing with some values

image

Also, I discover that if I change the last row or simply delete it (changing the power_count parameter as well), my microcontroller emits at the last row info:

image

My problem is that I want to change this value while the micro is running, basically seeing how many neighbours are connected and increasing or decreasing the power.

I read the documentation in https://wirepas.github.io/wm-sdk/master/d8/da1/wms__radio__config_8h.html Also the fields related to app_lib_radio_cfg_fem_set_power_cb_f app_lib_radio_cfg_power_setup_f

But my problem is that I'm no able to change the tx value using the different functions, and I don't know why, After doing Fem_init() at the beggining (in App_init) image

I set this in the definition of Fem_init()

image

And also try to call different functions such as fem_set_power_cb(2), or setPower, also keeping in mind that in order to change the TX level the FEM must be disconnected or at least not in use.

I'm new to C and wirepas sdk, so it will be great if someone could help me with this task. Knowing that deleting one row of the power table, and seeing changes in the Wirepas Terminal tells me this table is being used, but I'm uncapable of selecting one row (one power level) using functions.

Thanks in advace. Greetings