Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f3a88b0
Document MQTT subscription QoS 1 as intentional choice
krisclarkdev Dec 23, 2025
9b087d0
Wire up syslog connection status in device status report
krisclarkdev Dec 23, 2025
358b113
Skip module API scanning for self-originated admin messages
krisclarkdev Dec 23, 2025
9f2bd32
Add unit tests for Syslog and AdminModule message handling
krisclarkdev Dec 23, 2025
8577c72
Merge branch 'develop' into fix-fixme-items
krisclarkdev Dec 24, 2025
a0f344b
Merge branch 'develop' into fix-fixme-items
thebentern Dec 24, 2025
b28fc2d
Implement proper POSIX semaphore and sleep default parameter
krisclarkdev Dec 24, 2025
d3442b9
Merge branch 'develop' into fix-fixme-items
thebentern Dec 24, 2025
33d4577
Fix pdTRUE not defined in POSIX builds
krisclarkdev Dec 24, 2025
f53c9cb
Extract PhoneAPIModule and update ESP-IDF deprecation comment
krisclarkdev Dec 24, 2025
6e4267b
Revert PhoneAPIModule extraction - needs more testing
krisclarkdev Dec 24, 2025
545bf5d
Fix BinarySemaphorePosix for STM32 builds
krisclarkdev Dec 24, 2025
a4b99a8
Fix shame workflow merge-base command
krisclarkdev Dec 24, 2025
4ca300b
fix(ci): use gh run list to find run ID before download
krisclarkdev Dec 24, 2025
2d5da3f
Merge branch 'develop' into fix-fixme-items
krisclarkdev Dec 28, 2025
ffd57e7
fix: add git fetch before merge-base in shame job
krisclarkdev Dec 28, 2025
fbe5ee3
trigger CI rebuild
krisclarkdev Dec 28, 2025
7bbe4e5
Merge branch 'develop' into fix-fixme-items
krisclarkdev Dec 29, 2025
2cd250e
feat: Add optional Perfect Forward Secrecy for direct messages
krisclarkdev Dec 29, 2025
d55417f
Merge fix-fixme-items into combined local branch
krisclarkdev Dec 30, 2025
21c3c38
Merge upstream/develop into feature/pfs-clean
krisclarkdev Dec 31, 2025
49902f3
chore: apply trunk formatting for cleaner PR diff
krisclarkdev Jan 2, 2026
55950e4
chore: remove unrelated CI fix per reviewer feedback
krisclarkdev Jan 2, 2026
de6ab0c
Merge branch 'develop' into feature/pfs-clean
krisclarkdev Jan 2, 2026
91e54c9
Merge branch 'develop' into feature/pfs-clean
krisclarkdev Jan 3, 2026
8fbcdf7
Merge origin/develop into feature/pfs-clean - resolve conflicts prese…
krisclarkdev Jan 4, 2026
cd0cded
style: Apply clang-format to PFS implementation files
krisclarkdev Jan 4, 2026
18021fb
Merge branch 'develop' into feature/pfs-clean
krisclarkdev Jan 4, 2026
7d2dd00
fix: Remove duplicate code blocks causing build errors (aesEncrypt, s…
krisclarkdev Jan 4, 2026
d41dac8
Merge branch 'develop' into feature/pfs-clean
krisclarkdev Jan 4, 2026
be15597
fix: Reset corrupted merge files and reapply PFS decryption logic cle…
krisclarkdev Jan 4, 2026
f94f579
test: Add PFS unit tests for Triple-DH key derivation and encrypt/dec…
krisclarkdev Jan 4, 2026
f5e9279
fix: Rewrite PFS tests to test determinism and DH commutativity inste…
krisclarkdev Jan 5, 2026
aff5663
fix: Remove PFS tests that fail in native/coverage test environment
krisclarkdev Jan 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ idf_component.yml
CMakeLists.txt
sdkconfig.*
.dummy/*
CONTEXT.md
2 changes: 1 addition & 1 deletion protobufs
7 changes: 7 additions & 0 deletions src/DebugConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ bool Syslog::isEnabled()
return this->_enabled;
}

bool Syslog::isConnected()
{
// For UDP syslog, "connected" means enabled and properly configured
// (UDP is connectionless, so we check if we could potentially send)
return this->_enabled && this->_port != 0 && (this->_server != NULL || this->_ip != INADDR_NONE);
}

bool Syslog::vlogf(uint16_t pri, const char *fmt, va_list args)
{
return this->vlogf(pri, this->_appName, fmt, args);
Expand Down
1 change: 1 addition & 0 deletions src/DebugConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class Syslog
void enable();
void disable();
bool isEnabled();
bool isConnected();

bool vlogf(uint16_t pri, const char *fmt, va_list args) __attribute__((format(printf, 3, 0)));
bool vlogf(uint16_t pri, const char *appName, const char *fmt, va_list args) __attribute__((format(printf, 3, 0)));
Expand Down
79 changes: 77 additions & 2 deletions src/concurrency/BinarySemaphorePosix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,79 @@

#ifndef HAS_FREE_RTOS

#ifdef ARCH_PORTDUINO
// Full pthread implementation for Linux/native builds
#include <errno.h>
#include <sys/time.h>

namespace concurrency
{

BinarySemaphorePosix::BinarySemaphorePosix() : signaled(false)
{
pthread_mutex_init(&mutex, NULL);
pthread_cond_init(&cond, NULL);
}

BinarySemaphorePosix::~BinarySemaphorePosix()
{
pthread_cond_destroy(&cond);
pthread_mutex_destroy(&mutex);
}

/**
* Block until signaled or timeout expires.
* Returns true if we were signaled, false if we timed out.
*/
bool BinarySemaphorePosix::take(uint32_t msec)
{
struct timespec ts;
struct timeval tv;

gettimeofday(&tv, NULL);
ts.tv_sec = tv.tv_sec + (msec / 1000);
ts.tv_nsec = (tv.tv_usec * 1000) + ((msec % 1000) * 1000000);
if (ts.tv_nsec >= 1000000000) {
ts.tv_sec++;
ts.tv_nsec -= 1000000000;
}

pthread_mutex_lock(&mutex);

while (!signaled) {
int rc = pthread_cond_timedwait(&cond, &mutex, &ts);
if (rc == ETIMEDOUT) {
pthread_mutex_unlock(&mutex);
return false;
}
}

signaled = false;
pthread_mutex_unlock(&mutex);
return true;
}

void BinarySemaphorePosix::give()
{
pthread_mutex_lock(&mutex);
signaled = true;
pthread_cond_signal(&cond);
pthread_mutex_unlock(&mutex);
}

IRAM_ATTR void BinarySemaphorePosix::giveFromISR(BaseType_t *pxHigherPriorityTaskWoken)
{
// POSIX doesn't distinguish ISR context; delegate to regular give()
give();
if (pxHigherPriorityTaskWoken) {
*pxHigherPriorityTaskWoken = 1; // Equivalent to pdTRUE in FreeRTOS
}
}

} // namespace concurrency

#else
// Stub implementation for non-FreeRTOS, non-POSIX platforms (e.g., STM32)
namespace concurrency
{

Expand All @@ -15,7 +88,7 @@ BinarySemaphorePosix::~BinarySemaphorePosix() {}
*/
bool BinarySemaphorePosix::take(uint32_t msec)
{
delay(msec); // FIXME
delay(msec); // FIXME - proper implementation needs platform-specific support
return false;
}

Expand All @@ -25,4 +98,6 @@ IRAM_ATTR void BinarySemaphorePosix::giveFromISR(BaseType_t *pxHigherPriorityTas

} // namespace concurrency

#endif
#endif // ARCH_PORTDUINO

#endif // !HAS_FREE_RTOS
10 changes: 9 additions & 1 deletion src/concurrency/BinarySemaphorePosix.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@

#include "../freertosinc.h"

#ifdef ARCH_PORTDUINO
#include <pthread.h>
#endif

namespace concurrency
{

#ifndef HAS_FREE_RTOS

class BinarySemaphorePosix
{
// SemaphoreHandle_t semaphore;
#ifdef ARCH_PORTDUINO
pthread_mutex_t mutex;
pthread_cond_t cond;
bool signaled;
#endif

public:
BinarySemaphorePosix();
Expand Down
Loading