CarplayLinkcbsImpl.cpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #include "CarplayLinkCbsImpl.h"
  2. #include "CarplayLink.h"
  3. #ifdef USE_CARPLAY
  4. void CarplayLinkCbsImpl::iap2LinkStatus(int status)
  5. {
  6. (void)status;
  7. }
  8. int CarplayLinkCbsImpl::iap2WriteData(char *buf, int len)
  9. {
  10. (void)buf;
  11. (void)len;
  12. return 0;
  13. }
  14. void CarplayLinkCbsImpl::carplaySessionStart()
  15. {
  16. printf("%s:%s:%d\r\n",__FILE__,__func__,__LINE__);
  17. }
  18. void CarplayLinkCbsImpl::carplaySessionStop()
  19. {
  20. printf("%s:%s:%d\r\n",__FILE__,__func__,__LINE__);
  21. }
  22. int CarplayLinkCbsImpl::switchUsbModeCB(UsbMode mode)
  23. {
  24. (void)mode;
  25. return 0;
  26. }
  27. void CarplayLinkCbsImpl::appleTimeUpdateCB(long long time, int zone_offset)
  28. {
  29. printf("%s:%s:%d\r\n",__FILE__,__func__,__LINE__);
  30. printf("time = %lld, zone_offset = %d\r\n", time, zone_offset);
  31. if(mHandle)
  32. mHandle->setLocalTime(time);
  33. }
  34. void CarplayLinkCbsImpl::appleLanguageUpdateCB(const char *lang)
  35. {
  36. }
  37. void CarplayLinkCbsImpl::NotifyDeviceNameCB(const char *name, int name_len)
  38. {
  39. }
  40. void CarplayLinkCbsImpl::carplayExitCB()
  41. {
  42. printf("%s:%s:%d\r\n",__FILE__,__func__,__LINE__);
  43. if(mHandle)
  44. mHandle->onSdkConnectStatus(CONNECT_STATUS_DISCONNECTED,UnKnown);
  45. }
  46. void CarplayLinkCbsImpl::returnNativeUICB()
  47. {
  48. printf("%s:%s:%d\r\n",__FILE__,__func__,__LINE__);
  49. mEntityScreen = 2;
  50. if(mHandle)
  51. mHandle->app_status(APP_BACKGROUND, nullptr);
  52. }
  53. void CarplayLinkCbsImpl::modesChangeCB(CarPlayModeState *modes)
  54. {
  55. if(mHandle){
  56. if(mEntityScreen != modes->screen){
  57. printf("%s:%s:%d\r\n",__FILE__,__func__,__LINE__);
  58. printf("screen mode = %d\r\n",modes->screen);
  59. if(modes->screen == 1)
  60. mHandle->app_status(APP_FOREGROUND, nullptr);
  61. else if(modes->screen == 2)
  62. mHandle->app_status(APP_BACKGROUND, nullptr);
  63. mEntityScreen = modes->screen;
  64. }
  65. if(mEntityPhoneCall != modes->phoneCall){
  66. printf("%s:%s:%d\r\n",__FILE__,__func__,__LINE__);
  67. printf("phone call mode = %d\r\n",modes->phoneCall);
  68. if(modes->phoneCall == 1)
  69. mHandle->app_status(APP_PHONE_STARTED, nullptr);
  70. else
  71. mHandle->app_status(APP_PHONE_STOPPED, nullptr);
  72. mEntityPhoneCall = modes->phoneCall;
  73. }
  74. }
  75. }
  76. void CarplayLinkCbsImpl::disableBluetoothCB()
  77. {
  78. }
  79. void CarplayLinkCbsImpl::caplayDuckAudioCB(double inDurationSecs, double inVolume)
  80. {
  81. }
  82. void CarplayLinkCbsImpl::caplayUnduckAudioCB(double inDurationSecs)
  83. {
  84. }
  85. #endif