Browse Source

Updated mbed-os to 5.11.5, update libs, format code with new clang conf

nvstore
Anthony Hinsinger 7 years ago
parent
commit
05d5ee476b
  1. 89
      .clang-format
  2. 20
      README.md
  3. 74
      lora_radio_helper.h
  4. 69
      main.cpp
  5. 2
      mbed-os.lib
  6. 2
      mbed-semtech-lora-rf-drivers.lib
  7. 31
      mbed_app.json
  8. 96
      mbedtls_lora_config.h

89
.clang-format

@ -0,0 +1,89 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never

20
README.md

@ -1,4 +1,4 @@
# RAK811 Tracker Board mbed test # WaveOfHoney - a lorawan beehive sensor
## Compilation ## Compilation
@ -6,19 +6,27 @@ Clone this repository, then :
```sh ```sh
mbed deploy mbed deploy
mbed new . mbed config root .
# set the compiler
mbed toolchain GCC_ARM mbed toolchain GCC_ARM
mbed target MTB_RAK811 # set the board
# modify lora.device-eui, lora.application-eui and lora.application-key in mbed_app.json mbed target NUCLEO_L073RZ
# modify mbed_settings.py to set gcc arm path if needed # modify mbed_settings.py to set gcc arm path if needed
mbed config -G GCC_ARM_PATH /opt/gcc-arm-none-eabi-7-2017-q4-major/bin
# modify lora.device-eui, lora.application-eui and lora.application-key in mbed_app.json
mbed compile --profile mbed-os/tools/profiles/release.json mbed compile --profile mbed-os/tools/profiles/release.json
``` ```
Then you can use stm32flash or may be better a stlink interface to copy the generated .bin file onto the RAK811. Then you can use stm32flash or - may be better - a stlink interface to copy the generated .bin file onto the RAK811.
## Notes ## Notes
### use STLink from a Nucleo board ### Tested boards
- MTB_RAK811
- NUCLEO_L073RZ + SX1272 shield
### use STLink from a Nucleo board with the RAK811 board
From STlink CN4 Connector to RAK811 "shortest" connector (pin 1 at the same side of antenna connectors) From STlink CN4 Connector to RAK811 "shortest" connector (pin 1 at the same side of antenna connectors)

74
lora_radio_helper.h

@ -27,57 +27,37 @@
#include "SX1272_LoRaRadio.h" #include "SX1272_LoRaRadio.h"
#include "SX1276_LoRaRadio.h" #include "SX1276_LoRaRadio.h"
#define SX1272 0xFF #define SX1272 0xFF
#define SX1276 0xEE #define SX1276 0xEE
#if (MBED_CONF_APP_LORA_RADIO == SX1272) #if(MBED_CONF_APP_LORA_RADIO == SX1272)
SX1272_LoRaRadio radio(MBED_CONF_APP_LORA_SPI_MOSI, SX1272_LoRaRadio radio(MBED_CONF_APP_LORA_SPI_MOSI, MBED_CONF_APP_LORA_SPI_MISO,
MBED_CONF_APP_LORA_SPI_MISO, MBED_CONF_APP_LORA_SPI_SCLK, MBED_CONF_APP_LORA_CS, MBED_CONF_APP_LORA_RESET,
MBED_CONF_APP_LORA_SPI_SCLK, MBED_CONF_APP_LORA_DIO0, MBED_CONF_APP_LORA_DIO1, MBED_CONF_APP_LORA_DIO2,
MBED_CONF_APP_LORA_CS, MBED_CONF_APP_LORA_DIO3, MBED_CONF_APP_LORA_DIO4, MBED_CONF_APP_LORA_DIO5,
MBED_CONF_APP_LORA_RESET, MBED_CONF_APP_LORA_RF_SWITCH_CTL1, MBED_CONF_APP_LORA_RF_SWITCH_CTL2,
MBED_CONF_APP_LORA_DIO0, MBED_CONF_APP_LORA_TXCTL, MBED_CONF_APP_LORA_RXCTL,
MBED_CONF_APP_LORA_DIO1, MBED_CONF_APP_LORA_ANT_SWITCH, MBED_CONF_APP_LORA_PWR_AMP_CTL,
MBED_CONF_APP_LORA_DIO2, MBED_CONF_APP_LORA_TCXO);
MBED_CONF_APP_LORA_DIO3,
MBED_CONF_APP_LORA_DIO4, #elif(MBED_CONF_APP_LORA_RADIO == SX1276)
MBED_CONF_APP_LORA_DIO5,
MBED_CONF_APP_LORA_RF_SWITCH_CTL1, SX1276_LoRaRadio radio(MBED_CONF_APP_LORA_SPI_MOSI, MBED_CONF_APP_LORA_SPI_MISO,
MBED_CONF_APP_LORA_RF_SWITCH_CTL2, MBED_CONF_APP_LORA_SPI_SCLK, MBED_CONF_APP_LORA_CS, MBED_CONF_APP_LORA_RESET,
MBED_CONF_APP_LORA_TXCTL, MBED_CONF_APP_LORA_DIO0, MBED_CONF_APP_LORA_DIO1, MBED_CONF_APP_LORA_DIO2,
MBED_CONF_APP_LORA_RXCTL, MBED_CONF_APP_LORA_DIO3, MBED_CONF_APP_LORA_DIO4, MBED_CONF_APP_LORA_DIO5,
MBED_CONF_APP_LORA_ANT_SWITCH, MBED_CONF_APP_LORA_RF_SWITCH_CTL1, MBED_CONF_APP_LORA_RF_SWITCH_CTL2,
MBED_CONF_APP_LORA_PWR_AMP_CTL, MBED_CONF_APP_LORA_TXCTL, MBED_CONF_APP_LORA_RXCTL,
MBED_CONF_APP_LORA_TCXO); MBED_CONF_APP_LORA_ANT_SWITCH, MBED_CONF_APP_LORA_PWR_AMP_CTL,
MBED_CONF_APP_LORA_TCXO);
#elif (MBED_CONF_APP_LORA_RADIO == SX1276)
SX1276_LoRaRadio radio(MBED_CONF_APP_LORA_SPI_MOSI,
MBED_CONF_APP_LORA_SPI_MISO,
MBED_CONF_APP_LORA_SPI_SCLK,
MBED_CONF_APP_LORA_CS,
MBED_CONF_APP_LORA_RESET,
MBED_CONF_APP_LORA_DIO0,
MBED_CONF_APP_LORA_DIO1,
MBED_CONF_APP_LORA_DIO2,
MBED_CONF_APP_LORA_DIO3,
MBED_CONF_APP_LORA_DIO4,
MBED_CONF_APP_LORA_DIO5,
MBED_CONF_APP_LORA_RF_SWITCH_CTL1,
MBED_CONF_APP_LORA_RF_SWITCH_CTL2,
MBED_CONF_APP_LORA_TXCTL,
MBED_CONF_APP_LORA_RXCTL,
MBED_CONF_APP_LORA_ANT_SWITCH,
MBED_CONF_APP_LORA_PWR_AMP_CTL,
MBED_CONF_APP_LORA_TCXO);
#else #else
#error "Unknown LoRa radio specified (SX1272,SX1276 are valid)" #error "Unknown LoRa radio specified (SX1272,SX1276 are valid)"
#endif #endif
#endif //DEVICE_SPI #endif // DEVICE_SPI
#endif //MBED_CONF_APP_LORAWAN_ENABLED #endif // MBED_CONF_APP_LORAWAN_ENABLED
#endif /* APP_LORA_RADIO_HELPER_H_ */ #endif /* APP_LORA_RADIO_HELPER_H_ */

69
main.cpp

@ -1,9 +1,9 @@
#include "mbed.h" #include "CayenneLPP.h"
#include "lorawan/LoRaWANInterface.h"
#include "lorawan/system/lorawan_data_structures.h"
#include "events/EventQueue.h" #include "events/EventQueue.h"
#include "lora_radio_helper.h" #include "lora_radio_helper.h"
#include "CayenneLPP.h" #include "lorawan/LoRaWANInterface.h"
#include "lorawan/system/lorawan_data_structures.h"
#include "mbed.h"
#if MBED_CONF_APP_DHT_ENABLED #if MBED_CONF_APP_DHT_ENABLED
#include "DHT.h" #include "DHT.h"
@ -14,23 +14,24 @@ using namespace events;
uint8_t rx_buffer[LORAMAC_PHY_MAXPAYLOAD]; uint8_t rx_buffer[LORAMAC_PHY_MAXPAYLOAD];
/* /*
* Sets up an application dependent transmission timer in ms. Used only when Duty Cycling is off for testing * Sets up an application dependent transmission timer in ms. Used only when Duty Cycling is off for
* testing
*/ */
#define TX_TIMER 600000 #define TX_TIMER 600000
/** /**
* Maximum number of events for the event queue. * Maximum number of events for the event queue.
* 16 is the safe number for the stack events, however, if application * 16 is the safe number for the stack events, however, if application
* also uses the queue for whatever purposes, this number should be increased.c * also uses the queue for whatever purposes, this number should be increased.c
*/ */
#define MAX_NUMBER_OF_EVENTS 16 #define MAX_NUMBER_OF_EVENTS 16
/** /**
* Maximum number of retries for CONFIRMED messages before giving up * Maximum number of retries for CONFIRMED messages before giving up
*/ */
#define CONFIRMED_MSG_RETRY_COUNTER 3 #define CONFIRMED_MSG_RETRY_COUNTER 3
static EventQueue ev_queue(MAX_NUMBER_OF_EVENTS * EVENTS_EVENT_SIZE); static EventQueue ev_queue(MAX_NUMBER_OF_EVENTS* EVENTS_EVENT_SIZE);
static void lora_event_handler(lorawan_event_t event); static void lora_event_handler(lorawan_event_t event);
static LoRaWANInterface lorawan(radio); static LoRaWANInterface lorawan(radio);
static lorawan_app_callbacks_t callbacks; static lorawan_app_callbacks_t callbacks;
@ -47,10 +48,9 @@ DHT dht(MBED_CONF_APP_DHT_DATA, MBED_CONF_APP_DHT_TYPE);
DigitalOut led(LED1, 1); DigitalOut led(LED1, 1);
int main(void) { int main(void) {
lorawan_status_t retcode; lorawan_status_t retcode;
// Initialize LoRaWAN stack // Initialize LoRaWAN stack
if (lorawan.initialize(&ev_queue) != LORAWAN_STATUS_OK) { if(lorawan.initialize(&ev_queue) != LORAWAN_STATUS_OK) {
printf("\r\n LoRa initialization failed! \r\n"); printf("\r\n LoRa initialization failed! \r\n");
return -1; return -1;
} }
@ -61,17 +61,15 @@ int main(void) {
lorawan.add_app_callbacks(&callbacks); lorawan.add_app_callbacks(&callbacks);
// Set number of retries in case of CONFIRMED messages // Set number of retries in case of CONFIRMED messages
if (lorawan.set_confirmed_msg_retries(CONFIRMED_MSG_RETRY_COUNTER) if(lorawan.set_confirmed_msg_retries(CONFIRMED_MSG_RETRY_COUNTER) != LORAWAN_STATUS_OK) {
!= LORAWAN_STATUS_OK) {
printf("\r\n set_confirmed_msg_retries failed! \r\n\r\n"); printf("\r\n set_confirmed_msg_retries failed! \r\n\r\n");
return -1; return -1;
} }
printf("\r\n CONFIRMED message retries : %d \r\n", printf("\r\n CONFIRMED message retries : %d \r\n", CONFIRMED_MSG_RETRY_COUNTER);
CONFIRMED_MSG_RETRY_COUNTER);
// Enable adaptive data rate // Enable adaptive data rate
if (lorawan.enable_adaptive_datarate() != LORAWAN_STATUS_OK) { if(lorawan.enable_adaptive_datarate() != LORAWAN_STATUS_OK) {
printf("\r\n enable_adaptive_datarate failed! \r\n"); printf("\r\n enable_adaptive_datarate failed! \r\n");
return -1; return -1;
} }
@ -82,8 +80,7 @@ int main(void) {
retcode = lorawan.connect(); retcode = lorawan.connect();
if (retcode == LORAWAN_STATUS_OK || if(retcode == LORAWAN_STATUS_OK || retcode == LORAWAN_STATUS_CONNECT_IN_PROGRESS) {
retcode == LORAWAN_STATUS_CONNECT_IN_PROGRESS) {
} else { } else {
printf("\r\n Connection error, code = %d \r\n", retcode); printf("\r\n Connection error, code = %d \r\n", retcode);
return -1; return -1;
@ -100,19 +97,18 @@ int main(void) {
/** /**
* Sends a message to the Network Server * Sends a message to the Network Server
*/ */
static void send_message() static void send_message() {
{
int16_t retcode; int16_t retcode;
#if MBED_CONF_APP_BATTERY_ENABLED #if MBED_CONF_APP_BATTERY_ENABLED
float vbat = bat.read(); float vbat = bat.read();
vbat = vbat*5/3*3.3f; vbat = vbat * 5 / 3 * 3.3f;
cayenne.addAnalogInput(1, vbat); cayenne.addAnalogInput(1, vbat);
#endif #endif
#if MBED_CONF_APP_DHT_ENABLED #if MBED_CONF_APP_DHT_ENABLED
int err = dht.read(); int err = dht.read();
if (err == DHT::SUCCESS) { if(err == DHT::SUCCESS) {
cayenne.addTemperature(1, dht.getTemperature()); cayenne.addTemperature(1, dht.getTemperature());
cayenne.addRelativeHumidity(2, dht.getHumidity()); cayenne.addRelativeHumidity(2, dht.getHumidity());
} else { } else {
@ -121,16 +117,16 @@ static void send_message()
#endif #endif
// No data to send // No data to send
if (cayenne.getSize() == 0) { if(cayenne.getSize() == 0) {
return; return;
} }
retcode = lorawan.send(MBED_CONF_LORA_APP_PORT, cayenne.getBuffer(), cayenne.getSize(), retcode = lorawan.send(MBED_CONF_LORA_APP_PORT, cayenne.getBuffer(), cayenne.getSize(),
MSG_UNCONFIRMED_FLAG); MSG_UNCONFIRMED_FLAG);
if (retcode < 0) { if(retcode < 0) {
retcode == LORAWAN_STATUS_WOULD_BLOCK ? printf("send - WOULD BLOCK\r\n") retcode == LORAWAN_STATUS_WOULD_BLOCK ? printf("send - WOULD BLOCK\r\n")
: printf("\r\n send() - Error code %d \r\n", retcode); : printf("\r\n send() - Error code %d \r\n", retcode);
return; return;
} }
@ -141,21 +137,19 @@ static void send_message()
/** /**
* Receive a message from the Network Server * Receive a message from the Network Server
*/ */
static void receive_message() static void receive_message() {
{
int16_t retcode; int16_t retcode;
retcode = lorawan.receive(MBED_CONF_LORA_APP_PORT, rx_buffer, retcode = lorawan.receive(MBED_CONF_LORA_APP_PORT, rx_buffer, LORAMAC_PHY_MAXPAYLOAD,
LORAMAC_PHY_MAXPAYLOAD, MSG_CONFIRMED_FLAG | MSG_UNCONFIRMED_FLAG);
MSG_CONFIRMED_FLAG|MSG_UNCONFIRMED_FLAG);
if (retcode < 0) { if(retcode < 0) {
printf("\r\n receive() - Error code %d \r\n", retcode); printf("\r\n receive() - Error code %d \r\n", retcode);
return; return;
} }
printf(" Data:"); printf(" Data:");
for (uint8_t i = 0; i < retcode; i++) { for(uint8_t i = 0; i < retcode; i++) {
printf("%x", rx_buffer[i]); printf("%x", rx_buffer[i]);
} }
@ -164,13 +158,12 @@ static void receive_message()
memset(rx_buffer, 0, LORAMAC_PHY_MAXPAYLOAD); memset(rx_buffer, 0, LORAMAC_PHY_MAXPAYLOAD);
} }
static void lora_event_handler(lorawan_event_t event) static void lora_event_handler(lorawan_event_t event) {
{ switch(event) {
switch (event) {
case CONNECTED: case CONNECTED:
led = 1; led = 1;
printf("\r\n Connection - Successful \r\n"); printf("\r\n Connection - Successful \r\n");
if (MBED_CONF_LORA_DUTY_CYCLE_ON) { if(MBED_CONF_LORA_DUTY_CYCLE_ON) {
send_message(); send_message();
} else { } else {
ev_queue.call_every(TX_TIMER, send_message); ev_queue.call_every(TX_TIMER, send_message);
@ -183,7 +176,7 @@ static void lora_event_handler(lorawan_event_t event)
break; break;
case TX_DONE: case TX_DONE:
printf("\r\n Message Sent to Network Server \r\n"); printf("\r\n Message Sent to Network Server \r\n");
if (MBED_CONF_LORA_DUTY_CYCLE_ON) { if(MBED_CONF_LORA_DUTY_CYCLE_ON) {
send_message(); send_message();
} }
break; break;
@ -193,7 +186,7 @@ static void lora_event_handler(lorawan_event_t event)
case TX_SCHEDULING_ERROR: case TX_SCHEDULING_ERROR:
printf("\r\n Transmission Error - EventCode = %d \r\n", event); printf("\r\n Transmission Error - EventCode = %d \r\n", event);
// try again // try again
if (MBED_CONF_LORA_DUTY_CYCLE_ON) { if(MBED_CONF_LORA_DUTY_CYCLE_ON) {
send_message(); send_message();
} }
break; break;

2
mbed-os.lib

@ -1 +1 @@
https://github.com/ARMmbed/mbed-os/#367dbdf5145f4d6aa3e483c147fe7bda1ce23a36 https://github.com/ARMmbed/mbed-os/#51d55508e8400b60af467005646c4e2164738d48

2
mbed-semtech-lora-rf-drivers.lib

@ -1 +1 @@
https://github.com/ARMmbed/mbed-semtech-lora-rf-drivers/#c5ee52293fee29aea3479d20e92ca2c1fc1ddaff https://github.com/ARMmbed/mbed-semtech-lora-rf-drivers/#16958f814d505cfbbedfa16d9bf8b9dff0e0442b

31
mbed_app.json

@ -263,6 +263,37 @@
"battery-enabled": true, "battery-enabled": true,
"battery-adc": "PA_2", "battery-adc": "PA_2",
"dht-enabled": true,
"dht-data": "PA_1",
"dht-type": "DHT::DHT22"
},
"NUCLEO_L073RZ": {
"lorawan-enabled": true,
"lora-radio": "SX1272",
"lora-spi-mosi": "D11",
"lora-spi-miso": "D12",
"lora-spi-sclk": "D13",
"lora-cs": "D10",
"lora-reset": "A0",
"lora-dio0": "D2",
"lora-dio1": "D3",
"lora-dio2": "D4",
"lora-dio3": "D5",
"lora-dio4": "D8",
"lora-dio5": "D9",
"lora-rf-switch-ctl1": "NC",
"lora-rf-switch-ctl2": "NC",
"lora-txctl": "NC",
"lora-rxctl": "NC",
"lora-ant-switch": "A4",
"lora-pwr-amp-ctl": "NC",
"lora-tcxo": "NC",
"battery-enabled": false,
"battery-adc": "PA_2",
"dht-enabled": true, "dht-enabled": true,
"dht-data": "PA_1", "dht-data": "PA_1",
"dht-type": "DHT::DHT22" "dht-type": "DHT::DHT22"

96
mbedtls_lora_config.h

@ -28,7 +28,6 @@
#ifndef MBEDTLS_LORA_CONFIG_H #ifndef MBEDTLS_LORA_CONFIG_H
#define MBEDTLS_LORA_CONFIG_H #define MBEDTLS_LORA_CONFIG_H
/** /**
* \name SECTION: System support * \name SECTION: System support
* *
@ -2586,17 +2585,19 @@
//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */ //#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
/* CTR_DRBG options */ /* CTR_DRBG options */
//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */ //#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by
//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ //default (48 with SHA-512, 32 with SHA-256) */ #define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**<
//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ //Interval before reseed is performed by default */ #define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**<
//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ //Maximum number of additional input bytes */ #define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024
//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ ///**< Maximum number of requested bytes per call */ #define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384
///**< Maximum size of (re)seed buffer */
/* HMAC_DRBG options */ /* HMAC_DRBG options */
//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ //#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by
//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ //default */ #define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional
//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ //input bytes */ #define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested
//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ //bytes per call */ #define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed
//buffer */
/* ECP options */ /* ECP options */
//#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */ //#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */
@ -2605,51 +2606,63 @@
/* Entropy options */ /* Entropy options */
//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */ //#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */ //#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy
//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */ //sources */ #define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of
//bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released
//*/
/* Memory buffer allocator options */ /* Memory buffer allocator options */
//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */ //#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
/* Platform options */ /* Platform options */
//#define MBEDTLS_PLATFORM_STD_MEM_HDR <stdlib.h> /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */ //#define MBEDTLS_PLATFORM_STD_MEM_HDR <stdlib.h> /**< Header to include if
//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */ //MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */ #define
//MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */ //#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */ //#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ //#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined.
//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */ //MBEDTLS_HAVE_TIME must be enabled */ #define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**<
//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */ //Default fprintf to use, can be undefined */ #define MBEDTLS_PLATFORM_STD_PRINTF printf /**<
//Default printf to use, can be undefined */
/* Note: your snprintf must correclty zero-terminate the buffer! */ /* Note: your snprintf must correclty zero-terminate the buffer! */
//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */ //#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined
//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */ //*/ #define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be
//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */ //undefined */ #define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can
//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ //be undefined */ #define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**<
//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ //Default nv_seed_read function to use, can be undefined */ #define
//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */ //MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write
//function to use, can be undefined */ #define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**<
//Seed file to read/write with default implementation */
/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */ /* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */ /* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */ //#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be
//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */ //undefined */ #define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use,
//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */ //can be undefined */ #define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to
//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ //use, can be undefined */ #define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time
//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ //macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ #define
//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */ //MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined.
//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */ //MBEDTLS_HAVE_TIME must be enabled */ #define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**<
//Default fprintf macro to use, can be undefined */ #define MBEDTLS_PLATFORM_PRINTF_MACRO printf
///**< Default printf macro to use, can be undefined */
/* Note: your snprintf must correclty zero-terminate the buffer! */ /* Note: your snprintf must correclty zero-terminate the buffer! */
//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */ //#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be
//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ //undefined */ #define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**<
//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ //Default nv_seed_read function to use, can be undefined */ #define
//MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default
//nv_seed_write function to use, can be undefined */
/* SSL Cache options */ /* SSL Cache options */
//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */ //#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */ //#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
/* SSL options */ /* SSL options */
//#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */ //#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 /**< Maxium fragment length in bytes,
//#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */ //determines the size of each of the two internal I/O buffers */ #define
//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */ //MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ //#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes
//(default 256 bits) */ #define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay
//of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
/** /**
* Complete list of ciphersuites to use, in order of preference. * Complete list of ciphersuites to use, in order of preference.
@ -2663,11 +2676,13 @@
* *
* The value below is only an example, not the default. * The value below is only an example, not the default.
*/ */
//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 //#define MBEDTLS_SSL_CIPHERSUITES
//MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
/* X509 options */ /* X509 options */
//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */ //#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a
//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */ //verification chain. */ #define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a
//path/filename string in bytes including the null terminator character ('\0'). */
/** /**
* Allow SHA-1 in the default TLS configuration for certificate signing. * Allow SHA-1 in the default TLS configuration for certificate signing.
@ -2689,7 +2704,6 @@
*/ */
//#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE //#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE
#include "check_config.h" #include "check_config.h"
#endif /* MBEDTLS_LORA_CONFIG_H */ #endif /* MBEDTLS_LORA_CONFIG_H */
Loading…
Cancel
Save