poc_interface.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #ifndef _POC_INTERFACE_
  2. #define _POC_INTERFACE_
  3. /*
  4. * Function: virtual_uart_read
  5. * Description:
  6. * Poc task call function notify UI task cmd response
  7. *
  8. * Parameters:
  9. * data: cmd response
  10. * len: response len
  11. *
  12. * Explain:
  13. * module should define this function,this is just declare
  14. *
  15. * Example:
  16. * data = "+POC:8202000000014b6dd58b31000000\r\n"
  17. *
  18. * Return:
  19. * none
  20. *
  21. */
  22. extern void virtual_uart_read(char *data, int len);
  23. /*
  24. * Function: virtual_uart_write
  25. * Description:
  26. * Other task send at cmd to poc task
  27. *
  28. * Parameters:
  29. * cmd: cmd body
  30. * len: cmd body len
  31. *
  32. * Explain:
  33. * module can call this function poc task have defined
  34. *
  35. * Example:
  36. * virtual_uart_write("AT+POC=0000000101\r\n", strlen("AT+POC=0000000101\r\n"));
  37. *
  38. * Return:
  39. * none
  40. *
  41. */
  42. void virtual_uart_write(char *cmd, int len);
  43. /*
  44. * Function: OEM_PocInit
  45. * Description:
  46. * Poc Lib Init
  47. *
  48. * Parameters:
  49. * none
  50. *
  51. * Explain:
  52. * module can call this function init poc lib
  53. *
  54. * Example:
  55. * OEM_PocInit();
  56. *
  57. * Return:
  58. * none
  59. *
  60. */
  61. void OEM_PocInit(void);
  62. /*
  63. * Function: report_encode_data_for_record
  64. * Description:
  65. * Report encode voice data for record
  66. *
  67. * Parameters:
  68. * data: voice data after encode
  69. * size: voice data len
  70. * frame_type: encode type 0x01 general 0x02 enhance
  71. * self: 0 other voice 1 my voice
  72. *
  73. * Explain:
  74. * module should define this function,this is just declare
  75. *
  76. * Example:
  77. *
  78. *
  79. * Return:
  80. * none
  81. *
  82. */
  83. extern void report_encode_data_for_record(unsigned char *data, unsigned int size, char frame_type, int self);
  84. /*
  85. * Function: decode_record_data
  86. * Description:
  87. * decode record data to pcm data
  88. *
  89. * Parameters:
  90. * enc_data: voice data after encode
  91. * len: voice data len
  92. * type: encode type 0x01 general 0x02 enhance
  93. * pcm_data: save pcm data after decode
  94. * size: save pcm data buf len
  95. *
  96. * Explain:
  97. * module can call this function poc task have defined
  98. *
  99. * Example:
  100. *
  101. *
  102. * Return:
  103. * -1 fail >0 pcm data len
  104. *
  105. */
  106. int decode_record_data(char *enc_data, int len, int type, char *pcm_data, int size)
  107. #endif