diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 3c49a61..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Project Packages - -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - #this doesn't do much for now, but for consistency.... - - name: Setup Projects - run: | - bash -x ./scripts/setup-project.sh - - - name: Copy Supporting Docs and Licenses - run: | - cp README.md LICENSE samples/ - - #use wildcards so that directory path is preserved. - - name: Publish Artifacts - uses: actions/upload-artifact@v2 - with: - name: iotc-modustoolbox-sdk - path: sample*/* - diff --git a/iotc-modustoolbox-sdk/mtb-layer/include/iotc_http_client.h b/include/iotc_http_client.h similarity index 100% rename from iotc-modustoolbox-sdk/mtb-layer/include/iotc_http_client.h rename to include/iotc_http_client.h diff --git a/iotc-modustoolbox-sdk/mtb-layer/include/iotc_mqtt_client.h b/include/iotc_mqtt_client.h similarity index 100% rename from iotc-modustoolbox-sdk/mtb-layer/include/iotc_mqtt_client.h rename to include/iotc_mqtt_client.h diff --git a/iotc-modustoolbox-sdk/mtb-layer/include/iotc_mtb_time.h b/include/iotc_mtb_time.h similarity index 100% rename from iotc-modustoolbox-sdk/mtb-layer/include/iotc_mtb_time.h rename to include/iotc_mtb_time.h diff --git a/iotc-modustoolbox-sdk/include/iotconnect.h b/include/iotconnect.h similarity index 100% rename from iotc-modustoolbox-sdk/include/iotconnect.h rename to include/iotconnect.h diff --git a/iotc-modustoolbox-sdk/cert/iotconnect_certs.h b/include/iotconnect_certs.h similarity index 100% rename from iotc-modustoolbox-sdk/cert/iotconnect_certs.h rename to include/iotconnect_certs.h diff --git a/iotc-modustoolbox-sdk/mtb-layer/include/sntp.h b/include/sntp.h similarity index 100% rename from iotc-modustoolbox-sdk/mtb-layer/include/sntp.h rename to include/sntp.h diff --git a/manifests/avnet-app-manifest-fv2.xml b/manifests/avnet-app-manifest-fv2.xml deleted file mode 100644 index 87f5504..0000000 --- a/manifests/avnet-app-manifest-fv2.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - Avnet basic sample - mtb-avnet-basic-example - Wi-Fi - https://github.com/avnet-iotconnect/iotc-modustoolbox-sdk/tree/main/samples/basic-sample -
For more details, see the README on GitHub. -

License Disclaimer:

- This code example makes use of the lwIP open-source TCP/IP stack. Creating a project from this template will cause lwIP to be downloaded on your computer. It is your responsibility to understand and accept the lwIP license.

Creating a project from this template will cause Mbed TLS to be downloaded on your computer. It is your responsibility to understand and accept the Mbed TLS license and regional use restrictions (including abiding by all applicable export control laws).]]>
- psoc6 wifi cyw43xxx led switch - - - v1.0.0 - v1.0.0 - - -
-
\ No newline at end of file diff --git a/manifests/avnet-mw-manifest-fv2.xml b/manifests/avnet-mw-manifest-fv2.xml deleted file mode 100644 index 41088b1..0000000 --- a/manifests/avnet-mw-manifest-fv2.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - iotc-modustoolbox-sdk - iotc-modustoolbox-sdk - https://github.com/avnet-iotconnect/iotc-modustoolbox-sdk - This SDK is used for Connecting to Avnet IoTConnect platform. - Middleware - cat1 - - - v1.0.0 - v1.0.0 - release-v1.0.0 - - - - - iotc-c-lib - iotc-c-lib - https://github.com/avnet-iotconnect/iotc-c-lib - iotc-c-lib - Middleware - cat1 - - - v2.0.5 - v2.0.5 - release-v2.0.5 - - - - - cJSON - cJSON - https://github.com/DaveGamble/cJSON - cJSON lib - Middleware - cat1 - - - v1.7.15 - v1.7.15 - release-v1.7.15 - - - - \ No newline at end of file diff --git a/manifests/avnet-super-manifest-fv2.xml b/manifests/avnet-super-manifest-fv2.xml deleted file mode 100644 index 608fd04..0000000 --- a/manifests/avnet-super-manifest-fv2.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - https://github.com/Infineon/mtb-bsp-manifest/raw/v2.X/mtb-bsp-manifest.xml - - - https://github.com/Infineon/mtb-bsp-manifest/raw/v2.X/mtb-bsp-manifest-fv2.xml - - - https://github.com/Infineon/mtb-bt-bsp-manifest/raw/v2.X/mtb-bt-bsp-manifest.xml - - - https://github.com/Infineon/mtb-bt-bsp-manifest/raw/v2.X/mtb-bt-bsp-manifest-fv2.xml - - - - - https://raw.githubusercontent.com/avnet-iotconnect/iotc-modustoolbox-sdk/manifest-test/manifests/avnet-app-manifest-fv2.xml - - - - - https://github.com/Infineon/mtb-mw-manifest/raw/v2.X/mtb-mw-manifest.xml - - - https://github.com/Infineon/mtb-mw-manifest/raw/v2.X/mtb-mw-manifest-fv2.xml - - - https://github.com/Infineon/mtb-wifi-mw-manifest/raw/v2.X/mtb-wifi-mw-manifest.xml - - - https://github.com/Infineon/mtb-wifi-mw-manifest/raw/v2.X/mtb-wifi-mw-manifest-fv2.xml - - - https://raw.githubusercontent.com/avnet-iotconnect/iotc-modustoolbox-sdk/manifest-test/manifests/avnet-mw-manifest-fv2.xml - - - \ No newline at end of file diff --git a/samples/basic-sample/.cproject b/samples/basic-sample/.cproject deleted file mode 100644 index f41db23..0000000 --- a/samples/basic-sample/.cproject +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/basic-sample/.project b/samples/basic-sample/.project deleted file mode 100644 index 18b71d4..0000000 --- a/samples/basic-sample/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - basic-sample - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - com.cypress.studio.app.cymodusnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/samples/basic-sample/Makefile b/samples/basic-sample/Makefile deleted file mode 100644 index 435c666..0000000 --- a/samples/basic-sample/Makefile +++ /dev/null @@ -1,209 +0,0 @@ -################################################################################ -# \file Makefile -# \version 1.0 -# -# \brief -# Top-level application make file. -# -################################################################################ -# \copyright -# Copyright 2018-2021, Cypress Semiconductor Corporation (an Infineon company) -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -################################################################################ - - -################################################################################ -# Basic Configuration -################################################################################ - -# Target board/hardware (BSP). -# To change the target, it is recommended to use the Library manager -# ('make modlibs' from command line), which will also update Eclipse IDE launch -# configurations. If TARGET is manually edited, ensure TARGET_.mtb with a -# valid URL exists in the application, run 'make getlibs' to fetch BSP contents -# and update or regenerate launch configurations for your IDE. -TARGET=CY8CKIT-062-WIFI-BT - -# Name of application (used to derive name of final linked file). -# -# If APPNAME is edited, ensure to update or regenerate launch -# configurations for your IDE. -APPNAME=basic-sample - -# Name of toolchain to use. Options include: -# -# GCC_ARM -- GCC provided with ModusToolbox IDE -# ARM -- ARM Compiler (must be installed separately) -# IAR -- IAR Compiler (must be installed separately) -# -# See also: CY_COMPILER_PATH below -TOOLCHAIN=GCC_ARM - -# Default build configuration. Options include: -# -# Debug -- build with minimal optimizations, focus on debugging. -# Release -- build with full optimizations -# Custom -- build with custom configuration, set the optimization flag in CFLAGS -# -# If CONFIG is manually edited, ensure to update or regenerate launch configurations -# for your IDE. -CONFIG=Debug - -# If set to "true" or "1", display full command-lines when building. -VERBOSE= - -################################################################################ -# Advanced Configuration -################################################################################ - -# Enable optional code that is ordinarily disabled by default. -# -# Available components depend on the specific targeted hardware and firmware -# in use. In general, if you have -# -# COMPONENTS=foo bar -# -# ... then code in directories named COMPONENT_foo and COMPONENT_bar will be -# added to the build -# -COMPONENTS=FREERTOS LWIP MBEDTLS SECURE_SOCKETS RTOS_AWARE - -# Like COMPONENTS, but disable optional code that was enabled by default. -DISABLE_COMPONENTS= - -# By default the build system automatically looks in the Makefile's directory -# tree for source code and builds it. The SOURCES variable can be used to -# manually add source code to the build process from a location not searched -# by default, or otherwise not found by the build system. -SOURCES= - -# Like SOURCES, but for include directories. Value should be paths to -# directories (without a leading -I). -INCLUDES=./configs - -# Custom configuration of mbedtls library. -MBEDTLSFLAGS = MBEDTLS_USER_CONFIG_FILE='"mbedtls_user_config.h"' - -# Turn off making tests for CJSON -CJSONFLAGS = ENABLE_CJSON_TEST=Off ENABLE_CJSON_UTILS=Off - -# Add additional defines to the build process (without a leading -D). -DEFINES=$(MBEDTLSFLAGS) $(CJSONFLAGS) CYBSP_WIFI_CAPABLE CY_RETARGET_IO_CONVERT_LF_TO_CRLF - -# for http client -DEFINES+=ENABLE_HTTP_CLIENT_LOGS HTTP_DO_NOT_USE_CUSTOM_CONFIG MQTT_DO_NOT_USE_CUSTOM_CONFIG - -# for sntp -DEFINES+=SNTP_SERVER_DNS - - -# CY8CPROTO-062-4343W board shares the same GPIO for the user button (USER BTN1) -# and the CYW4343W host wake up pin. Since this example uses the GPIO for -# interfacing with the user button, the SDIO interrupt to wake up the host is -# disabled by setting CY_WIFI_HOST_WAKE_SW_FORCE to '0'. -ifeq ($(TARGET), CY8CPROTO-062-4343W) -DEFINES+=CY_WIFI_HOST_WAKE_SW_FORCE=0 -endif - -# Select softfp or hardfp floating point. Default is softfp. -VFP_SELECT= - -# Additional / custom C compiler flags. -# -# NOTE: Includes and defines should use the INCLUDES and DEFINES variable -# above. -CFLAGS= - -# Additional / custom C++ compiler flags. -# -# NOTE: Includes and defines should use the INCLUDES and DEFINES variable -# above. -CXXFLAGS= - -# Additional / custom assembler flags. -# -# NOTE: Includes and defines should use the INCLUDES and DEFINES variable -# above. -ASFLAGS= - -# Additional / custom linker flags. -LDFLAGS= - -# Additional / custom libraries to link in to the application. -LDLIBS= - -# Path to the linker script to use (if empty, use the default linker script). -LINKER_SCRIPT= - -# Custom pre-build commands to run. -PREBUILD= - -# Custom post-build commands to run. -POSTBUILD= - - -################################################################################ -# Paths -################################################################################ - -# Relative path to the project directory (default is the Makefile's directory). -# -# This controls where automatic source code discovery looks for code. -CY_APP_PATH= - -# Relative path to the shared repo location. -# -# All .mtb files have the format, ##. If the field -# begins with $$ASSET_REPO$$, then the repo is deposited in the path specified by -# the CY_GETLIBS_SHARED_PATH variable. The default location is one directory level -# above the current app directory. -# This is used with CY_GETLIBS_SHARED_NAME variable, which specifies the directory name. -CY_GETLIBS_SHARED_PATH=../ - -# Directory name of the shared repo location. -# -CY_GETLIBS_SHARED_NAME=mtb_shared - -# Absolute path to the compiler's "bin" directory. -# -# The default depends on the selected TOOLCHAIN (GCC_ARM uses the ModusToolbox -# IDE provided compiler by default). -CY_COMPILER_PATH= - - -# Locate ModusToolbox IDE helper tools folders in default installation -# locations for Windows, Linux, and macOS. -CY_WIN_HOME=$(subst \,/,$(USERPROFILE)) -CY_TOOLS_PATHS ?= $(wildcard \ - $(CY_WIN_HOME)/ModusToolbox/tools_* \ - $(HOME)/ModusToolbox/tools_* \ - /Applications/ModusToolbox/tools_*) - -# If you install ModusToolbox IDE in a custom location, add the path to its -# "tools_X.Y" folder (where X and Y are the version number of the tools -# folder). Make sure you use forward slashes. -CY_TOOLS_PATHS+= - -# Default to the newest installed tools folder, or the users override (if it's -# found). -CY_TOOLS_DIR=$(lastword $(sort $(wildcard $(CY_TOOLS_PATHS)))) - -ifeq ($(CY_TOOLS_DIR),) -$(error Unable to find any of the available CY_TOOLS_PATHS -- $(CY_TOOLS_PATHS). On Windows, use forward slashes.) -endif - -$(info Tools Directory: $(CY_TOOLS_DIR)) - -include $(CY_TOOLS_DIR)/make/start.mk diff --git a/samples/basic-sample/configs/FreeRTOSConfig.h b/samples/basic-sample/configs/FreeRTOSConfig.h deleted file mode 100644 index 666fe05..0000000 --- a/samples/basic-sample/configs/FreeRTOSConfig.h +++ /dev/null @@ -1,276 +0,0 @@ -/****************************************************************************** -* File Name: FreeRTOSConfig.h -* -* Description: This file contains the FreeRTOS configuration macros. -* -* Related Document: See README.md -* -* -******************************************************************************* -* Copyright 2020-2021, Cypress Semiconductor Corporation (an Infineon company) or -* an affiliate of Cypress Semiconductor Corporation. All rights reserved. -* -* This software, including source code, documentation and related -* materials ("Software") is owned by Cypress Semiconductor Corporation -* or one of its affiliates ("Cypress") and is protected by and subject to -* worldwide patent protection (United States and foreign), -* United States copyright laws and international treaty provisions. -* Therefore, you may use this Software only as provided in the license -* agreement accompanying the software package from which you -* obtained this Software ("EULA"). -* If no EULA applies, Cypress hereby grants you a personal, non-exclusive, -* non-transferable license to copy, modify, and compile the Software -* source code solely for use in connection with Cypress's -* integrated circuit products. Any reproduction, modification, translation, -* compilation, or representation of this Software except as specified -* above is prohibited without the express written permission of Cypress. -* -* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress -* reserves the right to make changes to the Software without notice. Cypress -* does not assume any liability arising out of the application or use of the -* Software or any product or circuit described in the Software. Cypress does -* not authorize its products for use in any products where a malfunction or -* failure of the Cypress product may reasonably be expected to result in -* significant property damage, injury or death ("High Risk Product"). By -* including Cypress's product in a High Risk Product, the manufacturer -* of such system or application assumes all risk of such use and in doing -* so agrees to indemnify Cypress against all liability. -*******************************************************************************/ - -/****************************************************************************** - * FreeRTOS Kernel V10.3.1 - * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * Copyright (C) 2019-2020 Cypress Semiconductor Corporation, or a subsidiary of - * Cypress Semiconductor Corporation. All Rights Reserved. - * - * Updated configuration to support PSoC 6 MCU. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - * http://www.cypress.com - * - ******************************************************************************/ - - -#ifndef FREERTOS_CONFIG_H -#define FREERTOS_CONFIG_H - -/*----------------------------------------------------------- - * Application specific definitions. - * - * These definitions should be adjusted for your particular hardware and - * application requirements. - * - * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. - * - * See http://www.freertos.org/a00110.html. - *----------------------------------------------------------*/ - -#include "cy_utils.h" -#include "cy_syslib.h" - -/* Get the low power configuration parameters from - * the ModusToolbox Device Configurator GeneratedSource: - * CY_CFG_PWR_SYS_IDLE_MODE - System Idle Power Mode - * CY_CFG_PWR_DEEPSLEEP_LATENCY - Deep Sleep Latency (ms) - */ -#include "cycfg_system.h" - -#define configUSE_PREEMPTION 1 -#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 -#define configCPU_CLOCK_HZ SystemCoreClock -#define configTICK_RATE_HZ 1000u -#define configMAX_PRIORITIES 7 -#define configMINIMAL_STACK_SIZE 128 -#define configMAX_TASK_NAME_LEN 16 -#define configUSE_16_BIT_TICKS 0 -#define configIDLE_SHOULD_YIELD 1 -#define configUSE_TASK_NOTIFICATIONS 1 -#define configUSE_MUTEXES 1 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configQUEUE_REGISTRY_SIZE 10 -#define configUSE_QUEUE_SETS 0 -#define configUSE_TIME_SLICING 1 -#define configENABLE_BACKWARD_COMPATIBILITY 0 -#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 16 - -/* Memory allocation related definitions. */ -#define configSUPPORT_STATIC_ALLOCATION 1 -#define configSUPPORT_DYNAMIC_ALLOCATION 1 -#define configTOTAL_HEAP_SIZE 10240 -#define configAPPLICATION_ALLOCATED_HEAP 0 - -/* Hook function related definitions. */ -#define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 0 -#define configCHECK_FOR_STACK_OVERFLOW 2 -#define configUSE_MALLOC_FAILED_HOOK 1 -#define configUSE_DAEMON_TASK_STARTUP_HOOK 0 - -/* Run time and task stats gathering related definitions. */ -#define configGENERATE_RUN_TIME_STATS 0 -#define configUSE_TRACE_FACILITY 1 -#define configUSE_STATS_FORMATTING_FUNCTIONS 0 - -/* Co-routine related definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES 2 - -/* Software timer related definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY 2 -#define configTIMER_QUEUE_LENGTH 10 -#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) - -/* -Interrupt nesting behavior configuration. -This is explained here: http://www.freertos.org/a00110.html - -Priorities are controlled by two macros: -- configKERNEL_INTERRUPT_PRIORITY determines the priority of the RTOS daemon task -- configMAX_API_CALL_INTERRUPT_PRIORITY dictates the priority of ISRs that make API calls - -Notes: -1. Interrupts that do not call API functions should be >= configKERNEL_INTERRUPT_PRIORITY - and will nest. -2. Interrupts that call API functions must have priority between KERNEL_INTERRUPT_PRIORITY - and MAX_API_CALL_INTERRUPT_PRIORITY (inclusive). -3. Interrupts running above MAX_API_CALL_INTERRUPT_PRIORITY are never delayed by the OS. -*/ -/* -PSoC 6 __NVIC_PRIO_BITS = 3 - -0 (high) -1 MAX_API_CALL_INTERRUPT_PRIORITY 001xxxxx (0x3F) -2 -3 -4 -5 -6 -7 (low) KERNEL_INTERRUPT_PRIORITY 111xxxxx (0xFF) - -!!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! -See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html - -*/ - -/* Put KERNEL_INTERRUPT_PRIORITY in top __NVIC_PRIO_BITS bits of CM4 register */ -#define configKERNEL_INTERRUPT_PRIORITY 0xFF -/* -Put MAX_SYSCALL_INTERRUPT_PRIORITY in top __NVIC_PRIO_BITS bits of CM4 register -NOTE For IAR compiler make sure that changes of this macro is reflected in -file portable\TOOLCHAIN_IAR\COMPONENT_CM4\portasm.s in PendSV_Handler: routine -*/ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY 0x3F -/* configMAX_API_CALL_INTERRUPT_PRIORITY is a new name for configMAX_SYSCALL_INTERRUPT_PRIORITY - that is used by newer ports only. The two are equivalent. */ -#define configMAX_API_CALL_INTERRUPT_PRIORITY configMAX_SYSCALL_INTERRUPT_PRIORITY - - -/* Set the following definitions to 1 to include the API function, or zero -to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_xResumeFromISR 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 0 -#define INCLUDE_xTaskGetIdleTaskHandle 0 -#define INCLUDE_eTaskGetState 0 -#define INCLUDE_xEventGroupSetBitFromISR 1 -#define INCLUDE_xTimerPendFunctionCall 1 -#define INCLUDE_xTaskAbortDelay 0 -#define INCLUDE_xTaskGetHandle 0 -#define INCLUDE_xTaskResumeFromISR 1 - -/* Normal assert() semantics without relying on the provision of an assert.h -header file. */ -#if defined(NDEBUG) -#define configASSERT( x ) CY_UNUSED_PARAMETER( x ) -#else -#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); CY_HALT(); } -#endif - -/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS -standard names - or at least those used in the unmodified vector table. */ -#define vPortSVCHandler SVC_Handler -#define xPortPendSVHandler PendSV_Handler -#define xPortSysTickHandler SysTick_Handler - -/* Dynamic Memory Allocation Schemes */ -#define HEAP_ALLOCATION_TYPE1 (1) /* heap_1.c*/ -#define HEAP_ALLOCATION_TYPE2 (2) /* heap_2.c*/ -#define HEAP_ALLOCATION_TYPE3 (3) /* heap_3.c*/ -#define HEAP_ALLOCATION_TYPE4 (4) /* heap_4.c*/ -#define HEAP_ALLOCATION_TYPE5 (5) /* heap_5.c*/ -#define NO_HEAP_ALLOCATION (0) - -#define configHEAP_ALLOCATION_SCHEME (HEAP_ALLOCATION_TYPE3) - -/* Check if the ModusToolbox Device Configurator Power personality parameter - * "System Idle Power Mode" is set to either "CPU Sleep" or "System Deep Sleep". - */ -#if defined(CY_CFG_PWR_SYS_IDLE_MODE) && \ - ((CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_SLEEP) || \ - (CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_DEEPSLEEP)) - -/* Enable low power tickless functionality. The RTOS abstraction library - * provides the compatible implementation of the vApplicationSleep hook: - * https://github.com/cypresssemiconductorco/abstraction-rtos#freertos - * The Low Power Assistant library provides additional portable configuration layer - * for low-power features supported by the PSoC 6 devices: - * https://github.com/cypresssemiconductorco/lpa - */ -extern void vApplicationSleep( uint32_t xExpectedIdleTime ); -#define portSUPPRESS_TICKS_AND_SLEEP( xIdleTime ) vApplicationSleep( xIdleTime ) -#define configUSE_TICKLESS_IDLE 2 - -#else -#define configUSE_TICKLESS_IDLE 0 -#endif - -/* Deep Sleep Latency Configuration */ -#if( CY_CFG_PWR_DEEPSLEEP_LATENCY > 0 ) -#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP CY_CFG_PWR_DEEPSLEEP_LATENCY -#endif - -/* Allocate newlib reeentrancy structures for each RTOS task. - * The system behavior is toolchain-specific. - * - * GCC toolchain: the application must provide the implementation for the required - * newlib hook functions: __malloc_lock, __malloc_unlock, __env_lock, __env_unlock. - * FreeRTOS-compatible implementation is provided by the clib-support library: - * https://github.com/cypresssemiconductorco/clib-support - * - * ARM/IAR toolchains: the application must provide the reent.h header to adapt - * FreeRTOS's configUSE_NEWLIB_REENTRANT to work with the toolchain-specific C library. - * The compatible implementations are also provided by the clib-support library. - */ -#define configUSE_NEWLIB_REENTRANT 1 - -#endif /* FREERTOS_CONFIG_H */ diff --git a/samples/basic-sample/configs/app_config.h b/samples/basic-sample/configs/app_config.h deleted file mode 100644 index 0fe34d1..0000000 --- a/samples/basic-sample/configs/app_config.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// Copyright: Avnet, Softweb Inc. 2020 -// Modified by Nik Markovic on 6/15/20. -// - -#ifndef APP_CONFIG_H -#define APP_CONFIG_H - -#include "iotconnect.h" - -#define IOTCONNECT_CPID "your-cpidd" -#define IOTCONNECT_ENV "your-environment" - -// Device Unique ID -#define IOTCONNECT_DUID "device-id" - -// from iotconnect.h IotConnectAuthType -#define IOTCONNECT_AUTH_TYPE IOTC_AT_X509 - -// PEM format certificate and private key, if using X509 type auth. -// For example: -#define IOTCONNECT_DEVICE_CERT \ -"-----BEGIN CERTIFICATE-----\n"\ -"...\n"\ -"-----END CERTIFICATE-----" - -#define IOTCONNECT_DEVICE_KEY \ -"-----BEGIN RSA PRIVATE KEY-----\n"\ -"...\n"\ -"-----END RSA PRIVATE KEY-----" - -// you can choose to use your own NTP server to obtain network time, or simply time.google.com for better stability -#define IOTCONNECT_SNTP_SERVER "pool.ntp.org" - -#endif // APP_CONFIG_H diff --git a/samples/basic-sample/configs/core_mqtt_config.h b/samples/basic-sample/configs/core_mqtt_config.h deleted file mode 100644 index b78eecb..0000000 --- a/samples/basic-sample/configs/core_mqtt_config.h +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* File Name: core_mqtt_config.h -* -* Description: This file contains the configuration macros for the MQTT library. -* -* Related Document: See README.md -* -* -******************************************************************************* -* Copyright 2020-2021, Cypress Semiconductor Corporation (an Infineon company) or -* an affiliate of Cypress Semiconductor Corporation. All rights reserved. -* -* This software, including source code, documentation and related -* materials ("Software") is owned by Cypress Semiconductor Corporation -* or one of its affiliates ("Cypress") and is protected by and subject to -* worldwide patent protection (United States and foreign), -* United States copyright laws and international treaty provisions. -* Therefore, you may use this Software only as provided in the license -* agreement accompanying the software package from which you -* obtained this Software ("EULA"). -* If no EULA applies, Cypress hereby grants you a personal, non-exclusive, -* non-transferable license to copy, modify, and compile the Software -* source code solely for use in connection with Cypress's -* integrated circuit products. Any reproduction, modification, translation, -* compilation, or representation of this Software except as specified -* above is prohibited without the express written permission of Cypress. -* -* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress -* reserves the right to make changes to the Software without notice. Cypress -* does not assume any liability arising out of the application or use of the -* Software or any product or circuit described in the Software. Cypress does -* not authorize its products for use in any products where a malfunction or -* failure of the Cypress product may reasonably be expected to result in -* significant property damage, injury or death ("High Risk Product"). By -* including Cypress's product in a High Risk Product, the manufacturer -* of such system or application assumes all risk of such use and in doing -* so agrees to indemnify Cypress against all liability. -*******************************************************************************/ - -#ifndef CORE_MQTT_CONFIG_H_ -#define CORE_MQTT_CONFIG_H_ - -/** - * @brief Determines the maximum number of MQTT PUBLISH messages, pending - * acknowledgement at a time, that are supported for incoming and outgoing - * direction of messages, separately. - * - * QoS 1 and 2 MQTT PUBLISH packets require acknowledgement from the server before - * they can be completed. While they are awaiting the acknowledgement, the - * client must maintain information about their state. The value of this - * macro sets the limit on how many simultaneous PUBLISH states an MQTT - * context maintains, separately, for both incoming and outgoing direction of - * PUBLISH packets. - * - * @note This definition must exist in order to compile. 10U is a typical value - * used in the MQTT demos. - */ -#define MQTT_STATE_ARRAY_MAX_COUNT ( 10U ) - -/** - * @brief Retry the count for reading CONNACK from the network. - * - * MQTT_MAX_CONNACK_RECEIVE_RETRY_COUNT will be used only when the - * timeoutMs parameter of #MQTT_Connect() is passed as 0. The transport - * receive for CONNACK will be retried MQTT_MAX_CONNACK_RECEIVE_RETRY_COUNT - * times before timing out. A value of 0 for this config will cause the - * transport receive for CONNACK to be invoked only once. - */ -#define MQTT_MAX_CONNACK_RECEIVE_RETRY_COUNT ( 2U ) - -/** - * @brief Number of milliseconds to wait for a ping response to a ping - * request as part of the keepalive mechanism. - * - * If a ping response is not received before this timeout, - * #MQTT_ProcessLoop will return #MQTTKeepAliveTimeout. - */ -#define MQTT_PINGRESP_TIMEOUT_MS ( 5000U ) - -#endif /* ifndef CORE_MQTT_CONFIG_H_ */ diff --git a/samples/basic-sample/configs/mbedtls_user_config.h b/samples/basic-sample/configs/mbedtls_user_config.h deleted file mode 100644 index c357a00..0000000 --- a/samples/basic-sample/configs/mbedtls_user_config.h +++ /dev/null @@ -1,790 +0,0 @@ -/** - * \file config.h - * - * \brief Configuration options (set of defines) - * - * This set of compile-time options may be used to enable - * or disable features selectively, and reduce the global - * memory footprint. - */ -/* - * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_USER_CONFIG_HEADER -#define MBEDTLS_USER_CONFIG_HEADER - - -/** - * \def MBEDTLS_HAVE_TIME_DATE - * - * System has time.h, time(), and an implementation for - * mbedtls_platform_gmtime_r() (see below). - * The time needs to be correct (not necessarily very accurate, but at least - * the date should be correct). This is used to verify the validity period of - * X.509 certificates. - * - * Comment if your system does not have a correct clock. - * - * \note mbedtls_platform_gmtime_r() is an abstraction in platform_util.h that - * behaves similarly to the gmtime_r() function from the C standard. Refer to - * the documentation for mbedtls_platform_gmtime_r() for more information. - * - * \note It is possible to configure an implementation for - * mbedtls_platform_gmtime_r() at compile-time by using the macro - * MBEDTLS_PLATFORM_GMTIME_R_ALT. - */ -#undef MBEDTLS_HAVE_TIME_DATE - - -/** - * \def MBEDTLS_PLATFORM_EXIT_ALT - * - * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the - * function in the platform abstraction layer. - * - * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will - * provide a function "mbedtls_platform_set_printf()" that allows you to set an - * alternative printf function pointer. - * - * All these define require MBEDTLS_PLATFORM_C to be defined! - * - * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows; - * it will be enabled automatically by check_config.h - * - * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as - * MBEDTLS_PLATFORM_XXX_MACRO! - * - * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME - * - * Uncomment a macro to enable alternate implementation of specific base - * platform function - */ -//#define MBEDTLS_PLATFORM_EXIT_ALT -#define MBEDTLS_PLATFORM_TIME_ALT -//#define MBEDTLS_PLATFORM_FPRINTF_ALT -//#define MBEDTLS_PLATFORM_PRINTF_ALT -//#define MBEDTLS_PLATFORM_SNPRINTF_ALT -//#define MBEDTLS_PLATFORM_NV_SEED_ALT -//#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT - -/** - * \def MBEDTLS_ENTROPY_HARDWARE_ALT - * - * Uncomment this macro to let mbed TLS use your own implementation of a - * hardware entropy collector. - * - * Your function must be called \c mbedtls_hardware_poll(), have the same - * prototype as declared in entropy_poll.h, and accept NULL as first argument. - * - * Uncomment to use your own hardware entropy collector. - */ -#define MBEDTLS_ENTROPY_HARDWARE_ALT -/** - * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED - * - * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve - * module. By default all supported curves are enabled. - * - * Comment macros to disable the curve and functions for it - */ -#undef MBEDTLS_ECP_DP_SECP192R1_ENABLED -#undef MBEDTLS_ECP_DP_SECP224R1_ENABLED -//#define MBEDTLS_ECP_DP_SECP256R1_ENABLED -#undef MBEDTLS_ECP_DP_SECP384R1_ENABLED -#undef MBEDTLS_ECP_DP_SECP521R1_ENABLED -#undef MBEDTLS_ECP_DP_SECP192K1_ENABLED -#undef MBEDTLS_ECP_DP_SECP224K1_ENABLED -#undef MBEDTLS_ECP_DP_SECP256K1_ENABLED -#undef MBEDTLS_ECP_DP_BP256R1_ENABLED -#undef MBEDTLS_ECP_DP_BP384R1_ENABLED -//#undef MBEDTLS_ECP_DP_BP512R1_ENABLED -//#undef MBEDTLS_ECP_DP_CURVE25519_ENABLED -#undef MBEDTLS_ECP_DP_CURVE448_ENABLED - -#define MBEDTLS_ECP_DP_BP512R1_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - * - * Enable the PSK based ciphersuite modes in SSL / TLS. - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - */ -#undef MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - - -/** - * \def MBEDTLS_PK_PARSE_EC_EXTENDED - * - * Enhance support for reading EC keys using variants of SEC1 not allowed by - * RFC 5915 and RFC 5480. - * - * Currently this means parsing the SpecifiedECDomain choice of EC - * parameters (only known groups are supported, not arbitrary domains, to - * avoid validation issues). - * - * Disable if you only need to support RFC 5915 + 5480 key formats. - */ -#undef MBEDTLS_PK_PARSE_EC_EXTENDED - - -#undef MBEDTLS_FS_IO - - -/** - * \def MBEDTLS_NO_PLATFORM_ENTROPY - * - * Do not use built-in platform entropy functions. - * This is useful if your platform does not support - * standards like the /dev/urandom or Windows CryptoAPI. - * - * Uncomment this macro to disable the built-in platform entropy functions. - */ -#define MBEDTLS_NO_PLATFORM_ENTROPY - -/** - * \def MBEDTLS_ENTROPY_FORCE_SHA256 - * - * Force the entropy accumulator to use a SHA-256 accumulator instead of the - * default SHA-512 based one (if both are available). - * - * Requires: MBEDTLS_SHA256_C - * - * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option - * if you have performance concerns. - * - * This option is only useful if both MBEDTLS_SHA256_C and - * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. - */ -#define MBEDTLS_ENTROPY_FORCE_SHA256 - -/** - * \def MBEDTLS_SELF_TEST - * - * Enable the checkup functions (*_self_test). - */ -#undef MBEDTLS_SELF_TEST - -/** - * \def MBEDTLS_SSL_FALLBACK_SCSV - * - * Enable support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv-00). - * - * For servers, it is recommended to always enable this, unless you support - * only one version of TLS, or know for sure that none of your clients - * implements a fallback strategy. - * - * For clients, you only need this if you're using a fallback strategy, which - * is not recommended in the first place, unless you absolutely need it to - * interoperate with buggy (version-intolerant) servers. - * - * Comment this macro to disable support for FALLBACK_SCSV - */ -#undef MBEDTLS_SSL_FALLBACK_SCSV - -/** - * \def MBEDTLS_SSL_CBC_RECORD_SPLITTING - * - * Enable 1/n-1 record splitting for CBC mode in SSLv3 and TLS 1.0. - * - * This is a countermeasure to the BEAST attack, which also minimizes the risk - * of interoperability issues compared to sending 0-length records. - * - * Comment this macro to disable 1/n-1 record splitting. - */ -#undef MBEDTLS_SSL_CBC_RECORD_SPLITTING - -/** - * \def MBEDTLS_SSL_RENEGOTIATION - * - * Enable support for TLS renegotiation. - * - * The two main uses of renegotiation are (1) refresh keys on long-lived - * connections and (2) client authentication after the initial handshake. - * If you don't need renegotiation, it's probably better to disable it, since - * it has been associated with security issues in the past and is easy to - * misuse/misunderstand. - * - * Comment this to disable support for renegotiation. - * - * \note Even if this option is disabled, both client and server are aware - * of the Renegotiation Indication Extension (RFC 5746) used to - * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1). - * (See \c mbedtls_ssl_conf_legacy_renegotiation for the - * configuration of this extension). - * - */ -#undef MBEDTLS_SSL_RENEGOTIATION - -/** - * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO - * - * Enable support for receiving and parsing SSLv2 Client Hello messages for the - * SSL Server module (MBEDTLS_SSL_SRV_C). - * - * Uncomment this macro to enable support for SSLv2 Client Hello messages. - */ -//#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO - -/** - * \def MBEDTLS_SSL_PROTO_TLS1 - * - * Enable support for TLS 1.0. - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.0 - */ -#undef MBEDTLS_SSL_PROTO_TLS1 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_1 - * - * Enable support for TLS 1.1 (and DTLS 1.0 if DTLS is enabled). - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.1 / DTLS 1.0 - */ -#undef MBEDTLS_SSL_PROTO_TLS1_1 - -/** - * \def MBEDTLS_SSL_PROTO_DTLS - * - * Enable support for DTLS (all available versions). - * - * Enable this and MBEDTLS_SSL_PROTO_TLS1_1 to enable DTLS 1.0, - * and/or this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1_1 - * or MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for DTLS - */ -#undef MBEDTLS_SSL_PROTO_DTLS - -/** - * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY - * - * Enable support for the anti-replay mechanism in DTLS. - * - * Requires: MBEDTLS_SSL_TLS_C - * MBEDTLS_SSL_PROTO_DTLS - * - * \warning Disabling this is often a security risk! - * See mbedtls_ssl_conf_dtls_anti_replay() for details. - * - * Comment this to disable anti-replay in DTLS. - */ -#undef MBEDTLS_SSL_DTLS_ANTI_REPLAY - -/** - * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Enable support for HelloVerifyRequest on DTLS servers. - * - * This feature is highly recommended to prevent DTLS servers being used as - * amplifiers in DoS attacks against other hosts. It should always be enabled - * unless you know for sure amplification cannot be a problem in the - * environment in which your server operates. - * - * \warning Disabling this can ba a security risk! (see above) - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - * - * Comment this to disable support for HelloVerifyRequest. - */ -#undef MBEDTLS_SSL_DTLS_HELLO_VERIFY - -/** - * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - * - * Enable server-side support for clients that reconnect from the same port. - * - * Some clients unexpectedly close the connection and try to reconnect using the - * same source port. This needs special support from the server to handle the - * new connection securely, as described in section 4.2.8 of RFC 6347. This - * flag enables that support. - * - * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Comment this to disable support for clients reusing the source port. - */ -#undef MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - -/** - * \def MBEDTLS_SSL_DTLS_BADMAC_LIMIT - * - * Enable support for a limit of records with bad MAC. - * - * See mbedtls_ssl_conf_dtls_badmac_limit(). - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - */ -#undef MBEDTLS_SSL_DTLS_BADMAC_LIMIT - -/** - * \def MBEDTLS_SSL_SESSION_TICKETS - * - * Enable support for RFC 5077 session tickets in SSL. - * Client-side, provides full support for session tickets (maintenance of a - * session store remains the responsibility of the application, though). - * Server-side, you also need to provide callbacks for writing and parsing - * tickets, including authenticated encryption and key management. Example - * callbacks are provided by MBEDTLS_SSL_TICKET_C. - * - * Comment this macro to disable support for SSL session tickets - */ -#undef MBEDTLS_SSL_SESSION_TICKETS - -/** - * \def MBEDTLS_SSL_EXPORT_KEYS - * - * Enable support for exporting key block and master secret. - * This is required for certain users of TLS, e.g. EAP-TLS. - * - * Comment this macro to disable support for key export - */ -#undef MBEDTLS_SSL_EXPORT_KEYS - - -/** - * \def MBEDTLS_SSL_TRUNCATED_HMAC - * - * Enable support for RFC 6066 truncated HMAC in SSL. - * - * Comment this macro to disable support for truncated HMAC in SSL - */ -#undef MBEDTLS_SSL_TRUNCATED_HMAC - -/** - * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT - * - * Enable parsing and verification of X.509 certificates, CRLs and CSRS - * signed with RSASSA-PSS (aka PKCS#1 v2.1). - * - * Comment this macro to disallow using RSASSA-PSS in certificates. - */ -#undef MBEDTLS_X509_RSASSA_PSS_SUPPORT - -/** - * \def MBEDTLS_AESNI_C - * - * Enable AES-NI support on x86-64. - * - * Module: library/aesni.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the AES-NI instructions on x86-64 - */ -#undef MBEDTLS_AESNI_C - -/** - * \def MBEDTLS_NET_C - * - * Enable the TCP and UDP over IPv6/IPv4 networking routines. - * - * \note This module only works on POSIX/Unix (including Linux, BSD and OS X) - * and Windows. For other platforms, you'll want to disable it, and write your - * own networking callbacks to be passed to \c mbedtls_ssl_set_bio(). - * - * \note See also our Knowledge Base article about porting to a new - * environment: - * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS - * - * Module: library/net_sockets.c - * - * This module provides networking routines. - */ -#undef MBEDTLS_NET_C - -/** - * \def MBEDTLS_SSL_COOKIE_C - * - * Enable basic implementation of DTLS cookies for hello verification. - * - * Module: library/ssl_cookie.c - * Caller: - */ -#undef MBEDTLS_SSL_COOKIE_C - -/** - * \def MBEDTLS_TIMING_C - * - * Enable the semi-portable timing interface. - * - * \note The provided implementation only works on POSIX/Unix (including Linux, - * BSD and OS X) and Windows. On other platforms, you can either disable that - * module and provide your own implementations of the callbacks needed by - * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide - * your own implementation of the whole module by setting - * \c MBEDTLS_TIMING_ALT in the current file. - * - * \note See also our Knowledge Base article about porting to a new - * environment: - * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS - * - * Module: library/timing.c - * Caller: library/havege.c - * - * This module is used by the HAVEGE random number generator. - */ -#undef MBEDTLS_TIMING_C - -/** - * \def MBEDTLS_X509_CRL_PARSE_C - * - * Enable X.509 CRL parsing. - * - * Module: library/x509_crl.c - * Caller: library/x509_crt.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 CRL parsing. - */ -#undef MBEDTLS_X509_CRL_PARSE_C - -/** - * \def MBEDTLS_X509_CSR_PARSE_C - * - * Enable X.509 Certificate Signing Request (CSR) parsing. - * - * Module: library/x509_csr.c - * Caller: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is used for reading X.509 certificate request. - */ -#undef MBEDTLS_X509_CSR_PARSE_C - -/** - * \def MBEDTLS_X509_CREATE_C - * - * Enable X.509 core for creating certificates. - * - * Module: library/x509_create.c - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_WRITE_C - * - * This module is the basis for creating X.509 certificates and CSRs. - */ -#undef MBEDTLS_X509_CREATE_C - -/** - * \def MBEDTLS_X509_CSR_WRITE_C - * - * Enable creating X.509 Certificate Signing Requests (CSR). - * - * Module: library/x509_csr_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate request writing. - */ -#undef MBEDTLS_X509_CSR_WRITE_C - -/** - * \def MBEDTLS_X509_CRT_WRITE_C - * - * Enable creating X.509 certificates. - * - * Module: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate creation. - */ -#undef MBEDTLS_X509_CRT_WRITE_C - -/** - * \def MBEDTLS_CERTS_C - * - * Enable the test certificates. - * - * Module: library/certs.c - * Caller: - * - * This module is used for testing (ssl_client/server). - */ -#undef MBEDTLS_CERTS_C - -/** - * \def MBEDTLS_ERROR_C - * - * Enable error code to error string conversion. - * - * Module: library/error.c - * Caller: - * - * This module enables mbedtls_strerror(). - */ -#undef MBEDTLS_ERROR_C - -/** - * \def MBEDTLS_PADLOCK_C - * - * Enable VIA Padlock support on x86. - * - * Module: library/padlock.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the VIA PadLock on x86. - */ -#undef MBEDTLS_PADLOCK_C - -/** - * \def MBEDTLS_RIPEMD160_C - * - * Enable the RIPEMD-160 hash algorithm. - * - * Module: library/ripemd160.c - * Caller: library/md.c - * - */ -#undef MBEDTLS_RIPEMD160_C - -/** - * \def MBEDTLS_PK_RSA_ALT_SUPPORT - * - * Support external private RSA keys (eg from a HSM) in the PK layer. - * - * Comment this macro to disable support for external private RSA keys. - */ -#undef MBEDTLS_PK_RSA_ALT_SUPPORT - -/** - * \def MBEDTLS_ARC4_C - * - * Enable the ARCFOUR stream cipher. - * - * Module: library/arc4.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. If possible, we recommend avoidng dependencies on - * it, and considering stronger ciphers instead. - * - */ -#undef MBEDTLS_ARC4_C - -/** - * \def MBEDTLS_XTEA_C - * - * Enable the XTEA block cipher. - * - * Module: library/xtea.c - * Caller: - */ -#undef MBEDTLS_XTEA_C - -/** - * \def MBEDTLS_BLOWFISH_C - * - * Enable the Blowfish block cipher. - * - * Module: library/blowfish.c - */ -#undef MBEDTLS_BLOWFISH_C - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - * - * Enable the DHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -#undef MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - * - * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - */ -#undef MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - * - * Enable the RSA-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - */ -#undef MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - -/** - * \def MBEDTLS_PSA_CRYPTO_C - * - * Enable the Platform Security Architecture cryptography API. - * - * \warning The PSA Crypto API is still beta status. While you're welcome to - * experiment using it, incompatible API changes are still possible, and some - * parts may not have reached the same quality as the rest of Mbed TLS yet. - * - * Module: library/psa_crypto.c - * - * Requires: MBEDTLS_CTR_DRBG_C, MBEDTLS_ENTROPY_C - * - */ -#undef MBEDTLS_PSA_CRYPTO_C - -/** - * \def MBEDTLS_PSA_CRYPTO_STORAGE_C - * - * Enable the Platform Security Architecture persistent key storage. - * - * Module: library/psa_crypto_storage.c - * - * Requires: MBEDTLS_PSA_CRYPTO_C, - * either MBEDTLS_PSA_ITS_FILE_C or a native implementation of - * the PSA ITS interface - */ -#undef MBEDTLS_PSA_CRYPTO_STORAGE_C - -/** - * \def MBEDTLS_PSA_ITS_FILE_C - * - * Enable the emulation of the Platform Security Architecture - * Internal Trusted Storage (PSA ITS) over files. - * - * Module: library/psa_its_file.c - * - * Requires: MBEDTLS_FS_IO - */ -#undef MBEDTLS_PSA_ITS_FILE_C - -/** - * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE - * - * This option controls the availability of the API mbedtls_ssl_get_peer_cert() - * giving access to the peer's certificate after completion of the handshake. - * - * Unless you need mbedtls_ssl_peer_cert() in your application, it is - * recommended to disable this option for reduced RAM usage. - * - * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still - * defined, but always returns \c NULL. - * - * \note This option has no influence on the protection against the - * triple handshake attack. Even if it is disabled, Mbed TLS will - * still ensure that certificates do not change during renegotiation, - * for exaple by keeping a hash of the peer's certificate. - * - * Comment this macro to disable storing the peer's certificate - * after the handshake. - */ -#undef MBEDTLS_SSL_KEEP_PEER_CERTIFICATE - -/** - * \def MBEDTLS_DEPRECATED_REMOVED - * - * Remove deprecated functions and features so that they generate an error if - * used. Functionality deprecated in one version will usually be removed in the - * next version. You can enable this to help you prepare the transition to a - * new major version by making sure your code is not using this functionality. - * - * Uncomment to get errors on using deprecated functions and features. - */ -#define MBEDTLS_DEPRECATED_REMOVED - -#endif /* MBEDTLS_USER_CONFIG_HEADER */ diff --git a/samples/basic-sample/configs/wifi_config.h b/samples/basic-sample/configs/wifi_config.h deleted file mode 100644 index 87b8946..0000000 --- a/samples/basic-sample/configs/wifi_config.h +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** -* File Name: wifi_config.h -* -* Description: This file contains the configuration macros required for the -* Wi-Fi connection. -* -* Related Document: See README.md -* -* -******************************************************************************* -* Copyright 2020-2021, Cypress Semiconductor Corporation (an Infineon company) or -* an affiliate of Cypress Semiconductor Corporation. All rights reserved. -* -* This software, including source code, documentation and related -* materials ("Software") is owned by Cypress Semiconductor Corporation -* or one of its affiliates ("Cypress") and is protected by and subject to -* worldwide patent protection (United States and foreign), -* United States copyright laws and international treaty provisions. -* Therefore, you may use this Software only as provided in the license -* agreement accompanying the software package from which you -* obtained this Software ("EULA"). -* If no EULA applies, Cypress hereby grants you a personal, non-exclusive, -* non-transferable license to copy, modify, and compile the Software -* source code solely for use in connection with Cypress's -* integrated circuit products. Any reproduction, modification, translation, -* compilation, or representation of this Software except as specified -* above is prohibited without the express written permission of Cypress. -* -* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress -* reserves the right to make changes to the Software without notice. Cypress -* does not assume any liability arising out of the application or use of the -* Software or any product or circuit described in the Software. Cypress does -* not authorize its products for use in any products where a malfunction or -* failure of the Cypress product may reasonably be expected to result in -* significant property damage, injury or death ("High Risk Product"). By -* including Cypress's product in a High Risk Product, the manufacturer -* of such system or application assumes all risk of such use and in doing -* so agrees to indemnify Cypress against all liability. -*******************************************************************************/ - -#ifndef WIFI_CONFIG_H_ -#define WIFI_CONFIG_H_ - -#include "cy_wcm.h" - -/******************************************************************************* -* Macros -********************************************************************************/ -/* SSID of the Wi-Fi Access Point to which the MQTT client connects. */ -#define WIFI_SSID "your-wifi-ssid" - -/* Passkey of the above mentioned Wi-Fi SSID. */ -#define WIFI_PASSWORD "your-wifi-password" - -/* Security type of the Wi-Fi access point. See 'cy_wcm_security_t' structure - * in "cy_wcm.h" for more details. - */ -#define WIFI_SECURITY CY_WCM_SECURITY_WPA2_AES_PSK - -/* Maximum Wi-Fi re-connection limit. */ -#define MAX_WIFI_CONN_RETRIES (120u) - -/* Wi-Fi re-connection time interval in milliseconds. */ -#define WIFI_CONN_RETRY_INTERVAL_MS (5000) - -#endif /* WIFI_CONFIG_H_ */ diff --git a/samples/basic-sample/deps/TARGET_CY8CKIT-062-WIFI-BT.mtb b/samples/basic-sample/deps/TARGET_CY8CKIT-062-WIFI-BT.mtb deleted file mode 100644 index d723990..0000000 --- a/samples/basic-sample/deps/TARGET_CY8CKIT-062-WIFI-BT.mtb +++ /dev/null @@ -1 +0,0 @@ -https://github.com/cypresssemiconductorco/TARGET_CY8CKIT-062-WIFI-BT#release-v2.3.0#$$ASSET_REPO$$/TARGET_CY8CKIT-062-WIFI-BT/release-v2.3.0 diff --git a/samples/basic-sample/deps/cJSON.mtb b/samples/basic-sample/deps/cJSON.mtb deleted file mode 100644 index e909994..0000000 --- a/samples/basic-sample/deps/cJSON.mtb +++ /dev/null @@ -1 +0,0 @@ -https://github.com/DaveGamble/cJSON#v1.7.13#$$ASSET_REPO$$/cJSON/v1.7.13 diff --git a/samples/basic-sample/deps/http-client.mtb b/samples/basic-sample/deps/http-client.mtb deleted file mode 100644 index 83cbdb9..0000000 --- a/samples/basic-sample/deps/http-client.mtb +++ /dev/null @@ -1 +0,0 @@ -https://github.com/cypresssemiconductorco/http-client#release-v1.1.1#$$ASSET_REPO$$/http-client/release-v1.1.1 \ No newline at end of file diff --git a/samples/basic-sample/deps/iotc-c-lib.mtb b/samples/basic-sample/deps/iotc-c-lib.mtb deleted file mode 100644 index 1466bca..0000000 --- a/samples/basic-sample/deps/iotc-c-lib.mtb +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Avnet/iotc-c-lib#v2.0.3#$$ASSET_REPO$$/iotc-c-lib/v2.0.3 \ No newline at end of file diff --git a/samples/basic-sample/deps/iotc-modustoolbox-sdk.mtb b/samples/basic-sample/deps/iotc-modustoolbox-sdk.mtb deleted file mode 100644 index e892657..0000000 --- a/samples/basic-sample/deps/iotc-modustoolbox-sdk.mtb +++ /dev/null @@ -1 +0,0 @@ -https://github.com/avnet-iotconnect/iotc-modustoolbox-sdk#v1.0.0#$$ASSET_REPO$$/iotc-modustoolbox-sdk/v1.0.0 \ No newline at end of file diff --git a/samples/basic-sample/deps/mqtt.mtb b/samples/basic-sample/deps/mqtt.mtb deleted file mode 100644 index ab5ffa7..0000000 --- a/samples/basic-sample/deps/mqtt.mtb +++ /dev/null @@ -1 +0,0 @@ -https://github.com/cypresssemiconductorco/mqtt#latest-v3.X#$$ASSET_REPO$$/mqtt/latest-v3.X diff --git a/samples/basic-sample/deps/retarget-io.mtb b/samples/basic-sample/deps/retarget-io.mtb deleted file mode 100644 index 5f86d6c..0000000 --- a/samples/basic-sample/deps/retarget-io.mtb +++ /dev/null @@ -1 +0,0 @@ -https://github.com/cypresssemiconductorco/retarget-io#latest-v1.X#$$ASSET_REPO$$/retarget-io/latest-v1.X diff --git a/samples/basic-sample/deps/wifi-connection-manager.mtb b/samples/basic-sample/deps/wifi-connection-manager.mtb deleted file mode 100644 index 419d01a..0000000 --- a/samples/basic-sample/deps/wifi-connection-manager.mtb +++ /dev/null @@ -1 +0,0 @@ -https://github.com/cypresssemiconductorco/wifi-connection-manager#latest-v2.X#$$ASSET_REPO$$/wifi-connection-manager/latest-v2.X diff --git a/samples/basic-sample/source/app_task.c b/samples/basic-sample/source/app_task.c deleted file mode 100644 index fbcf760..0000000 --- a/samples/basic-sample/source/app_task.c +++ /dev/null @@ -1,232 +0,0 @@ -/******************************************************************************* -* Copyright 2020-2021, Cypress Semiconductor Corporation (an Infineon company) or -* an affiliate of Cypress Semiconductor Corporation. All rights reserved. -* -* This software, including source code, documentation and related -* materials ("Software") is owned by Cypress Semiconductor Corporation -* or one of its affiliates ("Cypress") and is protected by and subject to -* worldwide patent protection (United States and foreign), -* United States copyright laws and international treaty provisions. -* Therefore, you may use this Software only as provided in the license -* agreement accompanying the software package from which you -* obtained this Software ("EULA"). -* If no EULA applies, Cypress hereby grants you a personal, non-exclusive, -* non-transferable license to copy, modify, and compile the Software -* source code solely for use in connection with Cypress's -* integrated circuit products. Any reproduction, modification, translation, -* compilation, or representation of this Software except as specified -* above is prohibited without the express written permission of Cypress. -* -* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress -* reserves the right to make changes to the Software without notice. Cypress -* does not assume any liability arising out of the application or use of the -* Software or any product or circuit described in the Software. Cypress does -* not authorize its products for use in any products where a malfunction or -* failure of the Cypress product may reasonably be expected to result in -* significant property damage, injury or death ("High Risk Product"). By -* including Cypress's product in a High Risk Product, the manufacturer -* of such system or application assumes all risk of such use and in doing -* so agrees to indemnify Cypress against all liability. -*******************************************************************************/ -// -// Copyright: Avnet 2021 -// Modified by Nik Markovic on 11/11/21. -// - -#include "cyhal.h" -#include "cybsp.h" - -/* FreeRTOS header files */ -#include "FreeRTOS.h" -#include "task.h" - -/* Configuration file for Wi-Fi and MQTT client */ -#include "wifi_config.h" - -/* Middleware libraries */ -#include "cy_retarget_io.h" -//#include "cy_wcm.h" -//#include "cy_lwip.h" - -//#include "clock.h" - -/* LwIP header files */ -#include "lwip/netif.h" -#include "lwip/apps/sntp.h" - -#include "iotconnect.h" -#include "iotconnect_common.h" -#include "iotc_mtb_time.h" - -#include "app_config.h" -#include "app_task.h" - -#define APP_VERSION "01.00.00" - -/* Macro to check if the result of an operation was successful and set the - * corresponding bit in the status_flag based on 'init_mask' parameter. When - * it has failed, print the error message and return the result to the - * calling function. - */ -#define CHECK_RESULT(result, init_mask, error_message...) \ - do \ - { \ - if ((int)result == CY_RSLT_SUCCESS) \ - { \ - status_flag |= init_mask; \ - } \ - else \ - { \ - printf(error_message); \ - return result; \ - } \ - } while(0) - -/****************************************************************************** - * Function Name: wifi_connect - ****************************************************************************** - * Summary: - * Function that initiates connection to the Wi-Fi Access Point using the - * specified SSID and PASSWORD. The connection is retried a maximum of - * 'MAX_WIFI_CONN_RETRIES' times with interval of 'WIFI_CONN_RETRY_INTERVAL_MS' - * milliseconds. - * - * Parameters: - * void - * - * Return: - * cy_rslt_t : CY_RSLT_SUCCESS upon a successful Wi-Fi connection, else an - * error code indicating the failure. - * - ******************************************************************************/ -static cy_rslt_t wifi_connect(void) { - cy_rslt_t result = CY_RSLT_SUCCESS; - cy_wcm_connect_params_t connect_param; - cy_wcm_ip_address_t ip_address; - - /* Check if Wi-Fi connection is already established. */ - if (cy_wcm_is_connected_to_ap() == 0) { - /* Configure the connection parameters for the Wi-Fi interface. */ - memset(&connect_param, 0, sizeof(cy_wcm_connect_params_t)); - memcpy(connect_param.ap_credentials.SSID, WIFI_SSID, sizeof(WIFI_SSID)); - memcpy(connect_param.ap_credentials.password, WIFI_PASSWORD, sizeof(WIFI_PASSWORD)); - connect_param.ap_credentials.security = WIFI_SECURITY; - - printf("Connecting to Wi-Fi AP '%s'\n", connect_param.ap_credentials.SSID); - - /* Connect to the Wi-Fi AP. */ - for (uint32_t retry_count = 0; retry_count < MAX_WIFI_CONN_RETRIES; retry_count++) { - result = cy_wcm_connect_ap(&connect_param, &ip_address); - - if (result == CY_RSLT_SUCCESS) { - printf("\nSuccessfully connected to Wi-Fi network '%s'.\n", connect_param.ap_credentials.SSID); - - /* Set the appropriate bit in the status_flag to denote - * successful Wi-Fi connection, print the assigned IP address. - */ - if (ip_address.version == CY_WCM_IP_VER_V4) { - printf("IPv4 Address Assigned: %s\n", ip4addr_ntoa((const ip4_addr_t*) &ip_address.ip.v4)); - } else if (ip_address.version == CY_WCM_IP_VER_V6) { - printf("IPv6 Address Assigned: %s\n", ip6addr_ntoa((const ip6_addr_t*) &ip_address.ip.v6)); - } - return result; - } - - printf("Connection to Wi-Fi network failed with error code 0x%0X. Retrying in %d ms. Retries left: %d\n", - (int) result, WIFI_CONN_RETRY_INTERVAL_MS, (int) (MAX_WIFI_CONN_RETRIES - retry_count - 1)); - vTaskDelay(pdMS_TO_TICKS(WIFI_CONN_RETRY_INTERVAL_MS)); - } - - printf("\nExceeded maximum Wi-Fi connection attempts!\n"); - printf("Wi-Fi connection failed after retrying for %d mins\n", - (int) ((WIFI_CONN_RETRY_INTERVAL_MS * MAX_WIFI_CONN_RETRIES) / 60000u)); - } - return result; -} - -static void publish_telemetry() { - IotclMessageHandle msg = iotcl_telemetry_create(iotconnect_sdk_get_lib_config()); - - // Optional. The first time you create a data point, the current timestamp will be automatically added - // TelemetryAddWith* calls are only required if sending multiple data points in one packet. - iotcl_telemetry_add_with_iso_time(msg, iotcl_iso_timestamp_now()); - iotcl_telemetry_set_string(msg, "version", APP_VERSION); - iotcl_telemetry_set_number(msg, "cpu", 3.123); // test floating point numbers - - const char *str = iotcl_create_serialized_string(msg, false); - iotcl_telemetry_destroy(msg); - printf("Sending: %s\n", str); - iotconnect_sdk_send_packet(str); // underlying code will report an error - iotcl_destroy_serialized(str); -} - -void app_task(void *pvParameters) { - - /* Structures that store the data to be sent/received to/from various - * message queues. - */ - - /* Configure the Wi-Fi interface as a Wi-Fi STA (i.e. Client). */ - cy_wcm_config_t config = { .interface = CY_WCM_INTERFACE_TYPE_STA }; - - /* To avoid compiler warnings */ - (void) pvParameters; - - /* Create a message queue to communicate with other tasks and callbacks. */ - //mqtt_task_q = xQueueCreate(MQTT_TASK_QUEUE_LENGTH, sizeof(mqtt_task_cmd_t)); - /* Initialize the Wi-Fi Connection Manager and jump to the cleanup block - * upon failure. - */ - if (CY_RSLT_SUCCESS != cy_wcm_init(&config)) { - printf("Error: Wi-Fi Connection Manager initialization failed!\n"); - goto exit_cleanup; - } - - /* Set the appropriate bit in the status_flag to denote successful - * WCM initialization. - */ - printf("Wi-Fi Connection Manager initialized.\n"); - - /* Initiate connection to the Wi-Fi AP and cleanup if the operation fails. */ - if (CY_RSLT_SUCCESS != wifi_connect()) { - goto exit_cleanup; - } - - if (0 != iotc_mtb_time_obtain(IOTCONNECT_SNTP_SERVER)) { - // called function will print errors - return; - } - - for (int i = 0; i < 100; i++) { - - IotConnectClientConfig *iotc_config = iotconnect_sdk_init_and_get_config(); - iotc_config->duid = IOTCONNECT_DUID; - iotc_config->cpid = IOTCONNECT_CPID; - iotc_config->env = IOTCONNECT_ENV; - iotc_config->auth.type = IOTCONNECT_AUTH_TYPE; - - if (iotc_config->auth.type == IOTC_AT_X509) { - iotc_config->auth.data.cert_info.device_cert = IOTCONNECT_DEVICE_CERT; - iotc_config->auth.data.cert_info.device_key = IOTCONNECT_DEVICE_KEY; - } - - - cy_rslt_t ret = iotconnect_sdk_init(); - if (CY_RSLT_SUCCESS != ret) { - printf("Failed to initialize the IoTConnect SDK. Error code: %lu\n", ret); - goto exit_cleanup; - } - - for (int j = 0; iotconnect_sdk_is_connected() && j < 3; j++) { - publish_telemetry(); - vTaskDelay(pdMS_TO_TICKS(10000)); - } - - iotconnect_sdk_disconnect(); - } - exit_cleanup: printf("\nAppTask Done.\nTerminating the AppTask...\n"); - vTaskDelete(NULL); - -} diff --git a/samples/basic-sample/source/app_task.h b/samples/basic-sample/source/app_task.h deleted file mode 100644 index ac5ef90..0000000 --- a/samples/basic-sample/source/app_task.h +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* -* Copyright 2020-2021, Cypress Semiconductor Corporation (an Infineon company) or -* an affiliate of Cypress Semiconductor Corporation. All rights reserved. -* -* This software, including source code, documentation and related -* materials ("Software") is owned by Cypress Semiconductor Corporation -* or one of its affiliates ("Cypress") and is protected by and subject to -* worldwide patent protection (United States and foreign), -* United States copyright laws and international treaty provisions. -* Therefore, you may use this Software only as provided in the license -* agreement accompanying the software package from which you -* obtained this Software ("EULA"). -* If no EULA applies, Cypress hereby grants you a personal, non-exclusive, -* non-transferable license to copy, modify, and compile the Software -* source code solely for use in connection with Cypress's -* integrated circuit products. Any reproduction, modification, translation, -* compilation, or representation of this Software except as specified -* above is prohibited without the express written permission of Cypress. -* -* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress -* reserves the right to make changes to the Software without notice. Cypress -* does not assume any liability arising out of the application or use of the -* Software or any product or circuit described in the Software. Cypress does -* not authorize its products for use in any products where a malfunction or -* failure of the Cypress product may reasonably be expected to result in -* significant property damage, injury or death ("High Risk Product"). By -* including Cypress's product in a High Risk Product, the manufacturer -* of such system or application assumes all risk of such use and in doing -* so agrees to indemnify Cypress against all liability. -*******************************************************************************/ -// -// Copyright: Avnet 2021 -// Modified by Nik Markovic on 11/11/21. -// - -#ifndef APP_TASK_H_ -#define APP_TASK_H_ - -#define APP_TASK_PRIORITY (2) -#define APP_TASK_STACK_SIZE (1024 * 8) - -void app_task(void *pvParameters); - -#endif // APP_TASK_H_ diff --git a/samples/basic-sample/source/main.c b/samples/basic-sample/source/main.c deleted file mode 100644 index c5d75b8..0000000 --- a/samples/basic-sample/source/main.c +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************************************** - * File Name: main.c - * - * Description: This is the source code for MQTT Client Example for ModusToolbox. - * - * Related Document: See README.md - * - * - ******************************************************************************* - * Copyright 2020-2021, Cypress Semiconductor Corporation (an Infineon company) or - * an affiliate of Cypress Semiconductor Corporation. All rights reserved. - * - * This software, including source code, documentation and related - * materials ("Software") is owned by Cypress Semiconductor Corporation - * or one of its affiliates ("Cypress") and is protected by and subject to - * worldwide patent protection (United States and foreign), - * United States copyright laws and international treaty provisions. - * Therefore, you may use this Software only as provided in the license - * agreement accompanying the software package from which you - * obtained this Software ("EULA"). - * If no EULA applies, Cypress hereby grants you a personal, non-exclusive, - * non-transferable license to copy, modify, and compile the Software - * source code solely for use in connection with Cypress's - * integrated circuit products. Any reproduction, modification, translation, - * compilation, or representation of this Software except as specified - * above is prohibited without the express written permission of Cypress. - * - * Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress - * reserves the right to make changes to the Software without notice. Cypress - * does not assume any liability arising out of the application or use of the - * Software or any product or circuit described in the Software. Cypress does - * not authorize its products for use in any products where a malfunction or - * failure of the Cypress product may reasonably be expected to result in - * significant property damage, injury or death ("High Risk Product"). By - * including Cypress's product in a High Risk Product, the manufacturer - * of such system or application assumes all risk of such use and in doing - * so agrees to indemnify Cypress against all liability. - *******************************************************************************/ -// -// Copyright: Avnet 2021 -// Modified by Nik Markovic on 11/11/21. -// - -/* Header file includes */ -#include "cyhal.h" -#include "cybsp.h" -#include "cy_retarget_io.h" -#include "app_task.h" -#include "FreeRTOS.h" -#include "task.h" - -#include "app_task.h" - -/****************************************************************************** - * Global Variables - ******************************************************************************/ -/* This enables RTOS aware debugging. */ -volatile int uxTopUsedPriority; - -/****************************************************************************** - * Function Name: main - ****************************************************************************** - * Summary: - * System entrance point. This function initializes retarget IO, sets up - * the MQTT client task, and then starts the RTOS scheduler. - * - * Parameters: - * void - * - * Return: - * int - * - ******************************************************************************/ -int main() { - cy_rslt_t result; - - /* This enables RTOS aware debugging in OpenOCD. */ - uxTopUsedPriority = configMAX_PRIORITIES - 1; - - /* Initialize the board support package. */ - result = cybsp_init(); - CY_ASSERT(CY_RSLT_SUCCESS == result); - - /* To avoid compiler warnings. */ - (void) result; - - /* Enable global interrupts. */ - __enable_irq(); - - /* Initialize retarget-io to use the debug UART port. */ - cy_retarget_io_init(CYBSP_DEBUG_UART_TX, CYBSP_DEBUG_UART_RX, - CY_RETARGET_IO_BAUDRATE); - - /* \x1b[2J\x1b[;H - ANSI ESC sequence to clear screen. */ - printf("\x1b[2J\x1b[;H"); - printf("===============================================================\n"); - printf("Starting The App Task\n"); - printf("===============================================================\n\n"); - - /* Create the MQTT Client task. */ - xTaskCreate(app_task, "App Task", APP_TASK_STACK_SIZE, - NULL, APP_TASK_PRIORITY, NULL); - - /* Start the FreeRTOS scheduler. */ - vTaskStartScheduler(); - - /* Should never get here. */ - CY_ASSERT(0); -} - -/* [] END OF FILE */ diff --git a/scripts/setup-project.sh b/scripts/setup-project.sh deleted file mode 100755 index 1339f7e..0000000 --- a/scripts/setup-project.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - - -# prevent accidental commits on these files -# need to undo, if changes to these files are actually needed -git update-index --assume-unchanged samples/basic-sample/configs/app_config.h -git update-index --assume-unchanged samples/basic-sample/configs/wifi_config.h diff --git a/iotc-modustoolbox-sdk/mtb-layer/src/iotc_http_client.c b/source/iotc_http_client.c similarity index 100% rename from iotc-modustoolbox-sdk/mtb-layer/src/iotc_http_client.c rename to source/iotc_http_client.c diff --git a/iotc-modustoolbox-sdk/mtb-layer/src/iotc_mqtt_client.c b/source/iotc_mqtt_client.c similarity index 100% rename from iotc-modustoolbox-sdk/mtb-layer/src/iotc_mqtt_client.c rename to source/iotc_mqtt_client.c diff --git a/iotc-modustoolbox-sdk/mtb-layer/src/iotc_mtb_time.c b/source/iotc_mtb_time.c similarity index 100% rename from iotc-modustoolbox-sdk/mtb-layer/src/iotc_mtb_time.c rename to source/iotc_mtb_time.c diff --git a/iotc-modustoolbox-sdk/src/iotconnect.c b/source/iotconnect.c similarity index 100% rename from iotc-modustoolbox-sdk/src/iotconnect.c rename to source/iotconnect.c diff --git a/iotc-modustoolbox-sdk/mtb-layer/src/sntp.c b/source/sntp.c similarity index 100% rename from iotc-modustoolbox-sdk/mtb-layer/src/sntp.c rename to source/sntp.c