#include <ofono/sms.h>
#include "smsutil.h"
#include "util.h"
+#include "vendor.h"
#include "gatchat.h"
#include "gatresult.h"
}
static gboolean build_cnmi_string(char *buf, int *cnmi_opts,
- gboolean cnma_enabled)
+ struct sms_data *data)
{
+ const char *mode;
int len = sprintf(buf, "AT+CNMI=");
- /* Mode doesn't matter, but sounds like 2 is the sanest option */
- if (!append_cnmi_element(buf, &len, cnmi_opts[0], "2310", FALSE))
+ if (data->vendor == OFONO_VENDOR_HTC_G1)
+ /* The G1 advertises support for mode 2, but returns an error
+ * if we attempt to actually use it. */
+ mode = "1";
+ else
+ /* Sounds like 2 is the sanest mode */
+ mode = "2310";
+
+ if (!append_cnmi_element(buf, &len, cnmi_opts[0], mode, FALSE))
return FALSE;
/* Prefer to deliver SMS via +CMT if CNMA is supported */
if (!append_cnmi_element(buf, &len, cnmi_opts[1],
- cnma_enabled ? "21" : "1", FALSE))
+ data->cnma_enabled ? "21" : "1", FALSE))
return FALSE;
/* Always deliver CB via +CBM, otherwise don't deliver at all */
goto out;
}
- if (build_cnmi_string(buf, cnmi_opts, data->cnma_enabled))
+ if (build_cnmi_string(buf, cnmi_opts, data))
supported = TRUE;
if (data->cnma_enabled)
#include <ofono/ussd.h>
#include <ofono/voicecall.h>
+#include <drivers/atmodem/vendor.h>
+
/* Supply our own syntax parser */
enum G1_STATE_ {
ofono_call_meter_create(modem, 0, "atmodem", chat);
ofono_call_barring_create(modem, 0, "atmodem", chat);
ofono_ssn_create(modem, 0, "atmodem", chat);
+ ofono_sms_create(modem, OFONO_VENDOR_HTC_G1, "atmodem", chat);
ofono_phonebook_create(modem, 0, "atmodem", chat);
mw = ofono_message_waiting_create(modem);