ppp_interface.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _PPP_INTERFACE_H_
  13. #define _PPP_INTERFACE_H_
  14. #include <stdint.h>
  15. #include <stdbool.h>
  16. #include <stddef.h>
  17. #include "at_engine.h"
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #define GPRS_UNACTIVE 5 // The same as PPPERR_USER in ppp.h
  22. typedef struct pppSession pppSession_t;
  23. typedef int (*pppOutputCallback_t)(void *ctx, uint8_t *data, uint32_t size);
  24. typedef void (*pppEndCallback_t)(void *ctx, uint8_t error);
  25. //pppFlowControlCallback_t 0 - Not DLFolwControl; 1-DLFolwControl Soft; 2-DLFolwControl Hard
  26. typedef int (*pppFlowControlCallback_t)(void *ctx);
  27. #if PPP_AUTHGPRS_SUPPORT
  28. //refer to SPCSS00727655, add ppp CHAP auth function
  29. uint8_t getPppSessionActAttUTI(pppSession_t *ppp);
  30. #endif
  31. #ifdef CONFIG_QUEC_PROJECT_FEATURE_PPP
  32. bool quec_ppp_close_in_dialing(pppSession_t *ppp);
  33. bool quec_ppp_set_dev(pppSession_t *ppp, uint8_t dev);
  34. #endif
  35. pppSession_t *pppSessionCreate(uint8_t cid, uint8_t sim, osiThread_t *dl_thread,
  36. pppOutputCallback_t output_cb, void *output_cb_ctx,
  37. pppEndCallback_t end_cb, void *end_cb_ctx,
  38. pppFlowControlCallback_t flowctrl_cb, void *flowctrl_cb_ctx,
  39. int _iActiavedbyPPP);
  40. bool pppSessionDelete(pppSession_t *ppp);
  41. bool pppSessionClose(pppSession_t *ppp, uint8_t termflag);
  42. int pppSessionSuspend(pppSession_t *ppp);
  43. int pppSessionResume(pppSession_t *ppp);
  44. int pppSessionInput(pppSession_t *ppp, const void *data, size_t size);
  45. void pppSessionDeleteByNetifDestoryed(uint8_t nSimId, uint8_t nCid);
  46. void pppSessionDeleteBySimCid(uint8_t nSimId, uint8_t nCid, uint8_t forceClose);
  47. #ifndef CONFIG_QUEC_PROJECT_FEATURE_PPP
  48. void pppSessionLanDestroy(pppSession_t *ppp);
  49. #endif
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. #endif