mayeranalytics / pySX127x

This is a python interface to the Semtech SX127x, HopeRF RFM9x, Microchip RN2483 long range, low power transceiver families.
GNU Affero General Public License v3.0
171 stars 115 forks source link

overhead class with little different #35

Open wiryonolau opened 4 years ago

wiryonolau commented 4 years ago

Hi is there a reason of separating LoRa and LoRa2, BOARD with BOARD2

I check the class it only use different configuration ( pin ,etc ). All the function is exactly the same.

It should be easy to make it more compact and more object oriented.

Instead of create BOARD outside of class, we could pass it to the LoRa class as variable. The BOARD also can be created using configuration parameters.

mayeranalytics commented 2 years ago

There's no deep reason for this. Running two or more LoRa instances on different boards within the same program seems meaningless because it's physically impossible on normal hardware. For this purpose it would be OO for the sake of OO. The ability to configure BOARD is a good point, though. It never seemed to be an issue in practice, though.