RPi Locator and Display Services
|
#include <sys/types.h>
#include <pwd.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>
#include <signal.h>
#include <getopt.h>
#include <pthread.h>
#include <stdint.h>
#include <ctype.h>
#include <stddef.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <ifaddrs.h>
#include <time.h>
#include <stdarg.h>
#include <math.h>
Go to the source code of this file.
Data Structures | |
struct | _IICLCD |
struct | _ipBroadcastArray |
struct | _serviceEntry |
struct | _serviceRegistry |
struct | _serviceRequest |
struct | _temps |
struct | _DISPLAY_LINE |
struct | _DISPLAY_MANAGER |
Macros | |
#define | SD_EMERG "<0>" /* system is unusable */ |
#define | SD_ALERT "<1>" /* action must be taken immediately */ |
#define | SD_CRIT "<2>" /* critical conditions */ |
#define | SD_ERR "<3>" /* error conditions */ |
#define | SD_WARNING "<4>" /* warning conditions */ |
#define | SD_NOTICE "<5>" /* normal but significant condition */ |
#define | SD_INFO "<6>" /* informational */ |
#define | SD_DEBUG "<7>" /* debug-level messages */ |
#define | PACKAGE_VERSION "1.1" |
#define | PACKAGE_NAME "lcd_display_service" |
#define | PACKAGE_DESCRIPTION "Locate Raspberry Pi's on the network." |
#define | SKN_FIND_RPI_PORT 48028 |
#define | SKN_RPI_DISPLAY_SERVICE_PORT 48029 |
#define | SKN_RPI_REGULAR_SERVICE_PORT 48027 |
#define | SZ_CHAR_LABEL 48 |
#define | SZ_INFO_BUFF 256 |
#define | SZ_CHAR_BUFF 128 |
#define | SZ_LINE_BUFF 512 |
#define | SZ_COMM_BUFF 256 |
#define | ARY_MAX_INTF 8 |
#define | ARY_MAX_REGISTRY 128 |
#define | ARY_MAX_DM_LINES 24 |
#define | SKN_RUN_MODE_RUN 0 |
#define | SKN_RUN_MODE_STOP 1 |
#define | TRUE (1==1) |
#define | FALSE (1==2) |
#define | SCROLL_WAIT 1 |
#define | SCROLL_NOWAIT 0 |
#define | MAX_DISPLAY_ROWS 4 |
#define | PLATFORM_ERROR -1 |
#define | TZ_ADJUST 4 |
Typedefs | |
typedef struct _IICLCD | LCDDevice |
typedef struct _IICLCD * | PLCDDevice |
typedef struct _ipBroadcastArray | IPBroadcastArray |
typedef struct _ipBroadcastArray * | PIPBroadcastArray |
typedef struct _serviceEntry | RegistryEntry |
typedef struct _serviceEntry * | PRegistryEntry |
typedef struct _serviceRegistry | ServiceRegistry |
typedef struct _serviceRegistry * | PServiceRegistry |
typedef struct _serviceRequest | ServiceRequest |
typedef struct _serviceRequest * | PServiceRequest |
typedef struct _temps | CpuTemps |
typedef struct _temps * | PCpuTemps |
typedef struct _DISPLAY_LINE | DisplayLine |
typedef struct _DISPLAY_LINE * | PDisplayLine |
typedef struct _DISPLAY_MANAGER | DisplayManager |
typedef struct _DISPLAY_MANAGER * | PDisplayManager |
#define ARY_MAX_DM_LINES 24 |
Definition at line 101 of file skn_common_headers.h.
Referenced by skn_display_manager_add_line(), skn_display_manager_create(), and skn_display_manager_destroy().
#define ARY_MAX_INTF 8 |
Definition at line 99 of file skn_common_headers.h.
#define ARY_MAX_REGISTRY 128 |
Definition at line 100 of file skn_common_headers.h.
#define FALSE (1==2) |
Definition at line 107 of file skn_common_headers.h.
Referenced by cb_udp_registry_select_handler(), gssdp_publish(), main(), skn_gssdp_browse(), udp_initialize_message_send(), udp_registry_response_parser(), ui_gssdp_registry_page_new(), ui_message_page_new(), and ui_registry_page_new().
#define MAX_DISPLAY_ROWS 4 |
Definition at line 112 of file skn_common_headers.h.
#define PACKAGE_DESCRIPTION "Locate Raspberry Pi's on the network." |
Definition at line 85 of file skn_common_headers.h.
#define PACKAGE_NAME "lcd_display_service" |
Definition at line 82 of file skn_common_headers.h.
#define PACKAGE_VERSION "1.1" |
#include <sysexits.h> $ man 3 sysexits
Program Exit Codes with SystemD in mind ref: http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
In case of an error while processing any init-script action except for status, the init script shall print an error message and exit with a non-zero status code:
1 generic or unspecified error (current practice) 2 invalid or excess argument(s) 3 unimplemented feature (for example, "reload") 4 user had insufficient privilege 5 program is not installed 6 program is not configured 7 program is not running 8-99 reserved for future LSB use 100-149 reserved for distribution use 150-199 reserved for application use 200-254 reserved
Definition at line 79 of file skn_common_headers.h.
#define PLATFORM_ERROR -1 |
Definition at line 113 of file skn_common_headers.h.
#define SCROLL_NOWAIT 0 |
Definition at line 111 of file skn_common_headers.h.
#define SCROLL_WAIT 1 |
Definition at line 110 of file skn_common_headers.h.
#define SD_ALERT "<1>" /* action must be taken immediately */ |
Definition at line 42 of file skn_common_headers.h.
#define SD_CRIT "<2>" /* critical conditions */ |
Definition at line 43 of file skn_common_headers.h.
#define SD_DEBUG "<7>" /* debug-level messages */ |
Definition at line 48 of file skn_common_headers.h.
Referenced by main(), service_registry_entry_create(), service_registry_get_via_udp_broadcast(), service_registry_provider(), and skn_display_manager_add_line().
#define SD_EMERG "<0>" /* system is unusable */ |
Definition at line 41 of file skn_common_headers.h.
Referenced by main(), service_registry_get_via_udp_broadcast(), service_registry_provider(), skn_display_manager_message_consumer_startup(), skn_udp_host_create_broadcast_socket(), and skn_udp_host_create_regular_socket().
#define SD_ERR "<3>" /* error conditions */ |
Definition at line 44 of file skn_common_headers.h.
Referenced by get_broadcast_ip_array(), get_default_interface_name(), get_default_interface_name_and_ipv4_address(), main(), service_registry_provider(), skn_device_manager_init_i2c(), skn_device_manager_MCP23008(), skn_device_manager_MCP23017(), skn_device_manager_PCF8574(), skn_device_manager_SerialPort(), skn_display_manager_create(), skn_display_manager_do_work(), skn_display_manager_message_consumer_thread(), skn_handle_display_command_line(), skn_handle_locator_command_line(), and skn_signal_manager_startup().
#define SD_INFO "<6>" /* informational */ |
Definition at line 47 of file skn_common_headers.h.
Referenced by service_registry_list_entries(), skn_udp_host_create_broadcast_socket(), and skn_udp_service_request().
#define SD_NOTICE "<5>" /* normal but significant condition */ |
Definition at line 46 of file skn_common_headers.h.
Referenced by exit_handler(), main(), service_registry_entry_response_message_log(), service_registry_get_via_udp_broadcast(), service_registry_provider(), skn_device_manager_MCP23008(), skn_device_manager_MCP23017(), skn_device_manager_PCF8574(), skn_device_manager_SerialPort(), skn_display_manager_do_work(), skn_display_manager_message_consumer_shutdown(), skn_display_manager_message_consumer_startup(), skn_display_manager_message_consumer_thread(), skn_signal_manager_handler_thread(), skn_signal_manager_process_signals(), skn_signal_manager_shutdown(), skn_strip(), and skn_udp_service_request().
#define SD_WARNING "<4>" /* warning conditions */ |
Definition at line 45 of file skn_common_headers.h.
Referenced by getCpuTemps(), main(), service_registry_entry_create(), service_registry_get_via_udp_broadcast(), service_registry_response_parse(), skn_display_manager_message_consumer_shutdown(), skn_display_manager_message_consumer_startup(), skn_handle_display_command_line(), skn_handle_locator_command_line(), skn_signal_manager_handler_thread(), skn_signal_manager_shutdown(), and skn_udp_service_request().
#define SKN_FIND_RPI_PORT 48028 |
Definition at line 89 of file skn_common_headers.h.
Referenced by main(), service_registry_get_via_udp_broadcast(), and service_registry_provider().
#define SKN_RPI_DISPLAY_SERVICE_PORT 48029 |
Definition at line 90 of file skn_common_headers.h.
Referenced by service_registry_provider(), skn_display_manager_message_consumer_startup(), and skn_display_manager_message_consumer_thread().
#define SKN_RPI_REGULAR_SERVICE_PORT 48027 |
Definition at line 91 of file skn_common_headers.h.
#define SKN_RUN_MODE_RUN 0 |
Definition at line 102 of file skn_common_headers.h.
Referenced by main(), service_registry_get_via_udp_broadcast(), service_registry_provider(), signals_cleanup(), skn_display_manager_do_work(), skn_display_manager_message_consumer_thread(), and skn_signal_manager_handler_thread().
#define SKN_RUN_MODE_STOP 1 |
Definition at line 103 of file skn_common_headers.h.
Referenced by skn_display_manager_do_work(), skn_display_manager_message_consumer_thread(), skn_signal_manager_handler_thread(), and skn_signal_manager_shutdown().
#define SZ_CHAR_BUFF 128 |
Definition at line 95 of file skn_common_headers.h.
#define SZ_CHAR_LABEL 48 |
Definition at line 93 of file skn_common_headers.h.
#define SZ_COMM_BUFF 256 |
Definition at line 97 of file skn_common_headers.h.
#define SZ_INFO_BUFF 256 |
Definition at line 94 of file skn_common_headers.h.
#define SZ_LINE_BUFF 512 |
Definition at line 96 of file skn_common_headers.h.
#define TRUE (1==1) |
Definition at line 106 of file skn_common_headers.h.
Referenced by cb_registry_refresh(), cb_udp_registry_select_handler(), gssdp_browse(), gssdp_publish(), main(), message_queue_source_dispatch(), skn_gssdp_browse(), skn_udp_network_broadcast_all_interfaces(), udp_initialize_message_send(), udp_registry_response_parser(), ui_add_gssdp_registry_entry(), ui_add_message_entry(), ui_add_registry_entry(), ui_gssdp_registry_page_new(), ui_message_page_new(), ui_page_layout(), and ui_registry_page_new().
#define TZ_ADJUST 4 |
Definition at line 279 of file skn_common_headers.h.
Referenced by generate_datetime_info().
typedef struct _DISPLAY_LINE DisplayLine |
typedef struct _DISPLAY_MANAGER DisplayManager |
typedef struct _ipBroadcastArray IPBroadcastArray |
typedef struct _DISPLAY_LINE * PDisplayLine |
typedef struct _DISPLAY_MANAGER * PDisplayManager |
typedef struct _ipBroadcastArray * PIPBroadcastArray |
typedef struct _IICLCD * PLCDDevice |
typedef struct _serviceEntry * PRegistryEntry |
typedef struct _serviceRegistry * PServiceRegistry |
typedef struct _serviceRequest * PServiceRequest |
typedef struct _serviceEntry RegistryEntry |
typedef struct _serviceRegistry ServiceRegistry |
typedef struct _serviceRequest ServiceRequest |