Closed boraozgen closed 4 years ago
Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers. Internal Jira reference: https://jira.arm.com/browse/MBOTRIAGE-2779
@boraozgen You can get handle to CellularNetwork
via CellularContext
and CellularDevice
:
For example:
NetworkInterface *iface = NetworkInterface::get_default_instance(); // "target.network-default-interface-type": "CELLULAR"
CellularContext *ctx = (CellularContext *)iface;
CellularDevice *dev = ctx->get_device();
CellularNetwork *nw = dev->open_network();
I see, the name of the method is confusing though. I guess it does not create a new network instance if it already exists?
If that is the case, this issue could be a suggestion to clarify the method name.
Yes, it will create a new instance only if not created already earlier. Otherwise it will just return the handle to the existing one.
This is a public API function so name is frozen.
This solution works for me, closing the issue. Nevertheless I still think the API is unclear and something like get_network()
would be much better. Thanks for the support.
Description of defect
I am using an external cellular modem (Quectel BG96/95) and
NetworkInterface
API to connect to the internet. I would like to use the cellular registration information for diagnosis purposes in my application. I noticed that these information are conveniently read and saved in theCellularNetwork
class, which is used by theCellularContext
class, which however does not expose the used instance. I wonder if this is a design decision or was just overlooked in the API. Shouldn't theCellularNetwork
instance be exposed to the application? I think the registration information, such as signal quality and cell information could be useful to any application using cellular connections.Target(s) affected by this defect ?
Custom board.
Toolchain(s) (name and version) displaying this defect ?
API issue, not relevant.
What version of Mbed-os are you using (tag or sha) ?
mbed-os-6.2.0
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
API issue, not relevant.
How is this defect reproduced ?
API issue, not relevant.