Skip to content

Commit

Permalink
Release v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Antoine committed Jun 5, 2020
1 parent e0f8ebf commit e3625de
Show file tree
Hide file tree
Showing 119 changed files with 3,393 additions and 2,297 deletions.
22 changes: 16 additions & 6 deletions embedded/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ system/src/system_uart.c \
system/src/system_time.c \
system/src/system_lptim.c \
system/src/system.c \
lr1110_driver/src/lr1110_driver_version.c \
lr1110_driver/src/lr1110_bootloader.c \
lr1110_driver/src/lr1110_gnss.c \
lr1110_driver/src/lr1110_radio.c \
Expand All @@ -93,22 +94,33 @@ C_SOURCES += ${CSRCS}
# CPP sources
CPP_SOURCES = \
application/src/main.cpp \
application/src/gnss_helper.cpp \
application/src/timer_interface_implementation.cpp \
communication/src/communication_manager.cpp \
communication/src/communication_utils.cpp \
communication/src/communication_interface.cpp \
communication/src/communication_print_only.cpp \
communication/src/communication_demo.cpp \
communication/src/communication_field_test.cpp \
demo/src/environment_interface.cpp \
demo/src/demo_base.cpp \
demo/src/demo_transceiver_base.cpp \
demo/src/demo_wifi_interface.cpp \
demo/src/demo_wifi_scan.cpp \
demo/src/demo_wifi_country_code.cpp \
demo/src/demo_wifi_types.cpp \
demo/src/demo_gnss_autonomous.cpp \
demo/src/demo_gnss_base.cpp \
demo/src/demo_gnss_assisted.cpp\
demo/src/demo_ping_pong.cpp\
demo/src/demo_gnss_assisted.cpp \
demo/src/demo_radio_interface.cpp \
demo/src/demo_ping_pong.cpp \
demo/src/demo_tx_cw.cpp \
demo/src/demo_radio_per.cpp \
demo/src/demo.cpp\
demo/src/device_base.cpp \
demo/src/device_transceiver.cpp \
gui/src/gui.cpp \
gui/src/guiCommon.cpp \
gui/src/guiMenuCommon.cpp \
gui/src/guiMenu.cpp \
gui/src/guiMenuRadioTestModes.cpp \
gui/src/guiConfigRadioTestModes.cpp \
Expand All @@ -124,11 +136,9 @@ gui/src/guiTestGnss.cpp \
gui/src/guiTestWifi.cpp \
gui/src/guiConfigWifi.cpp \
gui/src/guiConfigGnss.cpp \
log/src/log.cpp \
supervisor/src/supervisor.cpp \
hci/hci.cpp \
hci/Command/Src/command_base.cpp \
hci/Command/Src/command_configure.cpp \
hci/Command/Src/command_factory.cpp \
hci/Command/Src/command_fetch_result.cpp \
hci/Command/Src/command_get_version.cpp \
Expand Down Expand Up @@ -204,6 +214,7 @@ AS_INCLUDES =
# C includes
C_INCLUDES = \
-Iapplication/inc \
-Icommunication/inc \
-ICMSIS/Device/ST/STM32L4xx/Include \
-ICMSIS/Core/Include \
-Idemo/inc \
Expand All @@ -218,7 +229,6 @@ C_INCLUDES = \
-Ilvgl/src/lv_objx \
-Ilvgl/src/lv_themes \
-Ilvgl/src \
-Ilog/inc \
-ISTM32L4xx_HAL_Driver/Inc \
-Isupervisor/inc \
-Isystem/inc \
Expand Down
2 changes: 1 addition & 1 deletion embedded/application/inc/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#ifndef DEMO_VERSION
#warning "No demo version provided"
#define DEMO_VERSION "v1.2.0"
#define DEMO_VERSION "v1.3.0"
#endif

typedef struct
Expand Down
67 changes: 45 additions & 22 deletions embedded/application/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
*/

#include "configuration.h"
#include "device_transceiver.h"
#include "lr1110_system.h"
#include "lr1110_wifi.h"
#include "system.h"

#include "supervisor.h"
#include "environment_interface.h"
#include "log.h"
#include "antenna_selector_interface.h"
#include "signaling_interface.h"
#include "timer_interface_implementation.h"
Expand All @@ -46,6 +46,17 @@
#include "string.h"
#include "demo.h"

#include "hci.h"
#include "command_factory.h"
#include "command_get_version.h"
#include "command_get_almanac_dates.h"
#include "command_start_demo.h"
#include "command_fetch_result.h"
#include "command_set_date_loc.h"
#include "command_reset.h"
#include "command_update_almanac.h"
#include "command_check_almanac_update.h"

#include "stm32_assert_template.h"

#include "lvgl.h"
Expand Down Expand Up @@ -208,35 +219,47 @@ int main( void )
lv_port_disp_init( );
lv_port_indev_init( );

Logging::EnableLogging( );
Environment environment;
AntennaSelector antenna_selector;
Signaling signaling( &environment );
Gui gui;
Timer timer;
DeviceTransceiver device_transceiver( &radio );

CommandFactory command_factory;
Hci hci( command_factory, environment );

CommunicationManager communication_manager( &environment, &hci );

Demo demo( &device_transceiver, &environment, &antenna_selector, &signaling, &timer, &communication_manager );

Environment environment;
AntennaSelector antenna_selector;
Signaling signaling( &environment );
Gui gui;
Timer timer;
Demo demo( &radio, &environment, &antenna_selector, &signaling, &timer );
CommandGetVersion com_get_version( hci );
CommandGetAlmanacDates com_get_almanac_dates( &device_transceiver, hci );
CommandStartDemo com_start( &device_transceiver, hci, demo );
CommandFetchResult com_fetch_result( hci, environment, demo );
CommandSetDateLoc com_set_date_loc( &device_transceiver, hci, environment );
CommandReset com_reset( &device_transceiver, hci );
CommandUpdateAlmanac com_update_almanac( &device_transceiver, hci );
CommandCheckAlmanacUpdate com_check_almanac_update( &device_transceiver, hci );

Supervisor supervisor( &gui, &radio, &demo, &environment );
command_factory.AddCommandToPool( com_get_version );
command_factory.AddCommandToPool( com_get_almanac_dates );
command_factory.AddCommandToPool( com_start );
command_factory.AddCommandToPool( com_fetch_result );
command_factory.AddCommandToPool( com_set_date_loc );
command_factory.AddCommandToPool( com_reset );
command_factory.AddCommandToPool( com_update_almanac );
command_factory.AddCommandToPool( com_check_almanac_update );

Supervisor supervisor( &gui, &device_transceiver, &demo, &environment, &communication_manager );
supervisor.Init( );
com_get_version.SetVersion( supervisor.GetVersionHandler( ) );

system_uart_flush( );

if( system_gpio_get_pin_state( { BUTTON_BLUE_PORT, BUTTON_BLUE_PIN } ) == SYSTEM_GPIO_PIN_STATE_LOW )
{
automatic_mode = true;
}

while( 1 )
{
signaling.Runtime( );
if( automatic_mode == true )
{
supervisor.RuntimeAuto( );
}
else
{
supervisor.Runtime( );
}
supervisor.Runtime( );
};
}
73 changes: 73 additions & 0 deletions embedded/communication/inc/communication_demo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* @file communication_demo.h
*
* @brief Definition of the communication demo.
*
* Revised BSD License
* Copyright Semtech Corporation 2020. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Semtech corporation nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef __COMMUNICATION_DEMO_H__
#define __COMMUNICATION_DEMO_H__

#include "communication_interface.h"

typedef enum
{
COMMUNICATION_DEMO_STATUS_OK,
COMMUNICATION_DEMO_STATUS_TIMEOUT,
COMMUNICATION_DEMO_STATUS_OVERFLOW,
COMMUNICATION_DEMO_STATUS_DISABLED,
} CommunicationDemoStatus_t;

class CommunicationDemo : public CommunicationInterface
{
public:
virtual void Runtime( ) override;
virtual bool GetDateAndApproximateLocation( uint32_t& gps_second, float& latitude, float& longitude,
float& altitude ) override;
virtual bool GetResults( float& latitude, float& longitude, float& altitude, float& accuracy, char* geo_coding,
const uint8_t geo_coding_max_length );
virtual void Store( const demo_wifi_scan_all_results_t& wifi_results );
virtual void Store( const demo_gnss_all_results_t& gnss_results, uint32_t delay_since_capture );
virtual void Store( const version_handler_t& version );
virtual void EraseDataStored( ) override;
virtual void SendDataStoredToServer( ) override;
virtual void vLog( const char* fmt, va_list argp ) override;
virtual bool HasNewCommand( ) const override;
virtual CommandInterface* FetchCommand( ) override;

protected:
CommunicationDemoStatus_t AskAndParseResults( float& latitude, float& longitude, float& altitude, float& accuracy,
char* geo_coding, const uint8_t geo_coding_max_length );
CommunicationDemoStatus_t ReceiveData( const uint16_t buffer_length_max, char* buffer,
uint16_t& buffer_length_received, const uint16_t timeout );
CommunicationDemoStatus_t AskData( const char* token, const uint16_t buffer_length_max, char* buffer,
uint16_t& buffer_length_received, const uint16_t timeout );
void SendCommand( const char* command );
void Store( const char* fmt, ... );
};

#endif // __COMMUNICATION_DEMO_H__
66 changes: 66 additions & 0 deletions embedded/communication/inc/communication_field_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* @file communication_field_test.h
*
* @brief Definition of the communication field test.
*
* Revised BSD License
* Copyright Semtech Corporation 2020. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Semtech corporation nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef __COMMUNICATION_FIELD_TEST_H__
#define __COMMUNICATION_FIELD_TEST_H__

#include "communication_interface.h"
#include "environment_interface.h"
#include "hci.h"

class CommunicationFieldTest : public CommunicationInterface
{
public:
explicit CommunicationFieldTest( Hci* hci );
virtual ~CommunicationFieldTest( );

virtual void Init( ) override;
virtual void DeInit( ) override;
virtual void Runtime( ) override;
virtual void Store( const demo_wifi_scan_all_results_t& wifi_results ) override;
virtual void Store( const demo_gnss_all_results_t& gnss_results, uint32_t delay_since_capture ) override;
virtual void Store( const version_handler_t& version ) override;
virtual void EraseDataStored( ) override;
virtual void SendDataStoredToServer( ) override;
virtual bool GetDateAndApproximateLocation( uint32_t& gps_second, float& latitude, float& longitude,
float& altitude ) override;
virtual bool GetResults( float& latitude, float& longitude, float& altitude, float& accuracy, char* geo_coding,
const uint8_t geo_coding_max_length ) override;
virtual void vLog( const char* fmt, va_list argp ) override;
virtual void EventNotify( ) override;
virtual bool HasNewCommand( ) const override;
virtual CommandInterface* FetchCommand( ) override;

protected:
Hci* hci;
};

#endif // __COMMUNICATION_FIELD_TEST_H__
67 changes: 67 additions & 0 deletions embedded/communication/inc/communication_interface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* @file communication_interface.h
*
* @brief Definition of the communication interface.
*
* Revised BSD License
* Copyright Semtech Corporation 2020. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Semtech corporation nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef __COMMUNICATION_INTERFACE_H__
#define __COMMUNICATION_INTERFACE_H__

#include <stdarg.h>
#include "command_interface.h"
#include "version.h"
#include "demo_wifi_types.h"
#include "demo_gnss_types.h"

class CommunicationInterface
{
public:
virtual ~CommunicationInterface( );
virtual void Init( ){};
virtual void DeInit( ){};
virtual void Runtime( ) = 0;
virtual void Log( const char* fmt, ... );
virtual void vLog( const char* fmt, va_list argp ) = 0;
virtual void Store( const demo_wifi_scan_all_results_t& wifi_results ) = 0;
virtual void Store( const demo_gnss_all_results_t& gnss_results, uint32_t delay_since_capture ) = 0;
virtual void Store( const version_handler_t& version ) = 0;
virtual void EraseDataStored( ) = 0;
virtual void SendDataStoredToServer( ) = 0;
virtual bool GetDateAndApproximateLocation( uint32_t& gps_second, float& latitude, float& longitude,
float& altitude ) = 0;
virtual bool GetResults( float& latitude, float& longitude, float& altitude, float& accuracy, char* geo_coding,
const uint8_t geo_coding_max_length ) = 0;
virtual void EventNotify( );
virtual bool HasNewCommand( ) const = 0;
virtual CommandInterface* FetchCommand( ) = 0;

protected:
static const char* WifiTypeToStr( const demo_wifi_signal_type_t type );
};

#endif // __COMMUNICATION_INTERFACE_H__
Loading

0 comments on commit e3625de

Please sign in to comment.