[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/app/zte_amt/port_com.h b/ap/app/zte_amt/port_com.h
new file mode 100755
index 0000000..cacaafc
--- /dev/null
+++ b/ap/app/zte_amt/port_com.h
@@ -0,0 +1,80 @@
+/**
+ * ±¾³ÌÐò·ûºÏGPLÌõÔ¼
+ * Ò»×é²Ù×÷´®¿ÚµÄº¯Êý
+ * Beneboy 2003-5-16
+ */
+
+#ifndef _PORT_COM_H
+#define _PORT_COM_H
+
+
+typedef struct
+{
+ char prompt; // prompt after reciving data
+ int baudrate; // baudrate
+ char databit; // data bits, 5, 6, 7, 8
+ char debug; // debug mode, 0: none, 1: debug
+ char echo; // echo mode, 0: none, 1: echo
+ char fctl; // flow control, 0: none, 1: hardware, 2: software
+ char tty; // tty: 0, 1, 2, 3, 4, 5, 6, 7
+ char parity; // parity 0: none, 1: odd, 2: even
+ char stopbit; // stop bits, 1, 2
+ int reserved; // reserved, must be zero
+} portinfo_t, *pportinfo_t;
+
+
+typedef enum
+{
+ NO_WAIT = 0,
+ WAIT_ALL
+} WAIT_FLAG;
+
+/**
+ * ´ò¿ª´®¿Ú, ·µ»ØÎļþÃèÊö·û
+ * pportinfo: ´ýÉèÖõĴ®¿ÚÐÅÏ¢
+ */
+int PortOpen(pportinfo_t pportinfo,int mode);
+
+/**
+ * ¶Ë¿Ú³õʼ»¯
+ */
+int PortInit(int mode);
+/**
+ * ÉèÖô®¿Ú
+ * fdcom: ´®¿ÚÎļþÃèÊö·û, pportinfo: ´ýÉèÖõĴ®¿ÚÐÅÏ¢
+ */
+int PortSet(int fd);
+/**
+ * ¹Ø±Õ´®¿Ú
+ * fdcom: ´®¿ÚÎļþÃèÊö·û
+ */
+void PortClose(int fd);
+
+/**
+ * PortSend
+ * fd: ´®¿ÚÃèÊö·û,
+ * data: ´ý·¢ËÍÊý¾ÝÖ¸Õë
+ * datalen: Êý¾Ý³¤¶È
+ * ·µ»ØÊµ¼Ê·¢Ëͳ¤¶È
+ */
+int PortSend(int fd, unsigned char* data, int datalen, int flag);
+
+/**
+ * PortRecv
+ * ²ÎÊý£º
+ * fd: ´®¿ÚÃèÊö·û,
+ * data: ´ý½ÓÊÕÊý¾ÝÖ¸Õë
+ * datalen: Êý¾Ý³¤¶È
+ * ·µ»ØÊµ¼Ê¶ÁÈëµÄ×Ö½ÚÊý
+ */
+int PortRecv(int fd, unsigned char* data, int datalen, int flag);
+
+/**
+ * ´®¿Ú²âÊÔʱÉèÖô®¿Ú
+ * fdcom: ´®¿ÚÎļþÃèÊö·û, pportinfo: ´ýÉèÖõĴ®¿ÚÐÅÏ¢
+ */
+int uart_set(int fd);
+
+
+#endif
+