main.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. *
  3. * Copyright (c) 2020 Project CHIP Authors
  4. * All rights reserved.
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. #include "AppMain.h"
  19. #include "AppTv.h"
  20. #include <access/AccessControl.h>
  21. #include <app-common/zap-generated/ids/Attributes.h>
  22. #include <app-common/zap-generated/ids/Clusters.h>
  23. #include <app/CommandHandler.h>
  24. #include <app/app-platform/ContentAppPlatform.h>
  25. #include <app/util/af.h>
  26. #if defined(ENABLE_CHIP_SHELL)
  27. #include "AppTvShellCommands.h"
  28. #endif
  29. using namespace chip;
  30. using namespace chip::Transport;
  31. using namespace chip::DeviceLayer;
  32. using namespace chip::AppPlatform;
  33. using namespace chip::app::Clusters;
  34. void ApplicationInit()
  35. {
  36. ChipLogProgress(Zcl, "TV Linux App: ApplicationInit()");
  37. // Disable last fixed endpoint, which is used as a placeholder for all of the
  38. // supported clusters so that ZAP will generated the requisite code.
  39. ChipLogDetail(DeviceLayer, "TV Linux App: Warning - Fixed Content App Endpoint Not Disabled");
  40. // Can't disable this without breaking CI unit tests that act upon account login cluster (only available on ep3)
  41. // emberAfEndpointEnableDisable(3, false);
  42. }
  43. void ApplicationShutdown() {}
  44. int main(int argc, char * argv[])
  45. {
  46. VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0);
  47. AppTvInit();
  48. #if defined(ENABLE_CHIP_SHELL)
  49. #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
  50. Shell::RegisterAppTvCommands();
  51. #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
  52. #endif
  53. ChipLinuxAppMainLoop();
  54. return 0;
  55. }