ipc test for fm95

This commit is contained in:
2026-05-03 17:12:22 +02:00
parent 099d9b97e7
commit 69b0ee6d68
4 changed files with 150 additions and 4 deletions
+19
View File
@@ -0,0 +1,19 @@
#pragma once
#include <stdint.h>
#include <pthread.h>
#define IPC_SOCKET_PATH "/tmp/ipc_demo.sock"
#define IPC_BACKLOG 1
typedef void *(*ipc_client_fn)(void *client_fd_ptr);
typedef struct {
int server_fd;
volatile int running;
ipc_client_fn handler;
pthread_t _tid; /* internal — do not touch */
const char* socket_path;
} ipc_ctx_t;
int create_ipc(ipc_ctx_t *ctx, ipc_client_fn handler, const char* socket_path);
void destroy_ipc(ipc_ctx_t *ctx);