Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mcci-catena/Catena-Arduino-Platform
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.21.2
Choose a base ref
...
head repository: mcci-catena/Catena-Arduino-Platform
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.22.0
Choose a head ref
Loading
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016-2021 MCCI Corporation.
Copyright (c) 2016-2023 MCCI Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ This library provides a simple-to-use framework for taking advantage of many of

_Apologies_: This document is a work in progress, and is published in this intermediate form in hopes that it will still be better than nothing.

[![GitHub release](https://img.shields.io/github/release/mcci-catena/Catena-Arduino-Platform.svg)](https://github.com/mcci-catena/Catena-Arduino-Platform/releases/latest) [![GitHub commits](https://img.shields.io/github/commits-since/mcci-catena/Catena-Arduino-Platform/latest.svg)](https://github.com/mcci-catena/Catena-Arduino-Platform/compare/v0.21.2...master) [![Build Status](https://travis-ci.com/mcci-catena/Catena-Arduino-Platform.svg?branch=master)](https://travis-ci.com/mcci-catena/Catena-Arduino-Platform)
[![GitHub release](https://img.shields.io/github/release/mcci-catena/Catena-Arduino-Platform.svg)](https://github.com/mcci-catena/Catena-Arduino-Platform/releases/latest) [![GitHub commits](https://img.shields.io/github/commits-since/mcci-catena/Catena-Arduino-Platform/latest.svg)](https://github.com/mcci-catena/Catena-Arduino-Platform/compare/v0.22.0...master) [![Build Status](https://travis-ci.com/mcci-catena/Catena-Arduino-Platform.svg?branch=master)](https://travis-ci.com/mcci-catena/Catena-Arduino-Platform)

<!-- markdownlint-disable MD033 -->
<!-- markdownlint-capture -->
@@ -1446,6 +1446,13 @@ This sketch demonstrates the use of the Catena FSM class to implement the `Turns

## Release History

- v0.22.0 includes the following changes.

- fix [#346](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/346): add support to Catena4618 and Catena 4612 with LTR329 sensor (v0.22.0-pre7)
- fix [#342](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/342): add support to Catena4610 version-2 (v0.22.0-pre5).
- fix [#321](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/321): add 24-bit float encoding support (v0.22.0-pre1).
- fix [#319](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/319): accomodate missing two-arg `UsbSerial::begin()` (v0.21.3-pre1).

- v0.21.2 includes the following changes, non breaking, all bug fixes.

- Check SessionState for validity when fetching ABP info ([#312](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/312), `v0.21.2-pre1`).
131 changes: 131 additions & 0 deletions extra/test/catena_lora_adr_rejoin/catena_lora_adr_rejoin.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/*
Module: catena_lora_adr_rejoin.ino
Function:
App for testing ADR rejoin.
Copyright notice and License:
See LICENSE file accompanying this project.
Author:
Terry Moore, MCCI Corporation July 2021
*/

#include <Catena.h>
#include <Catena_Led.h>
#include <arduino_lmic.h>

using namespace McciCatena;

// declare the global object for the platform.
Catena gCatena;
Catena::LoRaWAN gLoRaWAN;

// declare the LED object
StatusLed gLed (Catena::PIN_STATUS_LED);

// declare the callback function.
Arduino_LoRaWAN::SendBufferCbFn uplinkDone;

bool gfSuccess;
bool gfTxStarted;
bool gfTxDone;

uint8_t uplinkBuffer[] = { 0xCA, 0xFE, 0xBA, 0xBE };
uint32_t uplinkTime;
uint32_t nSent = 0;

void setup()
{
gCatena.begin();

gCatena.SafePrintf("This is the ADR re-join test program for the MCCI Catena-Arduino-Platform library.\n");
gCatena.SafePrintf("Enter 'help' for a list of commands.\n");
gCatena.SafePrintf("(remember to select 'Line Ending: Newline' at the bottom of the monitor window.)\n");

gLed.begin();
gCatena.registerObject(&gLed);
gLed.Set(LedPattern::FastFlash);

gLoRaWAN.begin(&gCatena);
gCatena.registerObject(&gLoRaWAN);

if (! gLoRaWAN.IsProvisioned())
{
gCatena.SafePrintf("LoRaWAN not provisioned yet. Use the commands to set it up.\n");
}
else
{
uplinkTime = millis();
}
}

void loop()
{
gCatena.poll();
if (! gfTxStarted)
{
do {
if (! gLoRaWAN.IsProvisioned())
break;

if (int32_t(millis() - uplinkTime) >= 0)
{
if (nSent == 2)
{
// change the LMIC count so we'll force a join,
// and change subband.
gCatena.SafePrintf(
"Switching to subband 7: %d\n",
LMIC_selectSubBand(7)
);

// put us at DR0
LMIC_setDrTxpow(LORAWAN_DR0, 21);

// set the LMIC's join count
LMIC.adrAckReq = LINK_CHECK_UNJOIN - 3;
}

sendUplink(nSent < 2);
}
} while (0);
}
else if (gfTxStarted && gfTxDone)
{
gfTxStarted = false;
if (gfSuccess)
gCatena.SafePrintf("Transmit succeeded: LMIC.adrAckReq=%d LMIC.datarate=%d.\n", LMIC.adrAckReq, LMIC.datarate);
else
gCatena.SafePrintf("Message uplink failed! LMIC.adrAckReq=%d LMIC.datarate=%d.\n", LMIC.adrAckReq, LMIC.datarate);

uplinkTime = millis() + 15 * 1000;
}
else
{
// waiting for message to arrive.
}
}

void sendUplink(bool fConfirmed)
{
// send a confirmed uplink
if (gLoRaWAN.SendBuffer(uplinkBuffer, sizeof(uplinkBuffer), uplinkDone, nullptr, fConfirmed, /* port */ 16))
{
gfTxStarted = true;
++nSent;
}
else
{
gCatena.SafePrintf("SendBuffer failed! Try again in 30 seconds\n");
uplinkTime = millis() + 30 * 1000;
}
}

void uplinkDone(void *pCtx, bool fSuccess)
{
gfTxDone = true;
gfSuccess = fSuccess;
}
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=MCCI Catena Arduino Platform
version=0.21.2
version=0.22.0
author=Terry Moore, ChaeHee Won, Sungjoon Park, Dhinesh Kumar Pitchai
maintainer=MCCI Corporation <techsupport@mcci.com>
sentence=Arduino library for MCCI Catena 44xx, 45xx, 46xx and 48xx systems.
@@ -9,4 +9,4 @@ architectures=samd,stm32
url=https://github.com/mcci-catena/Catena-Arduino-Platform
dot_a_linkage=true
includes=Catena.h
depends=MCCI LoRaWAN LMIC library,MCCI Arduino LoRaWAN Library,MCCI Arduino Development Kit ADK,MCCI FRAM I2C
depends=MCCI LoRaWAN LMIC library,MCCI Arduino LoRaWAN Library,MCCI Arduino Development Kit ADK,MCCI FRAM I2C,MCCI LTR 329ALS
4 changes: 3 additions & 1 deletion src/CatenaBase.h
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ Copyright notice:
(((major) << 24u) | ((minor) << 16u) | ((patch) << 8u) | (local))

#define CATENA_ARDUINO_PLATFORM_VERSION \
CATENA_ARDUINO_PLATFORM_VERSION_CALC(0, 21, 2, 0) /* v0.21.2 */
CATENA_ARDUINO_PLATFORM_VERSION_CALC(0, 22, 0, 0) /* v0.22.0 */

#define CATENA_ARDUINO_PLATFORM_VERSION_GET_MAJOR(v) \
(((v) >> 24u) & 0xFFu)
@@ -210,6 +210,8 @@ class CatenaBase
fHasSHT3x = 1 << 20,
//platform has I2C Level Shifter
fHasI2cLevelShifter = 1 << 21,
//platform has LTR329 Lux sensor
fHasLuxLtr329 = 1 << 22,

// special wiring variants all are offsets from M100...
// we support up to 127 variants, becuase we have 7
12 changes: 12 additions & 0 deletions src/Catena_Guids.h
Original file line number Diff line number Diff line change
@@ -173,6 +173,10 @@ Copyright notice:
#define GUID_HW_CATENA_4610_M104(f) \
MCCIADK_GUID_GEN_INIT(f, 0xbfed4740, 0xa58a, 0x4ef6, 0x93, 0x3a, 0x09, 0xcb, 0x22, 0xe9, 0x3d, 0x00)

// {5a600501-c3cd-4c3f-bdcc-cd6502abe95a}
#define GUID_HW_CATENA_4610_V2_BASE(f) \
MCCIADK_GUID_GEN_INIT(f, 0x5a600501, 0xc3cd, 0x4c3f, 0xbd, 0xcc, 0xcd, 0x65, 0x02, 0xab, 0xe9, 0x5a)

// {9bb29dca-0685-4837-8182-3dfa309d279f}
#define GUID_HW_CATENA_4611_BASE(f) \
MCCIADK_GUID_GEN_INIT(f, 0x9bb29dca, 0x0685, 0x4837, 0x81, 0x82, 0x3d, 0xfa, 0x30, 0x9d, 0x27, 0x9f)
@@ -213,6 +217,10 @@ Copyright notice:
#define GUID_HW_CATENA_4612_M104(f) \
MCCIADK_GUID_GEN_INIT(f, 0xdea48489, 0xcdac, 0x43f4, 0xb8, 0xad, 0xed, 0xb0, 0x8c, 0xe2, 0x15, 0x46)

// {4330325d-4be8-410a-9b55-0fda4fbd1977}
#define GUID_HW_CATENA_4612_V2_BASE(f) \
MCCIADK_GUID_GEN_INIT(f, 0x4330325d, 0x4be8, 0x410a, 0x9b, 0x55, 0x0f, 0xda, 0x4f, 0xbd, 0x19, 0x77)

// {6767c2f6-d5d5-43f4-81af-db0d4d08815a}
#define GUID_HW_CATENA_4617_BASE(f) \
MCCIADK_GUID_GEN_INIT(f, 0x6767c2f6, 0xd5d5, 0x43f4, 0x81, 0xaf, 0xdb, 0x0d, 0x4d, 0x08, 0x81, 0x5a)
@@ -221,6 +229,10 @@ Copyright notice:
#define GUID_HW_CATENA_4618_BASE(f) \
MCCIADK_GUID_GEN_INIT(f, 0xb75ed77b, 0xb06e, 0x4b26, 0xa9, 0x68, 0x9c, 0x15, 0xf2, 0x22, 0xdf, 0xb2)

// {5a3dbd81-0fd4-428a-93e6-5862b0b35130}
#define GUID_HW_CATENA_4618_V2_BASE(f) \
MCCIADK_GUID_GEN_INIT(f, 0x5a3dbd81, 0x0fd4, 0x428a, 0x93, 0xe6, 0x58, 0x62, 0xb0, 0xb3, 0x51, 0x30)

// {17281c12-d78a-4e4f-9c42-c8bbc5499c91}
#define GUID_HW_CATENA_4630_BASE(f) \
MCCIADK_GUID_GEN_INIT(f, 0x17281c12, 0xd78a, 0x4e4f, 0x9c, 0x42, 0xc8, 0xbb, 0xc5, 0x49, 0x9c, 0x91)
3 changes: 3 additions & 0 deletions src/Catena_Platforms.h
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@ extern const CATENA_PLATFORM gkPlatformCatena4610_m101;
extern const CATENA_PLATFORM gkPlatformCatena4610_m102;
extern const CATENA_PLATFORM gkPlatformCatena4610_m103;
extern const CATENA_PLATFORM gkPlatformCatena4610_m104;
extern const CATENA_PLATFORM gkPlatformCatena4610_v2;
extern const CATENA_PLATFORM gkPlatformCatena4611;
extern const CATENA_PLATFORM gkPlatformCatena4611_m101;
extern const CATENA_PLATFORM gkPlatformCatena4611_m102;
@@ -71,8 +72,10 @@ extern const CATENA_PLATFORM gkPlatformCatena4612_m101;
extern const CATENA_PLATFORM gkPlatformCatena4612_m102;
extern const CATENA_PLATFORM gkPlatformCatena4612_m103;
extern const CATENA_PLATFORM gkPlatformCatena4612_m104;
extern const CATENA_PLATFORM gkPlatformCatena4612_v2;
extern const CATENA_PLATFORM gkPlatformCatena4617;
extern const CATENA_PLATFORM gkPlatformCatena4618;
extern const CATENA_PLATFORM gkPlatformCatena4618_v2;

extern const CATENA_PLATFORM gkPlatformCatena4630;

Loading