Modem.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 PWREN
  28. #define MODEM_PWREN_PIN GPIO_Pin_14
  29. #define MODEM_PWREN_PORT GPIOC
  30. #define MODEM_PWREN_HIGH MODEM_PWREN_PORT->BSRR = MODEM_PWREN_PIN
  31. #define MODEM_PWREN_LOW MODEM_PWREN_PORT->BRR = MODEM_PWREN_PIN
  32. //modem Update
  33. #define MODEM_UPDATE_PIN GPIO_Pin_8
  34. #define MODEM_UPDATE_PORT GPIOA
  35. #define MODEM_UPDATE_HIGH MODEM_UPDATE_PORT->BSRR = MODEM_UPDATE_PIN
  36. #define MODEM_UPDATE_LOW MODEM_UPDATE_PORT->BRR = MODEM_UPDATE_PIN
  37. extern SUT_MODEM_AT_MSG sutAtm,sutAtmPro;
  38. void ModemPinConfig(void);
  39. void ModemSendAt(char *p);
  40. void ModemSendData(unsigned char *pData,unsigned short datalen);
  41. void ModemVersionGet(char *msg);
  42. void ModemPocVerGet(char *msg);
  43. void ModemSetPocPara(char *msg,int len);
  44. void ModemApnConfig(void);
  45. void MeSpeak(ENCODE_DEF type, char *voice);
  46. void getModemModule(char *msg);
  47. void getModemVersion(char *msg);
  48. void CheckPocType(void);
  49. void ModemOwnPocSet(void);
  50. void getPocCode(char *msg);
  51. void SetDefaultSpkMic(void);
  52. void ModemGetICCID(char *msg);
  53. char *getIMEI(void);
  54. char *getICCID(void);
  55. char SimpleUserInfoScan(unsigned char firstIn,unsigned char direction);
  56. void ModemGetTime(char *msg);
  57. extern unsigned char ModemVer[15];
  58. #endif