u-blox / ubxlib

Portable C libraries which provide APIs to build applications with u-blox products and services. Delivered as add-on to existing microcontroller and RTOS SDKs.
Apache License 2.0
287 stars 82 forks source link

best way to combine device-tree interfaces with uDeviceCfg_t in zephyr #247

Closed mos216 closed 2 weeks ago

mos216 commented 4 weeks ago

Hello, I noticed that uDeviceCfg_t has more properties than the one in the device tree. for example, pSimPinCode can be set only by the uDeviceCfg_t structure but not by the device tree. what is the best way to combine properties of uDeviceCfg_t structure with the device-tree when uDeviceOpen is called since we must pass NULL to uDeviceOpen if device interface is declared in device-tree?

Thank you in advance!

RobMeades commented 4 weeks ago

Hi: all of the device and network configuration items that have an effect in the uDeviceCfg_t, uNetworkCfgCell_t, uNetworkCfgGnss_t, uNetworkCfgWifi_t and uNetworkCfgBle_t structures should be settable through the device tree. The SIM PIN code is not there only because it has to always be set to NULL; we added it to the uDeviceCfg_t structure when we first created it years ago because it seemed logical but ubxlib has never supported setting a SIM PIN (the SIM PIN does not offer any security to speak of as it ends up being sent transparently over a serial port every time the cellular module is powered on).

So it should be possible to do everything you need to do through the device tree; let us know if not.

RobMeades commented 2 weeks ago

@mos216: are you OK to close this one now?

mos216 commented 2 weeks ago

Yes sure! thanks again!