Poc.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**********************************************************************************
  2. * File Name: Poc.c
  3. * Function Describe:device for Poc
  4. * Relate Module:
  5. * Explain: the modem must be using ZTE MC8332
  6. * Writer: ShiLiangWen
  7. * Date: 2015.7.10
  8. ***********************************************************************************/
  9. #define THIS_FILE_ID 15
  10. #include "includes.h"
  11. SUT_POC_STATUS sutPocStatus;
  12. /********************************************************************
  13. *********************************************************************/
  14. void PocHandle(char *msg)
  15. {
  16. static unsigned char sucPocSpkFlag=0;//标识POC语音是否处于打开状态
  17. char *pName;
  18. int i;
  19. if(msg[1]=='Z' && msg[4]=='S'){//+ZTTS:0
  20. if(!sucPocSpkFlag)SpeakerDisable();//TTS语音播放结束后,如果POC语音处于非打开状态,才关闭PA
  21. return;
  22. }
  23. //==============+POC:xxxx=============
  24. //+POC:820100000000 +POC:8201ffffffff
  25. //+POC:82 02 00002c8d 4b6dd58b3100300032000000 登陆成功,提示“测试102”
  26. if(msg[5]=='8' && msg[6]=='2'){
  27. if(msg[8]=='2'){
  28. sutPocStatus.Logined=1;
  29. if(0==sutPocStatus.FirstLogin){//如果是首次登陆,则打开音频功放,允许播放提示
  30. sutPocStatus.FirstLogin=1;
  31. SpeakerEnable();
  32. }
  33. strncpy(sutPocStatus.UserName,&msg[17],POC_USER_NAME_LEN);
  34. SetLedIndicator(IndStandby);
  35. }else{
  36. sutPocStatus.Logined=0;
  37. SpeakerDisable();
  38. SetLedIndicator(IndNoNet);
  39. }
  40. }
  41. //+POC:86 00 000000dc a47fc47e3300 0000 进入群组,提示“群组3”(群组ID为000000dc,群组名为“群组3”即a47fc47e3300)
  42. if(msg[5]=='8' && msg[6]=='6'){
  43. if(0==sutPocStatus.FirstLogin){//如果是首次登陆,则打开音频功放,允许播放提示
  44. sutPocStatus.FirstLogin=1;
  45. SpeakerEnable();
  46. }
  47. strncpy(sutPocStatus.GroupName,&msg[17],POC_GROUP_NAME_LEN);
  48. SetLedIndicator(IndStandby);
  49. }
  50. //+POC:8b0001--有语音说话 +POC:8b0000--语音结束
  51. if(msg[5]=='8' && msg[6]=='b'){
  52. if(msg[10]=='1'){
  53. sucPocSpkFlag=1;
  54. SpeakerEnable();
  55. SetLedIndicator(IndRX);
  56. }else if(msg[10]=='0'){
  57. sucPocSpkFlag=0;
  58. SpeakerDisable();
  59. SetLedIndicator(IndStandby);
  60. }
  61. }
  62. //+POC:8301
  63. if(msg[5]=='8' && msg[6]=='3'){
  64. if(msg[8]=='0'){
  65. sutPocStatus.Spker=0;
  66. }else if(msg[8]=='1'){
  67. sutPocStatus.Spker=1;
  68. }
  69. }
  70. }