cli_model_client.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /**
  2. * \file cli_model_client.c
  3. *
  4. * This File contains the "model client" handlers for the CLI application,
  5. * to exercise various functionalities of the Mindtree Mesh stack.
  6. */
  7. /*
  8. * Copyright (C) 2017. Mindtree Ltd.
  9. * All rights reserved.
  10. */
  11. /* ------------------------------- Header File Inclusion */
  12. #include "cli_main.h"
  13. /* ------------------------------- Global Variables */
  14. /* Level - Model - Client */
  15. DECL_CONST CLI_COMMAND cli_modelc_cmd_list[] =
  16. {
  17. /* Help */
  18. { "help", "Help", cli_help },
  19. /* Back */
  20. { "back", "One Level Up", cli_back },
  21. /* Root */
  22. { "root", "Back to Root", cli_root },
  23. #ifdef CLI_CONFIG_CLIENT_MODEL
  24. { "config", "Config Client Operations", cli_modelc_config },
  25. #endif /* CLI_CONFIG_CLIENT_MODEL */
  26. #ifdef CLI_HEALTH_CLIENT_MODEL
  27. { "health", "Health Client Operations", cli_modelc_health },
  28. #endif /* CLI_HEALTH_CLIENT_MODEL */
  29. #ifdef CLI_GENERICS_CLIENT_MODEL
  30. #ifdef CLI_GENERICS_ONOFF_CLIENT_MODEL
  31. { "onoff", "Generic Onoff Client Operations", cli_modelc_generic_onoff },
  32. #endif /* CLI_GENERICS_ONOFF_CLIENT_MODEL */
  33. #ifdef CLI_GENERICS_LEVEL_CLIENT_MODEL
  34. { "level", "Generic Level Client Operations", cli_modelc_generic_level },
  35. #endif /* CLI_GENERICS_LEVEL_CLIENT_MODEL */
  36. #ifdef CLI_GENERICS_TRANSITIONTIME_CLIENT_MODEL
  37. { "transitiontime", "Generic Default Transition Time Client Operations", cli_modelc_generic_default_transition_time },
  38. #endif /* CLI_GENERICS_TRANSITIONTIME_CLIENT_MODEL */
  39. #ifdef CLI_GENERICS_PWRONOFF_CLIENT_MODEL
  40. { "poweronoff", "Generic Power OnOff Client Operations", cli_modelc_generic_power_onoff },
  41. #endif /* CLI_GENERICS_PWRONOFF_CLIENT_MODEL */
  42. #ifdef CLI_GENERICS_PWRLEVEL_CLIENT_MODEL
  43. { "powerlevel", "Generic Power Level Client Operations", cli_modelc_generic_power_level },
  44. #endif /* CLI_GENERICS_PWRLEVEL_CLIENT_MODEL */
  45. #ifdef CLI_GENERICS_BATTERY_CLIENT_MODEL
  46. { "battery", "Generic Battery Client Operations", cli_modelc_generic_battery },
  47. #endif /* CLI_GENERICS_BATTERY_CLIENT_MODEL */
  48. #ifdef CLI_GENERICS_LOCATION_CLIENT_MODEL
  49. { "location", "Generic Location Client Operations", cli_modelc_generic_location },
  50. #endif /* CLI_GENERICS_LOCATION_CLIENT_MODEL */
  51. #ifdef CLI_GENERICS_PROPERTY_CLIENT_MODEL
  52. { "property", "Generic Property Client Operations", cli_modelc_generic_property },
  53. #endif /* CLI_GENERICS_PROPERTY_CLIENT_MODEL */
  54. #endif /* CLI_GENERICS_CLIENT_MODEL */
  55. #if (defined CLI_GENERICS_CLIENT_MODEL || defined CLI_LIGHTINGS_CLIENT_MODEL)
  56. { "scene", "Scene Client Operations", cli_modelc_scene },
  57. #endif /* (defined CLI_GENERICS_CLIENT_MODEL || defined CLI_LIGHTINGS_CLIENT_MODEL) */
  58. #ifdef CLI_LIGHTINGS_CLIENT_MODEL
  59. #ifdef CLI_LIGHTINGS_LIGHTNESS_CLIENT_MODEL
  60. { "lightness", "Light Lightness Client Operations", cli_modelc_light_lightness },
  61. #endif /* CLI_LIGHTINGS_LIGHTNESS_CLIENT_MODEL */
  62. #ifdef CLI_LIGHTINGS_CTL_CLIENT_MODEL
  63. { "ctl", "Light CTL Client Operations", cli_modelc_light_ctl },
  64. #endif /* CLI_LIGHTINGS_CTL_CLIENT_MODEL */
  65. #ifdef CLI_LIGHTINGS_HSL_CLIENT_MODEL
  66. { "hsl", "Light HSL Client Operations", cli_modelc_light_hsl },
  67. #endif /* CLI_LIGHTINGS_HSL_CLIENT_MODEL */
  68. #ifdef CLI_LIGHTINGS_XYL_CLIENT_MODEL
  69. { "xyl", "Light xyL Client Operations", cli_modelc_light_xyl },
  70. #endif /* CLI_LIGHTINGS_XYL_CLIENT_MODEL */
  71. #ifdef CLI_LIGHTINGS_LC_CLIENT_MODEL
  72. { "lc", "Light LC Client Operations", cli_modelc_light_lc },
  73. #endif /* CLI_LIGHTINGS_LC_CLIENT_MODEL */
  74. #endif /* CLI_LIGHTINGS_CLIENT_MODEL */
  75. };
  76. /* ------------------------------- Functions */
  77. /* Model Client */
  78. API_RESULT cli_model_client(UINT32 argc, UCHAR *argv[])
  79. {
  80. CONSOLE_OUT("In Model Client \n");
  81. cli_cmd_stack_push((CLI_COMMAND *)cli_modelc_cmd_list, sizeof(cli_modelc_cmd_list) / sizeof(CLI_COMMAND));
  82. cli_help(argc, argv);
  83. return API_SUCCESS;
  84. }