smsc_at2.h
资源名称:gateway-1.2.1 [点击查看]
上传用户:gzpyjq
上传日期:2013-01-31
资源大小:1852k
文件大小:7k
源码类别:
手机WAP编程
开发平台:
WINDOWS
- /*
- * gw/smsc_at2.h
- *
- * New driver for serial connected AT based
- * devices.
- * 4.9.2001
- * Andreas Fink <afink@smsrelay.com>
- *
- */
- #ifndef SMSC_AT2_H
- #define SMSC_AT2_H
- #include "gwlib/gwlib.h"
- /* maximum data to attempt to read in one go */
- #define MAX_READ 1023
- /* Message types defines */
- #define AT_DELIVER_SM 0
- #define AT_SUBMIT_SM 1
- #define AT_STATUS_REPORT_SM 2
- /* type of phone number defines */
- #define PNT_UNKNOWN 0
- #define PNT_INTER 1
- #define PNT_NATIONAL 2
- /* The number of times to attempt to send a message should sending fail */
- #define RETRY_SEND 3
- /*
- * defines for use with the so-called "SIM buffering techinique":
- * once in how many seconds to poll the memory locations,
- * if keepalive is _not_ set (will use keepalive time if set)
- */
- #define AT2_DEFAULT_SMS_POLL_INTERVAL 60
- /*
- * Structures used in at2
- */
- typedef struct ModemDef {
- Octstr *id;
- Octstr *name;
- Octstr *detect_string;
- Octstr *detect_string2;
- Octstr *init_string;
- long speed;
- Octstr *enable_hwhs;
- int need_sleep;
- int no_pin;
- int no_smsc;
- long sendline_sleep;
- Octstr *keepalive_cmd;
- int broken;
- Octstr *message_storage;
- int enable_mms;
- } ModemDef;
- typedef struct PrivAT2data {
- List *outgoing_queue;
- ModemDef *modem;
- long device_thread;
- int shutdown; /* Internal signal to shut down */
- Octstr *device;
- long speed;
- long keepalive;
- int fd; /* file descriptor */
- Octstr *ilb; /* input line buffer */
- Octstr *lines; /* the last few lines before OK was seen */
- Octstr *pin; /* PIN code */
- int pin_ready;
- SMSCConn *conn;
- int phase2plus;
- Octstr *validityperiod;
- int alt_dcs;
- int retry;
- Octstr *my_number;
- Octstr *sms_center;
- Octstr *name;
- Octstr *configfile;
- int sms_memory_poll_interval;
- int sms_memory_capacity;
- int sms_memory_usage;
- } PrivAT2data;
- /*
- * Macro that is used inside smsc_at2.c in order to handle
- * octstr destruction more carefully.
- */
- #define O_DESTROY(a) { if(a) octstr_destroy(a); a = NULL; }
- /*
- #define at2_write_ctrlz(a) at2_write(a,"