Modem.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #ifndef __MODEM_H_
  2. #define __MODEM_H_
  3. #define MODEM_AT_MSG_DATA_LEN (512+30)
  4. typedef struct{
  5. unsigned short MsgLen;
  6. unsigned char MsgData[MODEM_AT_MSG_DATA_LEN];
  7. }SUT_MODEM_AT_MSG;
  8. typedef enum
  9. {
  10. ENCODE_NULL,
  11. ENCODE_GBK,//ENCODE_ASCII,//ÖÐÎÄGBK ʵ¼ÊΪASCII
  12. ENCODE_UNICODEBigend,
  13. ENCODE_ASCII,
  14. ENCODE_UNICODE,
  15. ENCODE_UTF8=6
  16. }ENCODE_DEF;
  17. typedef enum{
  18. AUTH_LOGIN_NONE,
  19. AUTH_LOGIN_PAP,
  20. AUTH_LOGIN_CHAP
  21. }AUTH_LOGINDEF;
  22. //Modem Reset
  23. #define MODEM_RESET_PIN GPIO_Pin_15
  24. #define MODEM_RESET_PORT GPIOC
  25. #define MODEM_RESET_HIGH MODEM_RESET_PORT->BSRR = MODEM_RESET_PIN
  26. #define MODEM_RESET_LOW MODEM_RESET_PORT->BRR = MODEM_RESET_PIN
  27. ////Modem Powerkey
  28. //#define MODEM_PWRKEY_PIN GPIO_Pin_10
  29. //#define MODEM_PWRKEY_PORT GPIOB
  30. //#define MODEM_PWRKEY_HIGH MODEM_PWRKEY_PORT->BSRR = MODEM_PWRKEY_PIN
  31. //#define MODEM_PWRKEY_LOW MODEM_PWRKEY_PORT->BRR = MODEM_PWRKEY_PIN
  32. //Modem PWREN
  33. #define MODEM_PWREN_PIN GPIO_Pin_14
  34. #define MODEM_PWREN_PORT GPIOC
  35. #define MODEM_PWREN_HIGH MODEM_PWREN_PORT->BSRR = MODEM_PWREN_PIN
  36. #define MODEM_PWREN_LOW MODEM_PWREN_PORT->BRR = MODEM_PWREN_PIN
  37. //USBorTTL
  38. #define USBORTTL_PIN GPIO_Pin_13
  39. #define USBORTTL_PORT GPIOC
  40. #define USBORTTL_HIGH USBORTTL_PORT->BSRR = USBORTTL_PIN
  41. #define USBORTTL_LOW USBORTTL_PORT->BRR = USBORTTL_PIN
  42. //modem Update
  43. #define MODEM_UPDATE_PIN GPIO_Pin_8
  44. #define MODEM_UPDATE_PORT GPIOA
  45. #define MODEM_UPDATE_HIGH MODEM_UPDATE_PORT->BSRR = MODEM_UPDATE_PIN
  46. #define MODEM_UPDATE_LOW MODEM_UPDATE_PORT->BRR = MODEM_UPDATE_PIN
  47. extern SUT_MODEM_AT_MSG sutAtm,sutAtmPro;
  48. void ModemPinConfig(void);
  49. void ModemSendAt(char *p);
  50. void ModemSendData(unsigned char *pData,unsigned short datalen);
  51. void ModemVersionGet(char *msg);
  52. void ModemPocVerGet(char *msg);
  53. void ModemSetPocPara(char *msg,int len);
  54. void ModemApnConfig(void);
  55. void MeSpeak(ENCODE_DEF type, char *voice);
  56. void getModemModule(char *msg);
  57. void getModemVersion(char *msg);
  58. void CheckPocType(void);
  59. void ModemOwnPocSet(void);
  60. void getPocCode(char *msg);
  61. void SetDefaultSpkMic(void);
  62. void ModemGetICCID(char *msg);
  63. char *getIMEI(void);
  64. char *getICCID(void);
  65. char SimpleUserInfoScan(unsigned char firstIn,unsigned char direction);
  66. void ModemGetTime(char *msg);
  67. extern unsigned char ModemVer[15];
  68. #endif