Europalab Devices produces a LoRaWAN transmitting client node, specialised for higher research of actuator and sensor assisted IoT networks. https://dev.europalab.com/nlnet/20200000/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 line
6.1KB

  1. /**
  2. * \file enddevice_demo.h
  3. *
  4. * \brief Serial Provisioning of LoRaWAN Demo Application
  5. *
  6. * Copyright (c) 2020 Europalab Devices ApS
  7. *
  8. * \asf_license_start
  9. *
  10. * \page License
  11. *
  12. * This file is part of Sendcomm.
  13. *
  14. * Sendcomm is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation, either version 3 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * Sendcomm is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with Sendcomm. If not, see <https://www.gnu.org/licenses/>.
  26. *
  27. * \asf_license_stop
  28. *
  29. */
  30. #ifndef DEMO_APP_H_
  31. #define DEMO_APP_H_
  32. /*********************************************************************//**
  33. \brief Macro to check the LoRaWAN stack status attribute
  34. network joined bit
  35. *************************************************************************/
  36. #define LORAWAN_NW_JOINED 0x01
  37. //#define EDBG_EUI_READ 1
  38. typedef enum _AppTaskIds_t
  39. {
  40. DISPLAY_TASK_HANDLER,
  41. PROCESS_TASK_HANDLER,
  42. APP_TASKS_COUNT
  43. }AppTaskIds_t;
  44. typedef enum _AppTaskState_t
  45. {
  46. RESTORE_BAND_STATE,
  47. DEMO_APP_CONFIG,
  48. DEMO_CERT_APP_STATE,
  49. DEMO_APP_STATE,
  50. JOIN_SEND_STATE
  51. }AppTaskState_t;
  52. /*********************************************************************//**
  53. \brief Function to Initialize the Demo application
  54. *************************************************************************/
  55. void mote_demo_init(void);
  56. /*********************************************************************//*
  57. \brief Set join parameters function
  58. \param[in] activation type - notifies the activation type (OTAA/ABP)
  59. \return LORAWAN_SUCCESS, if successfully set the join parameters
  60. LORAWAN_INVALID_PARAMETER, otherwise
  61. ************************************************************************/
  62. StackRetStatus_t set_join_parameters(ActivationType_t activation_type);
  63. /*********************************************************************//*
  64. \brief Function to Initialize the device type
  65. \param[in] ed_class - notifies the device class (CLASS_A/CLASS_C)
  66. \return LORAWAN_SUCCESS, if successfully set the device class
  67. LORAWAN_INVALID_PARAMETER, otherwise
  68. ************************************************************************/
  69. StackRetStatus_t set_device_type(EdClass_t ed_class);
  70. /***********************************************************************
  71. \brief Function to Initialize set default parameters
  72. \param[in] void
  73. \return LORAWAN_SUCCESS, if successfully set all the parameters
  74. LORAWAN_INVALID_PARAMETER, otherwise
  75. ************************************************************************/
  76. StackRetStatus_t mote_set_parameters(IsmBand_t ismBand, const uint16_t index);
  77. /*********************************************************************//*
  78. \brief Function to Initialize the Multicast parameters
  79. ************************************************************************/
  80. void set_multicast_params (void);
  81. /*********************************************************************//**
  82. \brief Callback function for the ending of Bidirectional communication of
  83. Application data
  84. *************************************************************************/
  85. void demo_appdata_callback(void *appHandle, appCbParams_t *data);
  86. /*********************************************************************//*
  87. \brief Callback function for the ending of Activation procedure
  88. ************************************************************************/
  89. void demo_joindata_callback(StackRetStatus_t status);
  90. /*********************************************************************//*
  91. \brief Function to Print stack default parameters
  92. ************************************************************************/
  93. void print_default_parameters(void);
  94. /*********************************************************************//*
  95. \brief Function to Print application configuration
  96. ************************************************************************/
  97. void print_application_config (void);
  98. /*********************************************************************//*
  99. \brief Function to Print array of characters
  100. \param[in] *array - Pointer of the array to be printed
  101. \param[in] length - Length of the array
  102. ************************************************************************/
  103. void print_array (uint8_t *data, uint8_t length);
  104. /*********************************************************************//*
  105. \brief Function to Print stack return status
  106. \param[in] status - Status from the stack
  107. ************************************************************************/
  108. void print_stack_status(StackRetStatus_t status);
  109. /*********************************************************************//*
  110. \brief Function to Check stack return status
  111. \param[in] Void
  112. ************************************************************************/
  113. void check_stack_status(void);
  114. /*********************************************************************//**
  115. \brief Pulls the data from UART when activated
  116. *************************************************************************/
  117. void serial_data_handler(void);
  118. /*********************************************************************//**
  119. \brief Pulls data from UART and concatenates to appropriate EUI/Key
  120. *************************************************************************/
  121. void serial_read_appConfig(uint8_t *buffer, uint8_t noOfBytes);
  122. /*********************************************************************//**
  123. \brief ASCII input to Decimal Converter. Range of ascii handled (0,F/f)
  124. *************************************************************************/
  125. uint8_t asciiToDecConverter(uint8_t input);
  126. #endif /* DEMO_APP_H_ */