user3019299
user3019299

Reputation: 199

how to send QMI api request to the device (like Sierra Wireless Card) by C

I am reading the QMI software API now since we will use QMI instead of AT commands. Based on the api, I know QMI imports C library to talk with device. My question is that how does it talk with device exactly?

Before I was using AT commands, I can use serialPort to send AT commands string to the device and get the response. But for now I will move into C library, like

ULONG QCWWAN2KConnect(CHAR * pDeviceID, CHAR * pDeviceKey);

How does this prototye work and how can I send this to the device? Using serialPort as well?

I really need some experts to give me an simple example for it. Thanks

Upvotes: 0

Views: 3838

Answers (1)

Aleksander
Aleksander

Reputation: 650

It really depends on whether you're using the GobiNet kernel driver (i.e. the 'official' out-of-tree driver given by manufacturers) or the qmi_wwan kernel driver (i.e. the 'unofficial in-tree' driver). If you're targeting to use the GobiAPI library (or a vendor specific one, like the Sierra SDK) then you're likely going to use GobiNet. See this blogpost for more information about the differences.

GobiNet doesn't use serial ports; instead it will use either:

  • A non-serial character device exposed, named something like /dev/qcqmi0
  • shared memory to talk betwen kernel and userspace (e.g. in newer Android devices).

In your case, you'll likely see the qcqmi device, so the GobiAPI/SDK will use that character device to send QMI commands to the device.

If you instead want to use the upstream qmi_wwan driver, you can use it with the libqmi library and its helper qmicli tool.

Upvotes: 4

Related Questions