287 Commits

Autor SHA1 Nachricht Datum
Reinder Feenstra
373af31565 z21: fixed kernel always firing onEmergenctStop on stop change 2023-12-10 22:18:07 +01:00
Reinder Feenstra
cb23c99940 traintasticdiy: added startup delay, default = 500ms
some devices reset on connect, give them some time to boot
2023-12-06 00:12:16 +01:00
Reinder Feenstra
3a3bee66ba traintasticdiy: fix: hardware io handler dropped bytes of incomplete messages 2023-12-05 23:21:04 +01:00
Reinder Feenstra
a4a1e39c25 traintasticdiy: added loggin of dropped bytes
(untested)
2023-12-05 22:48:37 +01:00
Filippo Gentile
3bd9a876a0 ClientKernel: do not abbreviate variable names 2023-11-06 01:29:23 +01:00
Filippo Gentile
7a2eea573c ClientKernel: make getLocoCache() return reference
It cannot be null
2023-11-06 01:28:47 +01:00
Filippo Gentile
ff428c4b85 LanXLocoInfo: rework max function index support 2023-11-06 01:26:16 +01:00
Filippo Gentile
39eef0f273 ClientKernel: prefix members with m_
Now m_isUpdatingFromKernel

P.S. I'm tired of rebasing!
2023-11-06 01:26:10 +01:00
Filippo Gentile
45cbc58c2a ClientKernel: use Doxygen \note in comment 2023-11-06 01:26:01 +01:00
Filippo Gentile
5b48969fbb server: Z21 ClientKernel prevent speed trend override 2023-11-05 22:43:56 +01:00
Filippo Gentile
379c22c0fc Z21: ClientKernel store last received step in 126 scale 2023-11-05 22:43:55 +01:00
Filippo Gentile
4d36f515ac Z21 ClientKernel: always react to stop and direction
React to Emenrgency Stop and direction change regardless of timeout
status
2023-11-05 22:43:53 +01:00
Filippo Gentile
1e6d350d0b Z21 ClientKernel: do not propagate external changes
Decoder changes caused by Z21 should not be sent back to Z21
2023-11-05 22:32:09 +01:00
Filippo Gentile
5bdbeeb72e WIP: add LocoCache to Z21 ClientKernel 2023-11-05 22:28:54 +01:00
Filippo Gentile
373c277cc7 server: Z21 LanXLocoInfo support F29 to F31
Z21 Firmware 1.42 adds F29 to F31 to LAN_X_LOCO_INFO
2023-11-05 22:28:53 +01:00
Filippo Gentile
50279a12d9 server: Z21 ClientKernel, try/catch when updating decoder 2023-11-05 22:28:52 +01:00
Filippo Gentile
3e3eaca008 server: Z21 handle LAN_X_LOCO_INFO
Handle LanXLocoInfo inside ClientKernel
This allows reacting to external decoder state changes
2023-11-05 22:28:52 +01:00
Reinder Feenstra
174ffd8690
Added stringop-overflow ignore for MinGW 2023-11-04 00:56:51 +01:00
Filippo Gentile
0a5e654df7 server: Z21 use less hardcoded values
- Add new labels for message values
- Remove unneeded Z21 namespace prefix
- Fix newlines after case
2023-11-03 23:11:48 +01:00
Filippo Gentile
52fdb3371e server: Z21 custom checksum for LanXLocoInfo message 2023-11-03 23:11:47 +01:00
Filippo Gentile
14df2a7344 server: Z21 better checksum calculation
- Tweak XpressNet checksum code to accept custom message size
- Renamed LanX::calcChecksum() to LanX::updateChecksum()
- Added LanX::isChecksumValid()
- Internally reuse XpressNet checksum code
- Removed old commented function in LanXGetLocoInfo
2023-11-03 23:11:46 +01:00
Filippo Gentile
313d3b2d57 server: Z21 Use helper functions in ClientKernel
Use helper functions for LanXSetLocoDrive message
2023-11-03 23:11:45 +01:00
Filippo Gentile
2c73473ea8 server: Z21 Utils, fix 28 speed step format 2023-11-03 23:11:44 +01:00
Filippo Gentile
e0d5375a35 server: Z21 fix race condition for power state
- Read/Write track power state only from EventLoop thread
('m_trackPowerOn' and 'm_emergencyStop' must be accessed
only from EventLoop thread, except on kernel start.)

This fixes infinite async loop power on/off at startup connecting Z21
2023-11-03 23:11:44 +01:00
Filippo Gentile
5a291f0c91 server: Z21 ClientKernel fix crash on disconnect
See #53
When disabling communications, kernel object is deleted
but EventLoop callback will run after and access deleted
object through captured 'this'
Temporary fix for this problem is to copy log ID value instead.
2023-11-03 23:11:43 +01:00
Reinder Feenstra
d931591fab fix: added missing include 2023-11-01 17:02:14 +01:00
Reinder Feenstra
8ff6a98dc8 loconet: updated OPC_MULTI_SENSE_LONG
based on documentation from the developer of the message format.
2023-10-21 13:34:19 +02:00
Reinder Feenstra
2d914949cf loconet: corrected multi_sense address, +1 was missing 2023-10-08 17:34:37 +02:00
Reinder Feenstra
395cf14425 loconet: corrected LNCVReadResponse mask
didn't detect response sent by https://github.com/mrrwa/LocoNet library
2023-10-01 23:58:27 +02:00
Reinder Feenstra
ec2f42ba27 refactor: moved common kernel stuff to KernelBase #WIP 2023-09-22 23:07:57 +02:00
Reinder Feenstra
6670c774de refactor: moved common kernel stuff to KernelBase #WIP 2023-09-22 00:39:21 +02:00
Reinder Feenstra
aff3bd5c11 Moved IOHandler TCP connect's to start() to prevent eventloop blocking.
closes #74
2023-09-20 22:30:28 +02:00
Reinder Feenstra
5fb957660b marklin_can: only store MFX UID, map to MFX SID using loklist.
see #11
2023-09-15 22:58:00 +02:00
Reinder Feenstra
f75cd88db9 marklin_can: fix: status data config endian conversion
see #11
2023-09-03 23:54:27 +02:00
Reinder Feenstra
ea4d629362 marklin_can: fix: status data config string decode was using wrong maxLen
see #11
2023-09-03 23:53:29 +02:00
Reinder Feenstra
caf65c3c7e marklin_can: added debug option to save status data config as JSON
see #11
2023-09-03 23:36:54 +02:00
Reinder Feenstra
b2021b8ce6 marklin_can: improved node discovery speed.
reduced retries to 3 (was 11)
reduced retry timeout to 50ms (was 100ms)
see #11
2023-09-03 21:52:15 +02:00
Reinder Feenstra
c33ffac650 marklin_can: added decoding of reading/configuration channels descriptions
see #11
2023-09-03 21:50:17 +02:00
Reinder Feenstra
d85b00ca3e marklin_can: added reading of measurement and configuration channels 2023-09-03 11:36:30 +02:00
Reinder Feenstra
f1f11b77c2 marklin_can: improved (CS2) simulation support
- ping support
- periodic bootstrapCAN messages
- "loks" list download
see #11
2023-08-29 23:36:20 +02:00
Reinder Feenstra
2cbdd56aaf marklin_can: added serial io handler (binary identical to TPC/UDP)
see #11
2023-08-28 18:31:31 +02:00
Reinder Feenstra
6899166fe1 marklin_can: added uid to debug log of system stop/go/halt commands
see #11
2023-08-27 23:51:35 +02:00
Reinder Feenstra
ae8b0cb5ec marklin_can: added debug log of system status commands
see #11
2023-08-27 23:50:36 +02:00
Reinder Feenstra
49623c7d73 marklin_can: improved startup procedure
fisrt discovers nodes, then set accessory switch time and then download the loklist.
see #11
2023-08-27 18:22:19 +02:00
Reinder Feenstra
22d2f16e60 marklin_can: added Traintastic to node list
see #11
2023-08-12 09:12:18 +02:00
Reinder Feenstra
8d2f977a7d added missing include for macOS 2023-08-11 00:43:38 +02:00
Reinder Feenstra
86ab824764 marklin_can: added discovered node list
see #11
2023-08-10 23:36:58 +02:00
Reinder Feenstra
1ff0ab46b9 marklin_can: added import/sync to locomotive list
see #11
2023-08-06 17:21:47 +02:00
Reinder Feenstra
4e5484e031 marklin_can: loklist: added functionen_2 2023-08-06 10:12:52 +02:00
Reinder Feenstra
43b604d8bd marklin_can: loklist: added mm_prg typ for CS3 2023-08-06 10:12:09 +02:00