Commit Graph

369 Commits

Author SHA1 Message Date
Dom
4c37c21699
make the Prog Button handling in the knx stack deativateable by pin value <0 (#231) 2023-02-20 14:21:11 +01:00
Dom
dce92403e5
32bit eeprom size (#230)
* add commitNonVolatileMemory overload to batch write chars n times to flash

* changed uint8_t getEepromBuffer(uint16_t size) to uint8_t getEepromBuffer(uint32_t size) to allow eeprom > 65k

* reworked PR #230
2023-02-13 21:39:30 +01:00
mumpf
9894a8c8b8
improved/corrected prog button debouncing (#221)
Co-authored-by: Waldemar Porscha <wp@porscha.eu>
2022-11-25 07:24:27 +01:00
mumpf
b51c5950c5
reimplemented binary search for translateAsap() (#220)
* reimplemented binary search for translateAsap()
- new prepareBinarySearch() after association_table change
- fallback to linear search if ETS does not provide sorted ASAP entries
- activated with #define  BIN_SEARCH

* added required comments to explain algorithm

Co-authored-by: Waldemar Porscha <wp@porscha.eu>
2022-11-12 11:23:04 +01:00
mumpf
7bf3696a3b
Feature175 binarysearch (#218)
* #175
added a binary search for address and assoc table
can be enabled by defining USE_BINSEARCH

* Corrected BIN_SEARCH

* AddressTableObject::contains minimal improve

* Review: changed ntohs to htons

* corrected byte order during access to sorted array

Co-authored-by: SirSydom <com@sirsydom.de>
Co-authored-by: Waldemar Porscha <wp@porscha.eu>
2022-10-21 10:03:11 +02:00
Sonnengruesser
a0134e6cfb
RP2040 EEPROM/Flash compiler flag fix (#216)
* RP2040 EEPROM/Flash compiler flag fix

only check flash size if Flash is used, not EEPROM

* RP2040 EEPROM/Flash compiler flag fix

use EEPROM emulation as default to allow build of the knx-demo (memory.h defines EEPROM size 1024 which doesn't work with Flashsize 4k)

* Update rp2040_arduino_platform.h
2022-10-15 22:25:22 +02:00
mumpf
5b48f21f53
get rid of some warnings during build (#214)
(comparison between signed and unsigned integer expressions)

Co-authored-by: Waldemar Porscha <wp@porscha.eu>
2022-10-15 22:24:58 +02:00
mumpf
3bf7f5ce48
remove unnecessary print to console (#213)
Co-authored-by: Waldemar Porscha <waldemar.porscha@sap.com>
2022-07-15 23:11:10 +02:00
Matthias B
8b9ff4fce1
H8I8O (#209)
* Add defines for LED, button and serial port

To make supporting different board layouts easier, this introduces some new defines:

For all platforms:
- `KNX_LED` -  the programming LED, defaults to `LED_BUILTIN`
- `KNX_BUTTON` - the programming button, defaults to `0`

For Arduino platforms:
- `KNX_DEBUG_SERIAL` - the serial port that is used for debugging, defaults to `Serial`
- `KNX_SERIAL` - the serial port used for communication with the TPUART, default depends on platform

* GD32 flash workaround

Addressing #181

At least some GD32 devices seem to require unlocking the flash twice. As the unlock function exits with `HAL_OK` if the flash is already unlocked, STM32 devices can run the same code without issues.

* Add H8I8O and H8C09 configurations to knx-demo

Addressing #181

These configurations both serve as examples for the use of these boards and other custom boards that don't use the standard pinout.

* Add STM32 unlock target

This copies the brute force unlock approach by @pavkriz into a custom target. With this commit, it is possible to automatically unlock e.g. a H8I8O board without leaving the PlatformIO IDE.

See #181
2022-06-08 21:13:34 +02:00
rueckix
bd907c242d
Fix prog button handling (#207)
* Update stm32_platform.cpp

Addresses a side effect of https://github.com/thelsing/knx/pull/177, which causes the eeprom buffer to be overwritten every time getEepromBuffer is called. This prevented programming of STM32 boards as their initial bus address was lost before programming.

* progbutton fix

* Update stm32_platform.cpp

Addresses a side effect of https://github.com/thelsing/knx/pull/177, which causes the eeprom buffer to be overwritten every time getEepromBuffer is called. This prevented programming of STM32 boards as their initial bus address was lost before programming.

* Update knx_facade.h

Remove superfluous attribute _buttonPinInterruptOn

* Update knx_facade.h

attachInterrup on CHANGE for progbutton detection
2022-05-31 07:20:59 +02:00
rueckix
3948045c28
Fix stm32 eeprom handling (#205)
* Update stm32_platform.cpp

Addresses a side effect of https://github.com/thelsing/knx/pull/177, which causes the eeprom buffer to be overwritten every time getEepromBuffer is called. This prevented programming of STM32 boards as their initial bus address was lost before programming.

* Code style fix
2022-04-30 22:15:16 +02:00
croghostrider
eb963583ee
Fix last CodeFactor Style issues (#202)
* fix malformed whitespace

* fix trailing spaces 


fix trailing spaces
2022-04-25 20:30:53 +02:00
mumpf
d43703f7bd
Get rid of occsional fails during ETS programming (#200)
- happens just with large applications
- occured mainly on SAMD platform
- new crc16ccitt algorithm without additional buffer
- reorder groupObjTable in memory for less fragmentation

Co-authored-by: Waldemar Porscha <waldemar.porscha@sap.com>
2022-04-25 19:27:47 +02:00
croghostrider
e12a074e07
Removed redundant declaration (#199)
remove "virtual" where "override" or "final" already implies it.
2022-04-25 11:27:40 +02:00
mumpf
4b8b951be8
FIX issue introduced with #194 (#201)
- if go handler writes to same go, value is not sent to bus anymore

Co-authored-by: Waldemar Porscha <waldemar.porscha@sap.com>
2022-04-25 11:18:57 +02:00
Simon Billemont
29702f69c3
Fix #191 by initializing the platform pointer in all KnxFacade constructors (#198)
* Fix #191 by initializing the platform pointer in all KnxFacade constructors

* Revert "Fix #191 by initializing the platform pointer in all KnxFacade constructors"

This reverts commit adc05cfaf7.

* Alternative fix for #191 by initializing the platform pointer in KnxFacade(&bau) from the platform stored in bau
2022-04-19 09:51:36 +02:00
Simon Billemont
01979174e3
Fixed accedental swap of size parameter and KNX_FLASH_SIZE define introduced in PR #196 (#197) 2022-04-16 22:16:02 +02:00
Simon Billemont
b0153de97f
Fix issue with Esp8266/Esp32 platform reinitializing EEPROM multiple times causing it to forget staged EEPROM changes (#196) 2022-04-13 09:19:18 +02:00
mumpf
9c620a013d
GroupObjects can communicate internally (#194)
* GroupObjects can communicate internally
- GroupObjects use callback infrastructure also during write to bus
- external and internal write of a GO can be handled identically
- needs #define INTERNAL_GROUPOBJECT

* FIX-Works now also if SMALL_GROUPOBJECT is not set

* Remove #ifdef INTERNAL_GROUPOBJECT

Co-authored-by: Waldemar Porscha <waldemar.porscha@sap.com>
2022-04-12 00:28:21 +02:00
mumpf
2453c3ce5d
Forgotten init for PR #187 (#195)
Co-authored-by: Waldemar Porscha <waldemar.porscha@sap.com>
2022-04-06 21:36:36 +02:00
mumpf
22af8267c3
Openknx version support (#190)
* Feature: Allow additional version check on startup
- added versionCheckCallback
- added apiVersion to DeviceObject
- added new versionCheck to memory,cpp

* updated source code formatting

* changes for PR
- (old) version is again part of version check
- naming conventions

* forgotten parameter in callback

* correct wrong buffer initialization

* version <-> apiVersion swapped

Co-authored-by: Waldemar Porscha <waldemar.porscha@sap.com>
2022-03-02 13:38:30 +01:00
mumpf
a10fa20bde
Feature: additional callbacks for application (#189)
* Feature: additional callbacks for application
- beforeRestart callback
- beforeTablesUnload callback

* naming conventions for PR

Co-authored-by: Waldemar Porscha <waldemar.porscha@sap.com>
2022-03-01 21:42:03 +01:00
mptei
145c354110
Removed unneded TX_WAIT_ECHO state; fixed echo detection (#188) 2022-03-01 17:30:54 +01:00
mumpf
4f17ed4b5d
Feature: Uninitialized GO handling (#187)
- don't send senseless values on GroupValueRead

Co-authored-by: Waldemar Porscha <waldemar.porscha@sap.com>
2022-03-01 17:28:11 +01:00
mptei
f4d7f604be
Handling buffer overrun (#184) 2022-02-26 22:41:23 +01:00
SirSydom
1f079147c0
solves #183 (#185)
get the unique id directly from flash instead using the async. SDK call.
2022-02-26 22:40:17 +01:00
mumpf
c47a8b06c8
- Get rid of EEPROM emulation (#186)
- Use SAMD-Flash without copying parameters to RAM

Co-authored-by: Waldemar Porscha <waldemar.porscha@sap.com>
2022-02-26 22:39:21 +01:00
mptei
9c48027d3c
Using defines in ACK handling (#182)
* Using defines in ACK handling

* added newline
2022-02-24 21:23:57 +01:00
SirSydom
d27f420217
solves #178 bugfix when sending frames > 63 byte, missing masking of … (#179)
* solves #178 bugfix when sending frames > 63 byte, missing masking of upper bits after sending a U_DataOffset

* also masked U_L_DATA_END_REQ correctly

* used bit masking instead of %
2022-02-24 10:13:02 +01:00
SirSydom
a306174878
Branch flash pr with large eeprom (#177)
* save WIP on flash api + header reorder

* reduce diffs to master

* added support for RP2040 (Raspberry Pi Pico)

* support DPT9.009 (airflow) and DPT9.029 (absolute humidity)

* added support for RP2040 (Raspberry Pi Pico) (#145)

* worked on flash implementation

* worked on flash implementation

* added malloc for _EraseBlockBuffer, fixed some bugs

* fixed memoryread and crash while loading KOs (+debugstuff)

* some fixes and debugs

* align to pagesize

* clean up debug stuff, comments ...

* added support for both Eeprom and Flash (NvMemoryType) plattforms.

* changed memoryReadIndicationP to memoryReadIndication
added stdlib and defines

* fixed std::min

* another try for fixing the min problem

* rolled back linux plattform to eeprom

* comments only, hints for plattforms

* bugfix when calculating memorywrites over multiple blocks by mumpf

* added support for EEPROM-Emulation / RAM-buffered Flash
improvements in RP2040 plattform

* fixed typo in KNX_FLASH_OFFSET

* - writebuffersize clarified (PR discussion)
- changed alignment from flashpagesize to 32bit
- added override modifier (PR discussion)
- changed comment regarding flash/eeprom functions for plattforms to override/implement (PR discussion)

* resolved CodeFactor issue

Co-authored-by: Thomas Kunze <thomas.kunze@gmx.com>
2022-02-22 14:24:36 +01:00
Michael Geramb
53425e2ef7
Add callback functions for prog mode and improve documentation (#173) 2022-02-19 20:23:50 +01:00
thelsing
d26771c432
Merge pull request #171 from mptei/tx_throttle_rx_wait_addr
More tpuart fixes
2022-02-13 21:56:03 +01:00
SirSydom
2c2d69a396
Rp2040 plattform newcore (#172)
* added support for RP2040 (Raspberry Pi Pico)

* support DPT9.009 (airflow) and DPT9.029 (absolute humidity)

* adapted to work with the latest arduino-pico core V1.11.0
- setPollingMode for knxSerial
2022-02-13 21:54:38 +01:00
Mike Pieper
408cd2bbeb printHex takes to long 2022-02-13 11:22:02 +01:00
Mike Pieper
c908d5dc0a handle all available bytes 2022-02-06 14:13:48 +01:00
Mike Pieper
7d7e6eb3b4 New state RX_L_ADDR; loop load adaption 2022-02-06 07:55:34 +01:00
Mike Pieper
1ee4377e61 tx throttle. 2022-01-22 15:20:27 +01:00
mptei
6720f86e5c
Changed color byte order from WRGB to RGBW (R MSB). (#168) 2022-01-19 14:51:00 +01:00
dev-git-usr
36e0a00e80
Added Datapointtype DPT 7.600 (colortemperature) (#165)
* Added Datapointtype DPT 7.600 (colortemperature)

* Added Decoding of Datatype
2022-01-16 18:56:00 +01:00
mptei
71e8607f43
Added support for DPT 251.600 RGBW (#167)
* Added support for DPT 251.600 RGBW

* style fix
2022-01-16 18:26:51 +01:00
mptei
f5feefb0f2
TPUART: Avoid false EOP (#166)
* Made the rx loop shorter to avoid tx buffer saturation.

* sendSingleFrameByte return false on last byte

* sendSingleFrameByte return false on last byte
2022-01-16 18:25:32 +01:00
croghostrider
bf70e162f8
fix constant comparison (#162)
* fix constant comparison

* .
2021-12-29 17:20:46 +01:00
mptei
12d0ea1ad8
Use full duplex in tpuart_data_link_layer. (#161)
* TPUART full duplex handling

* Stay in loop when RX_L_DATA.
2021-12-28 19:53:48 +01:00
Domos
fb74931bec
Add 2 new methods: paramSignedByte and paramBit. Comments and usage inside code (#159) 2021-12-23 20:04:34 +01:00
mptei
eb7ae16dde
Returning correct value for ULongType. (#157) 2021-12-22 20:00:27 +01:00
mptei
63ff2c5d4d
Removed doubled code (#158) 2021-12-22 19:59:55 +01:00
rueckix
616599cf8b
Fix EEPROM include on STM32 (#151)
The structure of the stm32 arduino core changed (https://github.com/stm32duino/Arduino_Core_STM32/tree/main/libraries/EEPROM/src).
stm32_eeprom.h was moved to a subfolder. Instead, we can now include (and potentially use later), the `EEPROM.h` header.
2021-10-17 18:19:45 +02:00
SirSydom
57b1950e38
support DPT9.009 (airflow) and DPT9.029 (absolute humidity) (#149)
* added support for RP2040 (Raspberry Pi Pico)

* support DPT9.009 (airflow) and DPT9.029 (absolute humidity)
2021-09-22 23:51:21 +02:00
SirSydom
4f6c837b78
added support for RP2040 (Raspberry Pi Pico) (#145) 2021-07-08 19:45:33 +02:00
croghostrider
31e35695e6
fix wrong IP (#142) 2021-06-08 20:27:33 +02:00
croghostrider
59d1b67d6c
add KNX IP discovery support (#141)
for ESP8266 and ESP32
2021-06-04 17:23:23 +02:00
croghostrider
14462d410d
Change individual address (#140)
to 15.15.255
2021-06-02 17:53:46 +02:00
etrinh
75c863bffe
Add new KNX_NO_STRTOx_CONVERSION define for footprint reduction (#137)
* Remove uniqueSerialNumber debug log to reduce footprint

* add KNX_NO_STRTOx_CONVERSION to avoid expensive strtod conversion
2021-05-12 13:03:10 +02:00
OutOfSync1
ed54da7089
fix some typos (#136)
* removed one section that was duplicate in dptconvert.cpp
2021-05-04 16:19:29 +02:00
OutOfSync1
95cf9df7fc
fix userdata saverestore (#133) (#135)
* set saveSize at compile time

* make sure USERDATA_SAVE_SIZE is set to valid value
2021-05-04 16:17:27 +02:00
etrinh
a4e74ebae5
Remove uniqueSerialNumber debug log to reduce footprint (#134) 2021-04-17 11:12:19 +02:00
OutOfSync1
14162fb1a4
fix userdata saverestore (#133)
* * fix for save/restore of userdata

* change declaration of restore() in knx_facade.h to "const uint8_t* restore(const uint8_t* buffer)" to avoid calling default implementation in save_restore.h

* change typedefs to separate SaveCallback and RestoreCallback

* fix BME60 example, knx.setRestoreCallback() needs to use const uint8_t* as well

* fix commitToEeprom for ESP32

* trigger dirty flag for ESP32 to make sure data is committed
2021-04-14 23:46:03 +02:00
OutOfSync1
1343ed0b7d
fixes to enable partial programming (#132)
* fixes to enable partial programming (thanks to mumpf and proggerKA at KNX-UF!)

* add PID_MCB_TABLE to TableObject

* add CallBackProperty to send PID_MCB_TABLE

* calculate crc checksum using Crc16Citt when state switches to LOAD_COMPLETED

* add crc to save(), restore() and saveSize() to save crc to flash

* add CallBackProperty for read and write of PID_PROG_VERSION to ApplicationProgramObject

* create overrides for save, restore, and saveSize in ApplicationProgramObject to save _programVersion to flash

* improve crc calculation

* removed TableObject::crc16Citt method and use the one in bits.h

* do not save crc in flash, instead calculate on-the-fly in CallbackProperty when state==LS_LOADED

* use DataProperty to store PID_PROG_VERSION

* WARNING: segmentSize calculation for crc calculation is currently not correct. Need to somehow access size of data in class that inherits from TableObject (e.g. ApplicationObject or RouterObject)

* fix segment size in TableObject()

* save size after TableObject::allocTable() is called. Also change save() and restore() to save _size to flash. Modify saveSize()

* use _size to calculate crc value in CallbackProperty

* reduce footprint, save 5 byte

* add comment why _size field is needed

* remove PID_MCB_TABLE from RouterObject

* this is now implemented in TableObject
2021-04-14 23:44:12 +02:00
OutOfSync1
e57bbf9dbe
generate unique serial number (#90) (#131)
* generate unique serial number (#90)

* see https://github.com/ricaun/ArduinoUniqueID

* calculated from ESP.getEfuseMac() on ESP32

* ESP.getChipId() on ESP8266

* SERIAL_NUMBER_WORD_0-3 on SAMD

* HAL_GetUIDw0-2() on STM32

* defaults to 0x01020304 on other platforms

* fix variable name for ESP platform

* another fix variable name for ESP platform (need more coffee...)
2021-04-12 11:40:56 +02:00
etrinh
036bd54c79
Tweak for Ram usage (#129)
* Add KNX_NO_DEFAULT_UART to avoid default uart assignation for ArduinoPlatforms and derivatives, with associated defines (HWSERIAL_NONE for stm32) to recover RAM from unused RX/TX buffers
Remove ArduinoPlatform(HardwareSerial* knxSerial) constructor, seems not useable by KnxFacade

* Restore ArduinoPlatform::ArduinoPlatform(HardwareSerial* knxSerial) constructor

* revert xxxPlatform(HardwareSerial* s) constructors
2021-04-01 09:34:26 +02:00
etrinh
446ea1b9aa
Fix int32 -> KNXValue conversion (#128)
Add KNX_NO_SPI to reduce footprint
2021-03-11 20:31:09 +01:00
etrinh
44075d80f7
Add KNX_NO_PRINT to define in project to avoid console info and reduce footprint (#127) 2021-03-11 09:38:06 +01:00
mumpf
164bf59166
added alternative GroupObject with less mangagement footprint (#125)
* corrected float with DPT9

* Switch Programming-LED also via Bus/ETS

* Again: Prog-LED switchable from bus/ETS

* DPT16 (to bus) implemented

* - added SMALL_GROUPOBJECT

* - added knx-demo-small-go example
- added config.h option (commented)
- changed platformio-ci.ini with -DSMALL_GROUPOBJECT
- changed plantformio.ini with tested -DSMALL_GROUPOBJECT

* - removed duplicate files

Co-authored-by: Waldemar Porscha <waldemar@porscha.eu>
Co-authored-by: Waldemar Porscha <waldemar.porscha@sap.com>
2021-02-18 09:40:35 +01:00
Thomas Kunze
cddef776f7 move MAX,MIN,ABS to bits.h 2021-02-08 20:54:49 +01:00
Dennis Fleurbaaij
f169e20f2f
opt-out global KNX, ability to DIY construct knx object, minor cleanups (#121)
* Refactored the knx_facade a bit to make the auto-building of the global knx object and the buttonUp() ISR function opt-in. Also added the ability to quite easily attach another serial (in this case tested with Serial2 of an ESP32).

* Added visual studio code temp files to .gitignore

* Fix for missing build flag for WifiManager in ESP32_ip demo

* Added example in which we DIY build the KNX object and use ESP32's second UART to connect so that you can debug with the first one that's connected to USB.

* Minor platform cleanups to remove compilation warnings.

* ESP32 can't handle the defaulted 8192 byte EPROM. Next to that I needed to begin() the eprom lib in my setup() to get it to work and that requires knowing how much memory KNX will use. This fix makes the default more conservative and moves it's definition to the .h file so that other files can always use it as well.

* After comments from thelsing, inverted the logic. The default global knx object is now opt-out by defining KNX_NO_AUTOMATIC_GLOBAL_INSTANCE. See the knx-demo-diy project for an example.
Minor syntactic cleanups.

* Removed hardwareserial from facade (detail which was not needed)
Placed facade constructors together
Minor syntactic cleanup

* Fixed knx-cc1310 where own button routine was calling now private internal knx facade variable.
Renamed files in knx-demo-diy
Minor syntactic stuff

* Added gitattributes for binary knxprod files
2021-02-05 15:57:45 +01:00
rueckix
742e7a1ee7
Fixing metadata size (#119) 2021-01-08 14:06:54 +01:00
rueckix
d46b51fd4f
Fix ambiguous call to attachInterrupt (#118)
* Fix ambiguous call to attachInterrupt
in new SAMD arduino core

* select attachInterrupt
signature based on Arduino version
2021-01-08 14:06:13 +01:00
rueckix
73df7fd28c
Fix: "bool BauSystemBCoupler::configured()" (#112)
* Fix: "bool BauSystemBCoupler::configured()"
always returns false when KNXSecure is not supported/configured in ETS

* Update platformio-ci.ini

activate optional  USE_DATASECURE

* Update platformio-ci.ini

activate optional  USE_DATASECURE

* Update platformio-ci.ini

activate optional  USE_DATASECURE
2020-12-10 19:17:45 +01:00
rueckix
8405d1f47d
Adding std::function support for SAMD (#113) 2020-12-09 19:45:13 +01:00
Thomas Kunze
24c27815cf fix build 2020-11-18 18:39:35 +01:00
Thomas Kunze
9dd7aeb353 add masks for esp8266 2020-11-18 17:56:19 +01:00
Thomas Kunze
2aecc213ff Rename DataSecurity enums; conflict with Wifimanager 2020-11-18 17:46:47 +01:00
nanosonde
eab31e7808
Finish RX on cancelled RX_CmdAdv if we issued hard abort due to crc16/address mismatch (#105) 2020-11-17 21:08:53 +01:00
nanosonde
abb37c3b63
Add warning message in TP-UART data link layer (#104)
* Fix address type bug in TP-UART data link layer

* Fix address check

* Fix blank
2020-11-17 17:57:51 +01:00
nanosonde
390ca8ccfb
Remove unused array (#103) 2020-11-17 17:55:46 +01:00
Thomas Kunze
d962da414d another bugfix try for #83 2020-11-17 17:49:54 +01:00
nanosonde
04e95b2100
Add TI code composer project files for CC1310 example (#101)
* Remove required HEAP size

* Add Code Composer Project files

* Add default debug print to UART

* Update .cproject

* Add README.md
2020-11-16 21:23:16 +01:00
thelsing
389201cf8a
fix build 2020-11-16 20:39:03 +01:00
Thomas Kunze
45158bb071 also ack indivisual broadcasts 2020-11-16 20:35:08 +01:00
ali esmaeilpour
083d83f777
Add float type for parameters & a few fixes (#95)
* Fix not-relative include

throws if a include directory is not set.

* add forgotten defined() in environment checking '#elif's

* fix mis-spelled "config.j"

* Add float type support to Parameters

All 3 encodings supported.

* Using dptconvert functions to handle parameters handling
2020-11-11 22:55:35 +01:00
Thomas Kunze
c167305a87 set valid default value for routing count 2020-11-11 22:51:23 +01:00
nanosonde
d90843ba45
Add support for CC1310 platform based on SimpleLink SDK (#94)
* Initial commit

* Clean up

* Remove display code

* Change cmake build

* Add SimpleLink SDK for CC13xx/CC26xx as submodule

* Remove commented line from build.sh

* Working build

* Remove SDK submodule

* Squashed 'examples/knx-cc1310/coresdk_cc13xx_cc26xx/' content from commit 0d78d32

git-subtree-dir: examples/knx-cc1310/coresdk_cc13xx_cc26xx
git-subtree-split: 0d78d3280357416a5c0388148cda13717c9ffaa5

* Add more comments and enable Power_idleFunc() for NoRTOS variant.
Internal SDK driver functions which have to wait for something
will cause Power_idleFunc to be called instead of doing busy wait.

* Move CC1310 platform init around

* Optimize a bit more in debug build config as the binary does not fit into 128Kb flash otherwise.

* Explicitly list each source/header file in build config. Use linker group to resolve circular dependencies.

* Ignore vscode settings.json

* Increase stacks size

* Only compile CC1310 source code if #define DeviceFamily_CC13X0

* initial commit of CC1310 RF driver with first working RX version

* Better handling of buttonUp() across platforms

* Start cleanup

* continue cleanup

* Fix bau2920 compilation

* Continue cleanup

* Fix compilation in other examples

* Fix compilation

* htons() and ntohs() only for SAMD and STM32, but not for Linux and ESP8266 and ESP32

* htons(9 and ntohs() needed for CC13x0

* Continue cleanup

* Add CC1310 platform to CI

* Fix CI

* Use more recent toolchain from ARM

* Fix travis

* Use Ubuntu Focal

* Fix toolchain for travis

* Fix package name

* Fix toolchain

* Add libstdc++-dev package

* Add newlib packages

* Remove commented commands from CI

* Fix travis

* Fix compilation of knxPython

* Clean up linefeeds

* Fix RX callback

* Move RF CRC16-DNP to bits.cpp

* Fix TX

* Optimization: do not calc CRC for block1 again in rf_data_link_layer

* Make newline optional in printHex

* Cleanup. First working version: ETS5 programming of individual address via KNX/RF coupler.

* Use LEDs and Buttons to control ProgMode and Flash Erase

* Remove settings.json (VScode)

* Add README.md

* Update README.md

* Update README.md

* Fix typo
2020-11-10 21:52:38 +01:00
Dominik Westner
5451235368
Nikwest (#100)
* fixed tipo: RepititionAllowed

* fixed typo: frameRecieved

* fixed typo: individualAddressDuplication

* fixed typo: induvidualAddress

* fixded Typo: InduvidualAddress

Co-authored-by: Dominik Westner <nikwest@github.com>
2020-11-09 20:20:21 +01:00
Thomas Kunze
87a495bf7a replace gmtime with gmtime_r 2020-10-28 22:45:35 +01:00
nanosonde
aabc61dc3b
Add UART support for Linux platform to use TP1 KNX transceivers (#88)
* Add inital serial port support for Linux platform

* Add missing print implementation for uint64_t and enable mask 07B0 for Linux platform using TPUART

* Create executable per mask

* Add one executable per mask for coupler
2020-09-11 13:32:29 +02:00
nanosonde
77a796a39c
Add coupler support (#79)
* save work.

* save work

* save work

* save work

* save work

* Remember which interface received the cemi frame

* save work

* save work

* save work

* Use default value from PID_ROUTING_COUNT

* Add simple alternative to std::function without smart pointers or move semantics

* Remove include

* Add more comments about cleanup

* save work

* Remove forgotten code.

* Move crc16Ccitt to bits.c as it also used for PID_MCB

* save work

* move comment

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* derive from TableObject instead of InterfaceObject

* save work

* save work

* Fix wrong pointer arithmetic in TableObject

* Filter table setting/clearing

* move comment

* save work

* save work

* save work

* handle SBC on closed media

* save work

* move coupler example to different dir

* Restore device example for linux

* save work

* Remove MEDIUM_TYPE and use MASK_VERSION

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* Replace MEDIUM_TYPE by MASK_VERSION

* Remove adafruit/travis-ci tests

* Disable travis ci cache for platformio

* Fix missing changes

* Fix cemi server and add missing MASK_VERSION definitions

* Enable platformio caching on travis ci again

* Handle device address update for routing decision

* source address is set in network layer and not in data link layer

* Add remaining APCI types that are used with system broadcast

* Add debug print for routing

* Remove simple_functional

* Fix CMakLists.txt

* Use MASK_VERSION to conditionally compile code.

* Remove fixed version reuqirement from platform esp8266

* Add demo-coupler for MCUs

* Remove simple_functional.h from demo knx-linux

* Enable CI for coupler demos

* Correct path for knx-linux-coupler

* Fix knx_facade.h

* Refactor NetworkLayer to use getInterface() for devices and getPrimaryInterface(), getSecondaryInterface() for couplers

* Add platformio configs for other currently possible mask/platform combinations

* Add class diagrams and remove obsolete includes

* Add some minimal docs
2020-09-06 21:41:34 +02:00
etrinh
52d3866e41
Try fixing a crash due to NULL derefence (#77)
* fix crash due to NULL _sendBuffer

Co-authored-by: etrinh <etrinh@zdionline.net>
2020-07-19 13:37:42 +02:00
thelsing
ffea53614b
Revert last commit. 2020-07-19 13:36:33 +02:00
thelsing
1f918d69c1
fix #78 2020-07-18 13:47:54 +02:00
nanosonde
96884f768e
Add support for KNX data secure (#66)
* initial comic

* save work

* Handle SystemBroadcast and Broadcast for TP and IP

* Rework

* Fix comment

* save work

* save work

* save work

* save work

* save work

* Restore old broadcast structure

* Readd systembroadcast methods

* Make sure that services from SystemBroadcast are also available from Broadcast on closed media

* save work

* Save work

* save work

* Save work

* save work

* save work

* save work

* save work

* save work

* Change maximum number of elements for the key tables, etc.

* save work

* First working seqno sync with ETS

* save work

* save work

* save work

* save work

* save work

* save work

* Remove magic value and add comment

* save work

* Extend restart and masterreset for factory reset

* save work

* First working secure broadcast mode with IA programming

* Add FunctionPropertyExt* AL services

* Fix FunctionPropertyExt*. Working T_DATA_CONNECTED with FunctionPropertyExt*.

* Add PropertyValueExt* AL services. Handle master reset in AL service RESTART.

* Fix FunctionPropertyExtStateRead, fix restart. MILESTONE: Working physical programming of IA and toolkey with confirmed restart. Reading deviceinfos working.

* Handle PDT_CONTROL in FunctionPropertyExt*

* Fix FunctionPropertyExt* and FunctionProperty for PDT_CONTROL

* Change comment.

* save work

* save work

* Add group object security handling

* Move map to own file

* use simple_map

* Include simple_map.h in CmakeFile

* Move code from header to source file

* Remove obsolete code

* MILESTONE: working programming of secure device with IA and tables

* cleanup

* bugfix

* flashSize must be big enough. Security IF object contains a lot more data.

* Merge master into feat_datasecure

* Revert "Merge master into feat_datasecure"

This reverts commit 0c8358692a.

* Revert "Revert "Merge master into feat_datasecure""

This reverts commit aa59253785.

* Bugfixes

* cleanup

* cleanup

* Add printing of uint64_t

* Don't compile secapplayer if data secure not enabled

* pin platform for ESP8266 to specific version

* SecIfObject: save/restore required for persisting STATE. Bugfix: use correct PID for group key table

* Cleanup comment and debug output

* Further cleanup.

* Refactor master reset

* Remove unused IP data link layer test code

* Only reset TOOL kkey to FDSK on factory reset

* Modify .gitignore and remove vscode config file

* Correct comment

* Handle SBC flag (systembroadcast) in SCF field. Couplers between open and closed media need this.

* Remove code that slipped in.
2020-07-06 19:16:54 +02:00
nanosonde
8cfd67662f
Bugfixes for property startIndex 0 and PID_IO_LIST (#75)
* Bugfix for property entry 0 and PID_IO_LIST

* Remove unsused method

* Fix comment and add missing size adjustment in other method

* Callback properties must return valid data on startIndex 0. The return value must contain the actual element count within the property.
2020-07-05 12:11:44 +02:00
thelsing
6cd030203a
Update data_property.cpp 2020-07-03 00:47:29 +02:00
etrinh
fda8e64425
Add support for lambda for more platforms (#74)
* Fix Stm32 Eeprom handler
Fix missing parenthesis
Fix some type consistencies

* Fix #73
Add ability to override config.h with define NO_KNX_CONFIG

* change tabs to space

* coding style

* Allow lambda on platforms which support it, can be forced with HAS_FUNCTIONAL 0/1

* remove automatic detection of functional due to breakage with some platforms:
In file included from /home/travis/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/char_traits.h:39:0,
                 from /home/travis/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/string:40,
                 from /home/travis/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/stdexcept:39,
                 from /home/travis/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/array:39,
                 from /home/travis/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/tuple:39,
                 from /home/travis/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/functional:54,
                 from /home/travis/arduino_ide/libraries/Adafruit_Test_Library/src/knx/group_object.h:37,
                 from /home/travis/arduino_ide/libraries/Adafruit_Test_Library/src/knx/group_object_table_object.h:4,
                 from /home/travis/arduino_ide/libraries/Adafruit_Test_Library/src/knx/bau_systemB.h:8,
                 from /home/travis/arduino_ide/libraries/Adafruit_Test_Library/src/knx/bau07B0.h:4,
                 from /home/travis/arduino_ide/libraries/Adafruit_Test_Library/src/knx_facade.h:12,
                 from /home/travis/arduino_ide/libraries/Adafruit_Test_Library/src/knx.h:86,
                 from /home/travis/build/thelsing/knx/examples/knx-bme680/knx-bme680.ino:4:
/home/travis/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
                                                        ^
/home/travis/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
                                                        ^
To be investigated...

Co-authored-by: etrinh <etrinh@zdionline.net>
2020-07-01 10:39:30 +02:00
etrinh
f880114da5
Stm32 port (#71)
* Fix Stm32 Eeprom handler
Fix missing parenthesis
Fix some type consistencies

* Fix #73
Add ability to override config.h with define NO_KNX_CONFIG

* change tabs to space

* coding style

Co-authored-by: etrinh <etrinh@zdionline.net>
2020-06-30 14:58:53 +02:00
Thomas Kunze
4677044f46 add some fixes and enhancements by leoujz
fix build
2020-06-25 20:36:02 +02:00
Thomas Kunze
87a12fa26a Merge branch 'master' of https://github.com/thelsing/knx 2020-06-24 23:03:21 +02:00
Thomas Kunze
f450d87d05 refactor RfMediumObject to use properties 2020-06-24 23:03:12 +02:00
thelsing
eacc944e7c
remove __has_include because of build failure 2020-06-24 22:14:45 +02:00
thelsing
084657cb7a
fix #46 2020-06-24 18:48:55 +02:00
thelsing
5855f35eef
fix #50 2020-06-23 00:21:00 +02:00
thelsing
d3788d3ee4
Merge pull request #68 from etrinh/master
Merge STM32 platform
2020-06-23 00:15:18 +02:00
thelsing
2ff07d29e3
Update bits.h 2020-06-18 11:26:59 +02:00
nanosonde
cadc6c6124
Refactor broadcast/systembroadcast (#62)
* Add missing source files

* Fix comment

* Refactor Broadcast/SystemBroadcast

* Add empty confirm methods

* Remove unclean solution to suppress warning about unsed var

* Restore old structure

* Fix issues

* Add more missing source files

* Make sure that services from SystemBroadcast are also available from Broadcast on closed media

* Make sure that sent broadcast/systembroadcast frames are always marked as broadcast frames on closed media
2020-06-09 21:06:13 +02:00
Nanosonde
918d3f37c4 Fix compilation. 2020-06-08 11:14:56 +02:00
Nanosonde
86c8f359e3 Add support for Function Properties 2020-06-08 11:04:00 +02:00
Thomas Kunze
5f4f86dcbd add platformio file and fix compiling without IP 2020-05-08 01:50:50 +02:00
Thomas Kunze
c97bcc29f3 comment some debugging code 2020-05-07 20:15:15 +02:00
etrinh
217794d219 Merge branch 'master' of https://github.com/thelsing/knx 2020-05-02 17:33:54 +02:00
Thomas Kunze
ed5dc73984 fix overrides of bau27b0 2020-05-02 11:43:02 +02:00
etrinh
d789fb1459 Enable TP medium for ESP32 2020-04-07 18:24:28 +02:00
etrinh
0f99a4c969 Fix compilation warning
STM32 uses TP
2020-04-02 22:10:50 +02:00
etrinh
ced8aa0a31 Fix conflicts with STM32 DADDR, knx DADDR rename DEVADDR 2020-04-02 18:25:52 +02:00
etrinh
34df27ee87 fix bad commit 2020-04-02 18:16:15 +02:00
etrinh
147a3942ad Add priliminar Arduino STM32 port 2020-04-02 18:09:53 +02:00
Thomas Kunze
894a54fa7f enable RF and TP 2020-03-12 21:34:00 +01:00
Thomas Kunze
445bf05f93 fix bug in save code 2020-02-11 22:16:59 +01:00
Thomas Kunze
4dda99b341 only add rf props ifdef USE_RF 2020-01-11 21:20:25 +01:00
Thomas Kunze
82f463f965 refactor cemi server object 2019-12-28 10:56:33 +01:00
Thomas Kunze
1465cb558c split USE_USB from USE_CEMI_SERVER 2019-12-28 09:54:02 +01:00
Thomas Kunze
e2fd20ab9a implement knx-ip searchresponse 2019-12-28 00:29:17 +01:00
Thomas Kunze
02a24ea3b8 move #endif 2019-12-27 10:47:22 +01:00
Thomas Kunze
6ae000482f - add some knx-ip classes
- return no data if Property has no elements
- implement get{ipAddress, netmask, defaultGw, macAddress) for linux platform
2019-12-27 02:06:10 +01:00
Thomas Kunze
8f61ef8608 fix length of PDT_VERSION 2019-12-22 17:45:24 +01:00
Thomas Kunze
d3d95f1185 add object for routing indication packet 2019-12-22 17:31:33 +01:00
Thomas Kunze
f8e2da00a2 refactor device object, add more const to functions 2019-12-21 17:48:46 +01:00
Thomas Kunze
729c06357a bugfixing 2019-12-18 22:14:56 +01:00
Thomas Kunze
ca27ff4ab3 bump device object version to invalidate flash (format change) 2019-12-18 21:38:41 +01:00
Thomas Kunze
15bd076c28 Merge branch 'master' of https://github.com/thelsing/knx 2019-12-18 21:28:01 +01:00
Thomas Kunze
6cd570e162 refactore TableObject classes to use Property class 2019-12-18 21:27:54 +01:00
nanosonde
1d01317845 Travis knx usb (#48)
* Update .travis.yml

* Update platformio.ini

* Update .travis.yml

* Fix compilation

* Change platformio config

* Try to fix travis build

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* Add new pio config for CI

* save work

* save work

* save work

* save work

* Try to fix CI run for example knx-linux

* Fix compilation

* Try to fix ESP8266 compilation

* Do not enable cEMI server per default. Is only enabled during platformio build externally
2019-12-16 19:52:10 +01:00
Thomas Kunze
b9571112d6 add some convienience methods to Property class 2019-12-12 23:40:03 +01:00
Thomas Kunze
398ba7408b get rid of InterfaceObject::objectType() and BauSystemB::descriptor() 2019-12-12 23:06:46 +01:00
Thomas Kunze
515d18fdbf fix property save 2019-12-12 22:47:54 +01:00
Thomas Kunze
6765add06d move knx-linux and knxPyton to examples dir 2019-12-12 21:42:51 +01:00
Thomas Kunze
d2b6653d68 add config.h and USE_IP USE_TP USE_RF macros 2019-12-12 21:23:37 +01:00
Thomas Kunze
4cc8b2bb36 Finish refactoring of IpParameterObject 2019-12-12 19:34:29 +01:00
Thomas Kunze
e128debabb convert CallbackProperty to template 2019-12-12 01:42:56 +01:00
Thomas Kunze
71448efdad add overrides keyword for all interface objects.
refactor properties more
2019-12-11 23:32:57 +01:00
Thomas Kunze
396994c1a5 add Property, DataProperty and CallbackProperty classes 2019-12-11 22:23:21 +01:00
Thomas Kunze
c64b7f6a01 change signature of propertyRead/Write 2019-12-10 23:42:27 +01:00
Thomas Kunze
10b83b46bc fix build 2019-12-10 23:00:25 +01:00
Thomas Kunze
cd0fdc85b6 rename sendBytes ->sendBytesMultiCast
readBytes -> readBytesMultiCast
2019-12-10 22:29:14 +01:00
Thomas Kunze
d6db6a9673 add default noop implementations for most stuff of platform. 2019-12-10 22:25:33 +01:00
Thomas Kunze
5d8264555a remove unused methods of Platform class 2019-12-10 21:44:23 +01:00
Thomas Kunze
aa230ee0b9 Merge master 2019-12-09 23:28:17 +01:00
Thomas Kunze
3ed796ef93 fix more memory bugs 2019-12-09 23:19:13 +01:00
nanosonde
a76fc31b80 Add cEMI Server with KNX USB HID support (#47) 2019-12-09 19:53:08 +01:00
Thomas Kunze
77a0d6fc2e save work 2019-12-01 21:47:29 +01:00
Thomas Kunze
75958ec52a get rid of dynamic cast, because we have no rtti on arduino 2019-11-05 17:43:28 +01:00
Thomas Kunze
d3cb967216 16 bit for blocksize should be enough 2019-11-04 21:56:49 +01:00