extAuth.h 736 B

12345678910111213141516171819202122232425
  1. #ifndef __EXT_AUTH_H__
  2. #define __EXT_AUTH_H__
  3. #define I_AM_LTE
  4. //#define I_AM_MCU
  5. #ifdef I_AM_LTE
  6. unsigned char *extGetRandStr(int *outlen);
  7. unsigned char * extGetCodeRandStr(int *outlen);
  8. #endif
  9. /*以下用于给MCU调用*/
  10. /*
  11. MCU向LTE发AT+GAUTH获取随机串
  12. +GAUTH:BEA6F8ECFFE4
  13. MCU将BEA6F8ECFFE4串转换成十六进制,长度减半
  14. 然后调用extCodeBuffer,将随机串传入,对长度为targetlen的数据targetString进行加密
  15. 然后对加密后的targetString转换成字符串,长度翻倍,能过AT+SAUTH=xx发送给LTE,LTE响应:
  16. +SAUTH:NULL
  17. +SAUTH:ERROR
  18. +SAUTH:OK
  19. */
  20. void extCodeBuffer(unsigned char *randString, int randlen, unsigned char *targetString, int targetlen);
  21. #endif