ModemManager: SMS List API doesn't have an index, buffer isn't big enough

Hi, all. In the process of implementing some SMS support, I've run into a couple of issues with the org.freedesktop.ModemManager.Modem.Gsm.SMS.List DBus call, one in the API and one in the implementation.

The API issue is that as specified, the caller gets the contents of all of the messages, but not their index numbers, so there's no way to delete the messages that have been received. Here are three ways I've considered fixing this:

�1. Change to a List command that just gets the index numbers of the messages and lets the caller Get and Delete from that as needed. This is an OK API but doesn't really match the AT commands and would be a bit inefficient in that regard.
�2. Change the return type from "aa{sv}" to something that includes the index distinct from the message, such as "a(ia{sv})". Reflects the low level well, creates a bit of extra assembly and disassembly work.
�3. Add an "index" integer element to the dictionary of each message. This is both easy and still pretty closely reflects the low-level operation.

I'm leaning towards #3.

The implementation issue is the 2kb buffer-size limit imposed in mm-serial-port.c. With a bunch of test messages on my device, I'm already up past 3kb of data returned from a single AT+CMGL command. A 30-message memory could be up to 10kb with maximum-size messages, and I have no reason to think that there aren't devices with larger memories. At the very least, I'll cook up a patch to raise the buffer size limit, perhaps to 64k; ideally, the stack-allocated read buf size wouldn't have to increase as well, since most commands don't need this much space. Alternately, it would be nice to have some other means of detecting out-of-control modem spew besides an arbitrary size limit. Suggestions?

� � - Nathan

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]