+#define SMSC_SHORTCHAR_SMSC (0xF0)
+#define SMSC_SHORTCHAR_SMSCNO (0xF1)
+#define SMSC_OPTIONS \
+ { "smsc", required_argument, NULL, SMSC_SHORTCHAR_SMSC}, \
+ { "smscno", required_argument, NULL, SMSC_SHORTCHAR_SMSCNO}
+
+/* RETURNS: Whether the options was found as ours (=>rerun getopt_long())
+ */
+static bool smsc_options_parse(int option,GSM_SMSMessage *SMS)
+{
+ switch (option) {
+
+ case SMSC_SHORTCHAR_SMSC: /* SMSC number */
+ SMS->MessageCenter.No = 0;
+ strcpy(SMS->MessageCenter.Number,optarg);
+ break;
+
+ case SMSC_SHORTCHAR_SMSCNO: /* SMSC number index in phone memory */
+ SMS->MessageCenter.No = atoi(optarg);
+
+ if (SMS->MessageCenter.No < 1 || SMS->MessageCenter.No > 5)
+ usage();
+ break;
+
+ default:
+ return(false); /* option not recognized */
+ }
+
+ return(true); /* option was successfuly processed */
+}
+
+/* RETURNS: Success
+ */
+bool sendsms_deconcatenated(GSM_SMSMessage *sms,char *buf,size_t buflen,bool useudh)
+{
+ GSM_Deconcatenate_state SMS_Deconcatenate_state;
+ GSM_Error error;
+
+ SMS_Deconcatenate_state.first=true;
+ while (SMS_Deconcatenate(&SMS_Deconcatenate_state,sms,buf,buflen,useudh)) {
+ /* Send the message. */
+ error = GSM->SendSMSMessage(sms);
+
+ if (error == GE_SMSSENDOK) {
+ fprintf(stdout, _("Send succeeded!\n"));
+ } else {
+ fprintf(stdout, _("SMS Send failed (error=%d)\n"), error);
+ return(false);
+ }
+ /* Here the sleep have no meaning.
+ * If it is required by some backend phone driver, it should be done THERE!
+ */
+ /* sleep(10); */
+ }
+ return(true);
+}
+