Skip to content

Commit

Permalink
DSDL Leaf
Browse files Browse the repository at this point in the history
Add DSDL Leaf (starting module development)
Fix debug_h for mistake including trace_level for cycloneTCP modules
  • Loading branch information
digitecomg committed Nov 15, 2024
1 parent 5654055 commit 75d7bcf
Show file tree
Hide file tree
Showing 26 changed files with 893 additions and 586 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rmap.tableb.B13212.1.0 val
rmap.tableb.B33199.1.0 confidence
@sealed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rmap.sensors.Leaf.1.0 BFT
@sealed
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rmap.metadata.Metadata.1.0 metadata
rmap.measures.Leaf.1.0 leaf
@sealed
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
rmap.service.setmode.1.0 parameter

@sealed

---

#RMAP Response state
uint4 state

#RMAP version and revision
uint8 version
uint8 revision

#MODULE Flags state
bool is_adc_unit_error
bool is_adc_unit_overflow
uint8 rbt_event
uint8 wdt_event

rmap.sensors.Leaf.1.0 BFT

@sealed
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Time leaf (sec)
# fattore scala x1
# MAX 12h (sec)
uint16 MAX = 43200
uint16 value
@sealed
9 changes: 5 additions & 4 deletions platformio/stima_v4/master/include/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
******************************************************************************
* @file debug.h
* @author Marco Baldinetti <m.baldinetti@digiteco.it>
* @author Moreno Gasperini <m.gasperini@digiteco.it>
* @brief Debug constants and functions
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (C) 2022 Marco Baldinetti <m.baldinetti@digiteco.it></center></h2>
* <h2><center>&copy; Stimav4 is Copyright (C) 2023 ARPAE-SIMC urpsim@arpae.it</center></h2>
* <h2><center>All rights reserved.</center></h2>
*
* This program is free software; you can redistribute it and/or
Expand All @@ -25,7 +26,7 @@
* <http://www.gnu.org/licenses/>.
*
******************************************************************************
*/
*/

#ifndef _DEBUG_H
#define _DEBUG_H
Expand Down Expand Up @@ -69,8 +70,6 @@
#define TRACE_LEVEL TRACE_LEVEL_DEBUG
#endif

void print_debug(const char *fmt, ...);

// Trace output redirection
#ifndef TRACE_PRINTF
#define TRACE_PRINTF(...) osSuspendAllTasks(), print_debug(__VA_ARGS__), osResumeAllTasks()
Expand Down Expand Up @@ -161,6 +160,8 @@ void print_debug(const char *fmt, ...);
// Debug related functions
void init_debug(uint32_t baudrate);

void print_debug(const char *fmt, ...);

void print_debug_array(const char *prepend, const void *data, size_t length);

// Deprecated definitions
Expand Down
61 changes: 29 additions & 32 deletions platformio/stima_v4/master/include/debug_F.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
/**@file debug_F.h */

/*********************************************************************
<h2><center>&copy; Stimav4 is Copyright (C) 2023 ARPAE-SIMC urpsim@arpae.it</center></h2>
authors:
Marco Baldinetti <m.baldinetti@digiteco.it>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<http://www.gnu.org/licenses/>.
**********************************************************************/
/**
******************************************************************************
* @file debug_F.h
* @author Marco Baldinetti <m.baldinetti@digiteco.it>
* @author Moreno Gasperini <m.gasperini@digiteco.it>
* @brief Debug constants and functions
******************************************************************************
* @attention
*
* <h2><center>&copy; Stimav4 is Copyright (C) 2023 ARPAE-SIMC urpsim@arpae.it</center></h2>
* <h2><center>All rights reserved.</center></h2>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* <http://www.gnu.org/licenses/>.
*
******************************************************************************
*/

#ifndef _DEBUG_F_H
#define _DEBUG_F_H
Expand Down Expand Up @@ -94,14 +101,4 @@ void queue_debug_F(Queue *dataLogPutQueue, const __FlashStringHelper *fmt, ...);
#define LOG_VERBOSE_F(...)
#endif

//C++ guard
#ifdef __cplusplus
extern "C" {
#endif

// C++ guard
#ifdef __cplusplus
}
#endif

#endif
133 changes: 91 additions & 42 deletions platformio/stima_v4/master/include/tasks/mqtt_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,40 +118,98 @@
const uint16_t MqttCipherSuites[] =
{
// rmap server psk ciphers
TLS_PSK_WITH_AES_256_CCM // WEAK BUT WORK
// TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 // RECOMMENDED BUT NOT WORK
// TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 // RECOMMENDED BUT NOT WORK
// TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 // RECOMMENDED BUT NOT WORK
// TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 // RECOMMENDED BUT NOT WORK

// TLS_PSK_WITH_AES_256_CBC_SHA, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_PSK_WITH_AES_256_GCM_SHA384, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_DHE_PSK_WITH_AES_256_CBC_SHA384, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_PSK_WITH_AES_256_CBC_SHA384, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_DHE_PSK_WITH_AES_128_GCM_SHA256, // RECOMMENDED BUT NOT WORK
// TLS_PSK_WITH_AES_128_GCM_SHA256, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_DHE_PSK_WITH_AES_128_CBC_SHA, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_PSK_WITH_AES_128_CBC_SHA256, // WEAK BUT NOT WORK (PREVIOUSLY WORK)
// TLS_PSK_WITH_AES_128_CBC_SHA // WEAK BUT NOT WORK (PREVIOUSLY WORK)

// Recommended psk ciphers
// TLS_DHE_PSK_WITH_AES_128_GCM_SHA256,
// TLS_DHE_PSK_WITH_AES_256_GCM_SHA384,
// TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256,
// TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384,
// TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
// TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
// TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256,
// TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256,
// TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384,
// TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256
TLS_PSK_WITH_AES_256_CCM
};

// const uint16_t AllMqttCipherSuitesPsk[] =
// {
// TLS_PSK_WITH_NULL_SHA ,
// TLS_PSK_WITH_NULL_SHA256 ,
// TLS_PSK_WITH_NULL_SHA384 ,
// TLS_PSK_WITH_RC4_128_SHA ,
// TLS_PSK_WITH_3DES_EDE_CBC_SHA ,
// TLS_PSK_WITH_AES_128_CBC_SHA ,
// TLS_PSK_WITH_AES_256_CBC_SHA ,
// TLS_PSK_WITH_AES_128_CBC_SHA256 ,
// TLS_PSK_WITH_AES_256_CBC_SHA384 ,
// TLS_PSK_WITH_AES_128_GCM_SHA256 ,
// TLS_PSK_WITH_AES_128_CCM ,
// TLS_PSK_WITH_AES_256_CCM ,
// TLS_PSK_WITH_AES_128_CCM_8 ,
// TLS_PSK_WITH_AES_256_CCM_8 ,
// TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 ,
// TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 ,
// TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 ,
// TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 ,
// TLS_PSK_WITH_ARIA_128_CBC_SHA256 ,
// TLS_PSK_WITH_ARIA_256_CBC_SHA384 ,
// TLS_PSK_WITH_ARIA_128_GCM_SHA256 ,
// TLS_PSK_WITH_ARIA_256_GCM_SHA384 ,
// TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 ,
// TLS_RSA_PSK_WITH_NULL_SHA ,
// TLS_RSA_PSK_WITH_NULL_SHA256 ,
// TLS_RSA_PSK_WITH_NULL_SHA384 ,
// TLS_RSA_PSK_WITH_RC4_128_SHA ,
// TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA ,
// TLS_RSA_PSK_WITH_AES_128_CBC_SHA ,
// TLS_RSA_PSK_WITH_AES_256_CBC_SHA ,
// TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 ,
// TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 ,
// TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 ,
// TLS_RSA_PSK_WITH_AES_256_GCM_SHA384,
// TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 ,
// TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 ,
// TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 ,
// TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 ,
// TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 ,
// TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 ,
// TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 ,
// TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 ,
// TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 ,
// TLS_DHE_PSK_WITH_NULL_SHA ,
// TLS_DHE_PSK_WITH_NULL_SHA256 ,
// TLS_DHE_PSK_WITH_NULL_SHA384 ,
// TLS_DHE_PSK_WITH_RC4_128_SHA ,
// TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA ,
// TLS_DHE_PSK_WITH_AES_128_CBC_SHA ,
// TLS_DHE_PSK_WITH_AES_256_CBC_SHA ,
// TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 ,
// TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 ,
// TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 ,
// TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 ,
// TLS_DHE_PSK_WITH_AES_128_CCM ,
// TLS_DHE_PSK_WITH_AES_256_CCM ,
// TLS_DHE_PSK_WITH_AES_128_CCM_8 ,
// TLS_DHE_PSK_WITH_AES_256_CCM_8 ,
// TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 ,
// TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 ,
// TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 ,
// TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 ,
// TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 ,
// TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 ,
// TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 ,
// TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 ,
// TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 ,
// TLS_ECDHE_PSK_WITH_NULL_SHA ,
// TLS_ECDHE_PSK_WITH_NULL_SHA256 ,
// TLS_ECDHE_PSK_WITH_NULL_SHA384 ,
// TLS_ECDHE_PSK_WITH_RC4_128_SHA ,
// TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA ,
// TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA ,
// TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA ,
// TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 ,
// TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 ,
// TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256 ,
// TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384 ,
// TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256 ,
// TLS_ECDHE_PSK_WITH_AES_128_CCM_8_SHA256 ,
// TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 ,
// TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 ,
// TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 ,
// TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 ,
// TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256
// };

using namespace cpp_freertos;

/// @brief struct local elaborate data parameter
Expand Down Expand Up @@ -277,20 +335,11 @@ class MqttTask : public cpp_freertos::Thread {
inline static cpp_freertos::BinarySemaphore *localRpcLock;
inline static JsonRPC *localStreamRpc;

inline static MqttClientContext *localPtrMqttClientContext;

inline static system_status_t *localSystemStatus;
inline static configuration_t *localConfiguration;

inline static YarrowContext *MqttYarrowContext;

// Client's PSK key
inline static uint8_t *MqttClientPSKKey;

// Client's PSK identity
inline static char_t MqttClientPSKIdentity[CLIENT_PSK_IDENTITY_LENGTH];

inline static char_t *MqttServer;

bool is_event_rpc;
};

Expand Down
1 change: 1 addition & 0 deletions platformio/stima_v4/master/include/tasks/supervisor_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#define SUPERVISOR_TASK_SLEEP_DELAY_MS (1000)

#define MIN_ATTEMPTED_CONNECTION_VALID (5)
#define RANDOM_RUN_CONNECTION_SERVER_SEC (60)

#if (ENABLE_I2C1 || ENABLE_I2C2)
#include <Wire.h>
Expand Down
Loading

0 comments on commit 75d7bcf

Please sign in to comment.