Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Commit

Permalink
Release v1.2.5
Browse files Browse the repository at this point in the history
Merge branch 'development'

* development: (128 commits)
  Release/v1.2.5 (#110)
  [ stm32 port ] wolfSSL Eclipse project: using relative paths to wolfSSL lib to eliminate need of a Tutorial reader to edit the wolfSSL project's properties (#109)
  Improve compilation setup of WolfSSL and EthernetNucleo (#108)
  Xively C Client CC3220 Uniflash Image version 1
  Feature/port eth nucleo f429 zi (#98)
  Removed unused struct and function pointer definitions.  Added a debunker check on button press.  Always publish button state regardless of burst mode.
  Ran Code formatter.  Added Xively Copyright.
  Added burst mode.  Removed topic table.
  Use NIST SNTP servers in stm32f4 nucleo implementation
  Use const variables where possible, fix harmless sntp bug
  Conform comments and if statements to libxively standards
  Updates to the main loop to publish the Gyroscope, Accelerometer, and Button state 4x a second.
  Remove unnecessary comment from TLS cert validation code
  Final version of TLS cert validation on SPWF01Sx modules
  Working TLS certificate validation - WIP
  Implement SNTP servers iteration so we can handle outages
  [feat] adjustments of the delays and timeouts
  Implement error handling for ALL sensor board input reading for stm32f4 demo
  Handle snprintf retval properly, const MQTT msg in button EXTI handler, rename floatToInt
  Add a TODO to handle a potentially fatal state in stm32f4 nucleo+wifi+sensors
  ...
  • Loading branch information
atigyi committed Mar 14, 2017
2 parents 6333219 + 271da9f commit 5348ef8
Show file tree
Hide file tree
Showing 119 changed files with 23,056 additions and 208 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ env:
- PRESET=ARM_REL
- PRESET=ARM_REL_MIN

- PRESET=STM32F4
- PRESET=STM32FX
XI_MAKETARGET=""
- PRESET=STM32FX_NUCLEO_WIFI
XI_MAKETARGET=""

- PRESET=CC3200
Expand Down Expand Up @@ -59,7 +61,9 @@ matrix:
- compiler: clang
env: PRESET=ARM_REL
- compiler: clang
env: PRESET=STM32F4 XI_MAKETARGET=""
env: PRESET=STM32FX XI_MAKETARGET=""
- compiler: clang
env: PRESET=STM32FX_NUCLEO_WIFI XI_MAKETARGET=""
- compiler: clang
env: PRESET=CC3200 XI_MAKETARGET=""
- compiler: clang
Expand Down
9 changes: 9 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Xively Client version 1.2.5
#### March 14 2017

## Features

- STM32F401RE Nucleo board + wifi X-NUCLEO-IDW01M1 expansion board support. Example Eclipse project and Tutorial (https://developer.xively.com/docs/stm32f4xx-nucleo) included. TLS connection to Xively Servers uses the wifi expansion on-board TLS solution. Accurate time initialised from SNTP servers.



# Xively Client version 1.2.4
#### Jan 17 2017

Expand Down
Binary file not shown.
11 changes: 6 additions & 5 deletions examples/common/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@ XI_EXAMPLE_SRCDIR := $(CURDIR)/src
XI_EXAMPLE_OBJDIR := $(CURDIR)/obj
XI_EXAMPLE_BINDIR ?= $(CURDIR)/bin

XI_EXAMPLE_SRCS := common/commandline.c
XI_EXAMPLE_SRCS += common/commandline.c
XI_EXAMPLE_SRCS += $(XI_EXAMPLE_NAME).c

XI_EXAMPLE_DEPS := $(filter-out $(XI_EXAMPLE_SRCS), $(XI_EXAMPLE_SRCS:.c=.d))
XI_EXAMPLE_OBJS := $(filter-out $(XI_EXAMPLE_SRCS), $(XI_EXAMPLE_SRCS:.c=.o))
XI_EXAMPLE_DEPS := $(subst $(XI_EXAMPLE_SRCDIR)/,,$(XI_EXAMPLE_SRCS:.c=.d))
XI_EXAMPLE_OBJS := $(subst $(XI_EXAMPLE_SRCDIR)/,,$(XI_EXAMPLE_SRCS:.c=.o))

XI_EXAMPLE_DEPS := $(addprefix $(XI_EXAMPLE_OBJDIR)/,$(XI_EXAMPLE_DEPS))
XI_EXAMPLE_OBJS := $(addprefix $(XI_EXAMPLE_OBJDIR)/,$(XI_EXAMPLE_OBJS))

XI_EXAMPLE_BIN := $(XI_EXAMPLE_BINDIR)/$(XI_EXAMPLE_NAME)

XI_CLIENT_PATH ?= $(CURDIR)/../../
XI_CLIENT_INC_PATH ?= $(CURDIR)/../../include
XI_CLIENT_INC_PATH += $(CURDIR)/../../include
XI_CLIENT_LIB_PATH ?= $(CURDIR)/../../bin/$(XI_TARGET_PLATFORM)

XI_CLIENT_ROOTCA_LIST := $(CURDIR)/../../res/trusted_RootCA_certs/xi_RootCA_list.pem

XI_FLAGS_INCLUDE += -I$(XI_CLIENT_INC_PATH)
XI_FLAGS_INCLUDE += $(foreach i,$(XI_CLIENT_INC_PATH),-I$i)

XI_FLAGS_COMPILER ?= -Wall -Werror -Wno-pointer-arith -Wno-format -fstrict-aliasing -Os -Wextra

# TLS BSP related configuration
Expand Down
15 changes: 15 additions & 0 deletions examples/firmware_update_example/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2003-2016, LogMeIn, Inc. All rights reserved.
#
# This is part of the Xively C Client library,
# it is licensed under the BSD 3-Clause license.
XI_EXAMPLE_NAME := firmware_update_example

XI_EXAMPLE_SRCS += $(wildcard $(CURDIR)/src/cbor/*.c)
XI_EXAMPLE_SRCS += $(wildcard $(CURDIR)/src/sha256/*.c)
XI_EXAMPLE_SRCS += xi_sft_client.c

XI_CLIENT_INC_PATH += $(CURDIR)/src/cbor
XI_CLIENT_INC_PATH += $(CURDIR)/src/sha256

include ../common/rules.mk
include ../common/targets.mk
21 changes: 21 additions & 0 deletions examples/firmware_update_example/src/cbor/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Carsten Bormann <cabo@tzi.org>

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.
2 changes: 2 additions & 0 deletions examples/firmware_update_example/src/cbor/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
These files are slightly modified versions from:
https://github.com/cabo/cn-cbor
118 changes: 118 additions & 0 deletions examples/firmware_update_example/src/cbor/cbor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#ifndef CBOR_PROTOCOL_H__
#define CBOR_PROTOCOL_H__

/* The 8 major types */
#define MT_UNSIGNED 0
#define MT_NEGATIVE 1
#define MT_BYTES 2
#define MT_TEXT 3
#define MT_ARRAY 4
#define MT_MAP 5
#define MT_TAG 6
#define MT_PRIM 7

/* The initial bytes resulting from those */
#define IB_UNSIGNED (MT_UNSIGNED << 5)
#define IB_NEGATIVE (MT_NEGATIVE << 5)
#define IB_BYTES (MT_BYTES << 5)
#define IB_TEXT (MT_TEXT << 5)
#define IB_ARRAY (MT_ARRAY << 5)
#define IB_MAP (MT_MAP << 5)
#define IB_TAG (MT_TAG << 5)
#define IB_PRIM (MT_PRIM << 5)

#define IB_NEGFLAG (IB_NEGATIVE - IB_UNSIGNED)
#define IB_NEGFLAG_AS_BIT(ib) ((ib) >> 5)
#define IB_TEXTFLAG (IB_TEXT - IB_BYTES)

#define IB_AI(ib) ((ib) & 0x1F)
#define IB_MT(ib) ((ib) >> 5)

/* Tag numbers handled by this implementation */
#define TAG_TIME_EPOCH 1
#define TAG_BIGNUM 2
#define TAG_BIGNUM_NEG 3
#define TAG_URI 32
#define TAG_RE 35

/* Initial bytes of those tag numbers */
#define IB_TIME_EPOCH (IB_TAG | TAG_TIME_EPOCH)
#define IB_BIGNUM (IB_TAG | TAG_BIGNUM)
#define IB_BIGNUM_NEG (IB_TAG | TAG_BIGNUM_NEG)
/* TAG_URI and TAG_RE are non-immediate tags */

/* Simple values handled by this implementation */
#define VAL_FALSE 20
#define VAL_TRUE 21
#define VAL_NIL 22
#define VAL_UNDEF 23

/* Initial bytes of those simple values */
#define IB_FALSE (IB_PRIM | VAL_FALSE)
#define IB_TRUE (IB_PRIM | VAL_TRUE)
#define IB_NIL (IB_PRIM | VAL_NIL)
#define IB_UNDEF (IB_PRIM | VAL_UNDEF)

/* AI values with more data in head */
#define AI_1 24
#define AI_2 25
#define AI_4 26
#define AI_8 27
#define AI_INDEF 31
#define IB_BREAK (IB_PRIM | AI_INDEF)
/* For */
#define IB_UNUSED (IB_TAG | AI_INDEF)

/* Floating point initial bytes */
#define IB_FLOAT2 (IB_PRIM | AI_2)
#define IB_FLOAT4 (IB_PRIM | AI_4)
#define IB_FLOAT8 (IB_PRIM | AI_8)

// These definitions are here because they aren't required for the public
// interface, and they were quite confusing in cn-cbor.h

#ifdef USE_CBOR_CONTEXT
/**
* Allocate enough space for 1 `cn_cbor` structure.
*
* @param[in] ctx The allocation context, or NULL for calloc.
* @return A pointer to a `cn_cbor` or NULL on failure
*/
#define CN_CALLOC(ctx) ((ctx) && (ctx)->calloc_func) ? \
(ctx)->calloc_func(1, sizeof(cn_cbor), (ctx)->context) : \
calloc(1, sizeof(cn_cbor));

/**
* Free a
* @param free_func [description]
* @return [description]
*/
#define CN_FREE(ptr, ctx) ((ctx) && (ctx)->free_func) ? \
(ctx)->free_func((ptr), (ctx)->context) : \
free((ptr));

#define CBOR_CONTEXT_PARAM , context
#define CN_CALLOC_CONTEXT() CN_CALLOC(context)
#define CN_CBOR_FREE_CONTEXT(p) CN_FREE(p, context)

#else

#define CBOR_CONTEXT_PARAM
#define CN_CALLOC_CONTEXT() CN_CALLOC
#define CN_CBOR_FREE_CONTEXT(p) CN_FREE(p)

#ifndef CN_CALLOC
#define CN_CALLOC calloc(1, sizeof(cn_cbor))
#endif

#ifndef CN_FREE
#define CN_FREE free
#endif

#endif // USE_CBOR_CONTEXT

#ifndef UNUSED_PARAM
#define UNUSED_PARAM(p) ((void)&(p))
#endif

#endif // CBOR_PROTOCOL_H__
Loading

0 comments on commit 5348ef8

Please sign in to comment.