├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── devices ├── DeviceConfig.h ├── arduinouno │ ├── DatabaseInterface.cpp │ ├── DatabaseInterface.h │ ├── DeviceControlInterface.cpp │ ├── DeviceControlInterface.h │ ├── FileSystemInterface.cpp │ ├── FileSystemInterface.h │ ├── LoggerInterface.cpp │ ├── LoggerInterface.h │ ├── SerialInterface.cpp │ ├── SerialInterface.h │ ├── StorageInterface.cpp │ ├── StorageInterface.h │ ├── arduinouno.h │ ├── arduinouno_pdi.c │ ├── arduinouno_pdi.cpp │ ├── arduinouno_pdi.h │ ├── config │ │ └── DBTableSchema.json │ └── core │ │ └── PDIEEPROM.h ├── esp32 │ ├── DatabaseInterface.cpp │ ├── DatabaseInterface.h │ ├── DeviceControlInterface.cpp │ ├── DeviceControlInterface.h │ ├── ExceptionsNotifier.cpp │ ├── ExceptionsNotifier.h │ ├── FileSystemInterface.cpp │ ├── FileSystemInterface.h │ ├── LoggerInterface.cpp │ ├── LoggerInterface.h │ ├── NtpInterface.cpp │ ├── NtpInterface.h │ ├── PingInterface.cpp │ ├── PingInterface.h │ ├── SerialInterface.cpp │ ├── SerialInterface.h │ ├── StorageInterface.cpp │ ├── StorageInterface.h │ ├── TcpClientInterface.cpp │ ├── TcpClientInterface.h │ ├── TcpServerInterface.cpp │ ├── TcpServerInterface.h │ ├── WiFiClientInterface.cpp │ ├── WiFiClientInterface.h │ ├── WiFiInterface.cpp │ ├── WiFiInterface.h │ ├── WiFiServerInterface.cpp │ ├── WiFiServerInterface.h │ ├── config │ │ └── DBTableSchema.json │ ├── core │ │ ├── EEPROM.cpp │ │ └── EEPROM.h │ ├── esp32.h │ ├── esp32_pdi.c │ ├── esp32_pdi.cpp │ └── esp32_pdi.h ├── esp8266 │ ├── DatabaseInterface.cpp │ ├── DatabaseInterface.h │ ├── DeviceControlInterface.cpp │ ├── DeviceControlInterface.h │ ├── ExceptionsNotifier.cpp │ ├── ExceptionsNotifier.h │ ├── FileSystemInterface.cpp │ ├── FileSystemInterface.h │ ├── LoggerInterface.cpp │ ├── LoggerInterface.h │ ├── NtpInterface.cpp │ ├── NtpInterface.h │ ├── PingInterface.cpp │ ├── PingInterface.h │ ├── SerialInterface.cpp │ ├── SerialInterface.h │ ├── StorageInterface.cpp │ ├── StorageInterface.h │ ├── TcpClientInterface.cpp │ ├── TcpClientInterface.h │ ├── TcpServerInterface.cpp │ ├── TcpServerInterface.h │ ├── WiFiClientInterface.cpp │ ├── WiFiClientInterface.h │ ├── WiFiInterface.cpp │ ├── WiFiInterface.h │ ├── WiFiServerInterface.cpp │ ├── WiFiServerInterface.h │ ├── config │ │ └── DBTableSchema.json │ ├── core │ │ ├── EW_EEPROM.cpp │ │ ├── EW_EEPROM.h │ │ ├── Espnow.cpp │ │ ├── Espnow.h │ │ └── EspnowConfig.h │ ├── esp8266.h │ ├── esp8266_pdi.c │ ├── esp8266_pdi.cpp │ └── esp8266_pdi.h └── mockdevice │ ├── ClientInterface.h │ ├── DatabaseInterface.h │ ├── DeviceControlInterface.h │ ├── ExceptionsNotifier.h │ ├── LoggerInterface.h │ ├── NtpInterface.h │ ├── PingInterface.h │ ├── SerialInterface.h │ ├── ServerInterface.h │ ├── WiFiInterface.h │ ├── mockdevice.h │ ├── mockdevice_pdi.cpp │ └── mockdevice_pdi.h ├── doc ├── configs-hierarchy.png ├── dashboard.jpg ├── email-config.jpg ├── ewings_stack.jpg ├── gpio-alert-control.jpg ├── gpio-control-menu.jpg ├── gpio-control.jpg ├── gpio-mode-config.jpg ├── gpio-monitor.jpg ├── gpio-server-config.jpg ├── login-config.jpg ├── login-nav-page.jpg ├── login-page.jpg ├── mqtt-general-config.jpg ├── mqtt-lwt-config.jpg ├── mqtt-pubsub-config.jpg ├── mqtt-submenu.jpg ├── ota-config.jpg ├── pdi-framework.drawio ├── pdi-framework.jpg ├── portal_home_menu.jpg ├── terminal.png └── wifi-config.jpg ├── examples ├── AddingController │ └── AddingController.ino ├── AddingDatabaseTable │ └── AddingDatabaseTable.ino ├── DeviceIotExample │ ├── DeviceIotExample.ino │ ├── DeviceIotSensor.cpp │ └── DeviceIotSensor.h ├── MqttExample │ └── MqttExample.ino ├── PdiStack │ └── PdiStack.ino └── TaskScheduling │ └── TaskScheduling.ino ├── external ├── LittleFSWrapper.c ├── LittleFSWrapper.cpp └── LittleFSWrapper.h ├── keywords.txt ├── library.properties ├── lwip ├── include │ ├── arch │ │ ├── cc.h │ │ ├── perf.h │ │ └── sys_arch.h │ ├── lwip │ │ ├── api.h │ │ ├── api_msg.h │ │ ├── app │ │ │ ├── dhcpserver.h │ │ │ ├── espconn.h │ │ │ ├── espconn_buf.h │ │ │ ├── espconn_tcp.h │ │ │ ├── espconn_udp.h │ │ │ ├── ping.h │ │ │ └── time.h │ │ ├── arch.h │ │ ├── autoip.h │ │ ├── debug.h │ │ ├── def.h │ │ ├── dhcp.h │ │ ├── dns.h │ │ ├── err.h │ │ ├── icmp.h │ │ ├── igmp.h │ │ ├── inet.h │ │ ├── inet_chksum.h │ │ ├── init.h │ │ ├── ip.h │ │ ├── ip_addr.h │ │ ├── ip_frag.h │ │ ├── ip_route.h │ │ ├── lwip_napt.h │ │ ├── mdns.h │ │ ├── mem.h │ │ ├── memp.h │ │ ├── memp_std.h │ │ ├── netbuf.h │ │ ├── netdb.h │ │ ├── netif.h │ │ ├── netifapi.h │ │ ├── opt.h │ │ ├── pbuf.h │ │ ├── puck_def.h │ │ ├── raw.h │ │ ├── sio.h │ │ ├── snmp.h │ │ ├── snmp_asn1.h │ │ ├── snmp_msg.h │ │ ├── snmp_structs.h │ │ ├── sntp.h │ │ ├── sockets.h │ │ ├── stats.h │ │ ├── sys.h │ │ ├── tcp.h │ │ ├── tcp_impl.h │ │ ├── tcpip.h │ │ ├── timers.h │ │ └── udp.h │ ├── lwipopts.h │ └── netif │ │ ├── etharp.h │ │ ├── if_llc.h │ │ ├── ppp_oe.h │ │ └── wlan_lwip_if.h └── src │ ├── Makefile │ ├── api │ ├── api_lib.c │ ├── api_msg.c │ ├── err.c │ ├── netbuf.c │ ├── netdb.c │ ├── netifapi.c │ ├── sockets.c │ └── tcpip.c │ ├── app │ ├── dhcpserver.c │ ├── espconn.c │ ├── espconn_buf.c │ ├── espconn_mdns.c │ ├── espconn_tcp.c │ ├── espconn_udp.c │ ├── netio.c │ └── ping.c │ ├── build │ ├── api │ │ ├── api_lib.d │ │ ├── api_lib.o │ │ ├── api_msg.d │ │ ├── api_msg.o │ │ ├── err.d │ │ ├── err.o │ │ ├── netbuf.d │ │ ├── netbuf.o │ │ ├── netdb.d │ │ ├── netdb.o │ │ ├── netifapi.d │ │ ├── netifapi.o │ │ ├── sockets.d │ │ ├── sockets.o │ │ ├── tcpip.d │ │ └── tcpip.o │ ├── app │ │ ├── dhcpserver.d │ │ ├── dhcpserver.o │ │ ├── espconn.d │ │ ├── espconn.o │ │ ├── espconn_buf.d │ │ ├── espconn_buf.o │ │ ├── espconn_mdns.d │ │ ├── espconn_mdns.o │ │ ├── espconn_tcp.d │ │ ├── espconn_tcp.o │ │ ├── espconn_udp.d │ │ ├── espconn_udp.o │ │ ├── netio.d │ │ ├── netio.o │ │ ├── ping.d │ │ └── ping.o │ ├── core │ │ ├── def.d │ │ ├── def.o │ │ ├── dhcp.d │ │ ├── dhcp.o │ │ ├── dns.d │ │ ├── dns.o │ │ ├── init.d │ │ ├── init.o │ │ ├── ipv4 │ │ │ ├── autoip.d │ │ │ ├── autoip.o │ │ │ ├── icmp.d │ │ │ ├── icmp.o │ │ │ ├── igmp.d │ │ │ ├── igmp.o │ │ │ ├── inet.d │ │ │ ├── inet.o │ │ │ ├── inet_chksum.d │ │ │ ├── inet_chksum.o │ │ │ ├── ip.d │ │ │ ├── ip.o │ │ │ ├── ip_addr.d │ │ │ ├── ip_addr.o │ │ │ ├── ip_frag.d │ │ │ ├── ip_frag.o │ │ │ ├── ip_route.d │ │ │ └── ip_route.o │ │ ├── mdns.d │ │ ├── mdns.o │ │ ├── mem.d │ │ ├── mem.o │ │ ├── memp.d │ │ ├── memp.o │ │ ├── netif.d │ │ ├── netif.o │ │ ├── pbuf.d │ │ ├── pbuf.o │ │ ├── raw.d │ │ ├── raw.o │ │ ├── sntp.d │ │ ├── sntp.o │ │ ├── stats.d │ │ ├── stats.o │ │ ├── sys.d │ │ ├── sys.o │ │ ├── sys_arch.d │ │ ├── sys_arch.o │ │ ├── tcp.d │ │ ├── tcp.o │ │ ├── tcp_in.d │ │ ├── tcp_in.o │ │ ├── tcp_out.d │ │ ├── tcp_out.o │ │ ├── timers.d │ │ ├── timers.o │ │ ├── udp.d │ │ └── udp.o │ ├── netif │ │ ├── etharp.d │ │ └── etharp.o │ └── user_config.h │ ├── core │ ├── def.c │ ├── dhcp.c │ ├── dns.c │ ├── init.c │ ├── ipv4 │ │ ├── autoip.c │ │ ├── icmp.c │ │ ├── igmp.c │ │ ├── inet.c │ │ ├── inet_chksum.c │ │ ├── ip.c │ │ ├── ip_addr.c │ │ ├── ip_frag.c │ │ └── ip_route.c │ ├── mdns.c │ ├── mem.c │ ├── memp.c │ ├── netif.c │ ├── pbuf.c │ ├── raw.c │ ├── sntp.c │ ├── stats.c │ ├── sys.c │ ├── sys_arch.c │ ├── tcp.c │ ├── tcp_in.c │ ├── tcp_out.c │ ├── timers.c │ └── udp.c │ ├── liblwip_src.a │ └── netif │ └── etharp.c ├── scripts ├── CreateDBSourceFromJson.py └── JsonToCpp.py └── src ├── PdiStack.cpp ├── PdiStack.h ├── config ├── Common.h ├── Config.h ├── DeviceIotConfig.h ├── EmailConfig.h ├── EventConfig.h ├── GlobalConfig.h ├── GpioConfig.h ├── MqttConfig.h ├── NetworkConfig.h ├── OtaConfig.h ├── ServerConfig.h └── WifiConfig.h ├── database ├── config │ └── DBTableSchema.json └── core │ └── DatabaseTable.h ├── helpers ├── ClientHelper.cpp └── ClientHelper.h ├── interface ├── interface_includes.h ├── pdi.c ├── pdi.cpp ├── pdi.h └── pdi │ ├── drivers │ ├── iGpioInterface.h │ └── iWdtInterface.h │ ├── iDatabaseInterface.h │ ├── iDeviceIotInterface.h │ ├── iLoggerInterface.h │ ├── middlewares │ ├── iClientInterface.h │ ├── iDeviceControlInterface.h │ ├── iNtpInterface.h │ ├── iPingInterface.h │ ├── iServerInterface.h │ └── iUpgradeInterface.h │ └── modules │ ├── serial │ └── iSerialInterface.h │ ├── storage │ ├── iFileSystemInterface.h │ └── iStorageInterface.h │ └── wifi │ ├── iWiFiClientInterface.h │ ├── iWiFiInterface.h │ └── iWiFiServerInterface.h ├── service_provider ├── ServiceProvider.cpp ├── ServiceProvider.h ├── auth │ ├── AuthServiceProvider.cpp │ └── AuthServiceProvider.h ├── cmd │ ├── CommandLineServiceProvider.cpp │ ├── CommandLineServiceProvider.h │ └── commands │ │ ├── AuthCommand.h │ │ ├── ChangeDirFSCommand.h │ │ ├── ClearScreenCommand.h │ │ ├── CommandCommon.h │ │ ├── FileFSCommand.h │ │ ├── GpioCommand.h │ │ ├── ListFSCommand.h │ │ ├── MakeDirFSCommand.h │ │ ├── MakeFileFSCommand.h │ │ ├── MoveFSCommand.h │ │ ├── PWDFSCommand.h │ │ ├── RemoveFSCommand.h │ │ ├── SchedulerTaskCommand.h │ │ └── ServiceCommand.h ├── database │ ├── DatabaseServiceProvider.cpp │ └── DatabaseServiceProvider.h ├── device │ ├── FactoryResetServiceProvider.cpp │ ├── FactoryResetServiceProvider.h │ ├── GpioServiceProvider.cpp │ ├── GpioServiceProvider.h │ ├── OtaServiceProvider.cpp │ └── OtaServiceProvider.h ├── email │ ├── EmailServiceProvider.cpp │ └── EmailServiceProvider.h ├── iot │ ├── DeviceIotServiceProvider.cpp │ └── DeviceIotServiceProvider.h ├── network │ ├── WiFiServiceProvider.cpp │ └── WiFiServiceProvider.h └── transport │ ├── MqttServiceProvider.cpp │ ├── MqttServiceProvider.h │ ├── SerialServiceProvider.cpp │ ├── SerialServiceProvider.h │ ├── TelnetServiceProvider.cpp │ └── TelnetServiceProvider.h ├── transports ├── http │ ├── HTTPClient.cpp │ └── HTTPClient.h ├── mqtt │ ├── MqttClient.cpp │ ├── MqttClient.h │ ├── Mqtt_msg.cpp │ └── Mqtt_msg.h └── smtp │ ├── SMTPClient.cpp │ └── SMTPClient.h ├── utility ├── Base64.cpp ├── Base64.h ├── CommandBase.h ├── DataTypeConversions.cpp ├── DataTypeConversions.h ├── DataTypeDef.h ├── Database.cpp ├── Database.h ├── EventUtil.cpp ├── EventUtil.h ├── StringOperations.cpp ├── StringOperations.h ├── TaskScheduler.cpp ├── TaskScheduler.h ├── Utility.cpp ├── Utility.h ├── iIOInterface.h ├── iUtilityInterface.h ├── pdistl │ ├── abi │ │ ├── abi.cpp │ │ ├── libgcc_eh │ │ │ ├── Makefile │ │ │ └── Makefile.in │ │ └── libsupc │ │ │ ├── Makefile │ │ │ └── Makefile.in │ ├── algorithm │ ├── algorithm.cpp │ ├── array │ ├── associative_base │ ├── associative_base.cpp │ ├── basic_definitions │ ├── bitset │ ├── bitset.cpp │ ├── cassert │ ├── cctype │ ├── cerrno │ ├── cfloat │ ├── char_traits │ ├── char_traits.cpp │ ├── charconv.h │ ├── cinttypes │ ├── climits │ ├── clocale │ ├── cmath │ ├── complex │ ├── complex.cpp │ ├── csetjmp │ ├── csignal │ ├── cstdarg │ ├── cstddef │ ├── cstdint │ ├── cstdio │ ├── cstdlib │ ├── cstring │ ├── ctime │ ├── cwchar │ ├── cwctype │ ├── del_op.cpp │ ├── del_opnt.cpp │ ├── del_ops.cpp │ ├── del_opv.cpp │ ├── del_opvnt.cpp │ ├── del_opvs.cpp │ ├── deque │ ├── deque.cpp │ ├── eh_alloc.cpp │ ├── eh_globals.cpp │ ├── exception │ ├── exception.cpp │ ├── func_exception │ ├── func_exception.cpp │ ├── functional │ ├── initializer_list │ ├── iomanip │ ├── iomanip.cpp │ ├── ios │ ├── ios.cpp │ ├── iosfwd │ ├── iostream │ ├── iostream.cpp │ ├── istream │ ├── istream.cpp │ ├── istream_helpers │ ├── iterator │ ├── iterator.cpp │ ├── iterator_base │ ├── limits │ ├── limits.cpp │ ├── list │ ├── list.cpp │ ├── locale │ ├── locale.cpp │ ├── map │ ├── map.cpp │ ├── memory │ ├── move.h │ ├── new │ ├── new_handler.cpp │ ├── new_op.cpp │ ├── new_opnt.cpp │ ├── new_opv.cpp │ ├── new_opvnt.cpp │ ├── numeric │ ├── numeric.cpp │ ├── ostream │ ├── ostream.cpp │ ├── ostream_helpers │ ├── ostream_helpers.cpp │ ├── queue │ ├── queue_stl.cpp │ ├── serstream │ ├── set │ ├── set.cpp │ ├── sstream │ ├── sstream.cpp │ ├── stack │ ├── stack.cpp │ ├── stdexcept │ ├── stdexcept.cpp │ ├── stl_function │ ├── streambuf │ ├── streambuf.cpp │ ├── string │ ├── string.cpp │ ├── string_iostream │ ├── support │ ├── support.cpp │ ├── system_configuration.h │ ├── type_traits │ ├── typeinfo │ ├── typeinfo.cpp │ ├── unwind-cxx.h │ ├── utility │ ├── utility.cpp │ ├── valarray │ ├── valarray.cpp │ ├── vector │ └── vector.cpp └── queue │ ├── proto.cpp │ ├── proto.h │ ├── queue.cpp │ ├── queue.h │ ├── ringbuf.cpp │ └── ringbuf.h └── webserver ├── WebServer.cpp ├── WebServer.h ├── controllers ├── Controller.cpp ├── Controller.h ├── DashboardController.h ├── DeviceIotController.h ├── EmailConfigController.h ├── GPIOController.h ├── HomeController.h ├── LoginController.h ├── MQTTController.h ├── OtaController.h └── WiFiConfigController.h ├── handlers ├── RouteHandler.cpp ├── RouteHandler.h └── SessionHandler.h ├── helpers ├── DynamicPageBuildHelper.cpp ├── DynamicPageBuildHelper.h ├── HtmlTagsAndAttr.h └── icon │ └── SvgIcons.h ├── middlewares └── Middleware.h ├── pages ├── Dashboard.h ├── DeviceIotPage.h ├── EmailConfigPage.h ├── Footer.h ├── GpioConfigPage.h ├── Header.h ├── HomePage.h ├── LoginConfigPage.h ├── LoginPage.h ├── LogoutPage.h ├── MqttConfigPage.h ├── NotFound.h ├── OtaConfigPage.h └── WiFiConfigPage.h ├── resources ├── WebResource.cpp └── WebResource.h └── routes └── Routes.h /.gitignore: -------------------------------------------------------------------------------- 1 | /src/database/tables -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "external/littlefs"] 2 | path = external/littlefs 3 | url = https://github.com/littlefs-project/littlefs.git 4 | -------------------------------------------------------------------------------- /devices/arduinouno/DatabaseInterface.cpp: -------------------------------------------------------------------------------- 1 | /***************************** Database Interface ***************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #include "DatabaseInterface.h" 12 | 13 | /** 14 | * begin eeprom configs. 15 | * 16 | * @param uint16_t _size 17 | */ 18 | void DatabaseInterface::beginConfigs(uint32_t _size) 19 | { 20 | PDIEEPROM.begin(); 21 | } 22 | 23 | /** 24 | * clear eeprom by writing zero ot its all locations. 25 | */ 26 | void DatabaseInterface::cleanAllConfigs(void) 27 | { 28 | for (int i = 0; i < DATABASE_MAX_SIZE; i++) 29 | { 30 | PDIEEPROM.write(i, 0); 31 | } 32 | PDIEEPROM.end(); 33 | } 34 | 35 | /** 36 | * check whether database configs are valid 37 | * 38 | * @return bool 39 | */ 40 | bool DatabaseInterface::isValidConfigs(void) 41 | { 42 | return (PDIEEPROM.read(CONFIG_START + 0) == CONFIG_VERSION[0] && 43 | PDIEEPROM.read(CONFIG_START + 1) == CONFIG_VERSION[1] && 44 | PDIEEPROM.read(CONFIG_START + 2) == CONFIG_VERSION[2]); 45 | } 46 | 47 | /** 48 | * maximum database size can be stored 49 | * 50 | * @return max db size 51 | */ 52 | uint32_t DatabaseInterface::getMaxDBSize() 53 | { 54 | return DATABASE_MAX_SIZE; 55 | } 56 | 57 | DatabaseInterface __i_db; 58 | -------------------------------------------------------------------------------- /devices/arduinouno/FileSystemInterface.cpp: -------------------------------------------------------------------------------- 1 | /*************************** File System Interface **************************** 2 | This file is part of the PDI Stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | This interface defines the basic operations required for interacting with 8 | a file system, such as creating, reading, writing to files or directories. 9 | 10 | Author : Suraj I. 11 | Created Date : 6th Apr 2025 12 | ******************************************************************************/ 13 | 14 | #include "../../external/LittleFSWrapper.cpp" 15 | #include "FileSystemInterface.h" 16 | 17 | 18 | /** 19 | * @brief Global instance of the iFileSystemInterface class. 20 | * This instance is used to manage file system operations throughout the PDI stack. 21 | */ 22 | FileSystemInterface __i_fs; 23 | -------------------------------------------------------------------------------- /devices/arduinouno/SerialInterface.h: -------------------------------------------------------------------------------- 1 | /****************************** Serial Interface ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _SERIAL_INTERFACE_H_ 12 | #define _SERIAL_INTERFACE_H_ 13 | 14 | #include "arduinouno.h" 15 | #include 16 | 17 | /** 18 | * UARTSerial class 19 | */ 20 | class UARTSerial : public iSerialInterface 21 | { 22 | 23 | public: 24 | /** 25 | * UARTSerial constructor. 26 | */ 27 | UARTSerial(); 28 | /** 29 | * UARTSerial destructor. 30 | */ 31 | ~UARTSerial(); 32 | 33 | // connect/disconnect api 34 | int16_t connect(uint16_t port, uint64_t speed) override; 35 | int16_t disconnect() override; 36 | 37 | // data sending api 38 | int32_t write(uint8_t c) override; 39 | int32_t write(const uint8_t *c_str) override; 40 | int32_t write(const uint8_t *c_str, uint32_t size) override; 41 | int32_t write_ro(const char *c_str) override; 42 | 43 | // received data read api 44 | uint8_t read() override; 45 | int32_t read(uint8_t *buf, uint32_t size) override; 46 | 47 | // useful api 48 | int32_t available() override; 49 | int8_t connected() override; 50 | void setTimeout(uint32_t timeout) override; 51 | void flush() override; 52 | 53 | // terminal api 54 | iTerminalInterface* with_timestamp() override; 55 | 56 | private: 57 | bool m_connected; 58 | }; 59 | 60 | extern UARTSerial __serial_uart; 61 | 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /devices/arduinouno/arduinouno.h: -------------------------------------------------------------------------------- 1 | /****************************** Common Config ********************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #ifndef _ARDUINOUNO_COMMON_CONFIG_H_ 12 | #define _ARDUINOUNO_COMMON_CONFIG_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | // redefines 20 | #ifdef RODT_ATTR 21 | #undef RODT_ATTR 22 | #define RODT_ATTR(v) (const char*)F(v) 23 | #endif 24 | 25 | #ifdef PROG_RODT_ATTR 26 | #undef PROG_RODT_ATTR 27 | #define PROG_RODT_ATTR PROGMEM 28 | #endif 29 | 30 | #ifdef strcat_ro 31 | #undef strcat_ro 32 | #define strcat_ro strcat_P 33 | #endif 34 | 35 | #ifdef strncat_ro 36 | #undef strncat_ro 37 | #define strncat_ro strncat_P 38 | #endif 39 | 40 | #ifdef strcpy_ro 41 | #undef strcpy_ro 42 | #define strcpy_ro strcpy_P 43 | #endif 44 | 45 | #ifdef strncpy_ro 46 | #undef strncpy_ro 47 | #define strncpy_ro strncpy_P 48 | #endif 49 | 50 | #ifdef strlen_ro 51 | #undef strlen_ro 52 | #define strlen_ro strlen_P 53 | #endif 54 | 55 | #ifdef strcmp_ro 56 | #undef strcmp_ro 57 | #define strcmp_ro strcmp_P 58 | #endif 59 | 60 | #ifdef strncmp_ro 61 | #undef strncmp_ro 62 | #define strncmp_ro strncmp_P 63 | #endif 64 | 65 | 66 | /** 67 | * @define flash key parameters for reset factory 68 | */ 69 | #define FLASH_KEY_PIN 0 70 | #define FLASH_KEY_PRESS_COUNT_THR 5 71 | 72 | 73 | #endif // _ARDUINOUNO_COMMON_CONFIG_H_ 74 | -------------------------------------------------------------------------------- /devices/arduinouno/arduinouno_pdi.c: -------------------------------------------------------------------------------- 1 | /******************* Arduino Portable Device Interface ************************ 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #include "../../devices/DeviceConfig.h" 12 | 13 | #ifdef ENABLE_STORAGE_SERVICE 14 | #include "../../external/LittleFSWrapper.c" 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /devices/arduinouno/arduinouno_pdi.cpp: -------------------------------------------------------------------------------- 1 | /******************** ARDUINO UNO Portable Device Interface ******************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #include "arduinouno_pdi.h" 12 | 13 | /* 14 | * Since arduino platform ide only considers the files inside "src" dir of root folder structure for compilation 15 | * So, here we are importing cpp source files which are part of this portable device interface (pdi) and which 16 | * needs to be compiled 17 | */ 18 | #if defined(LOGBEGIN) && ( defined(ENABLE_LOG_ALL) || defined(ENABLE_LOG_INFO) || defined(ENABLE_LOG_ERROR) || defined(ENABLE_LOG_WARNING) || defined(ENABLE_LOG_SUCCESS) ) 19 | #include "LoggerInterface.cpp" 20 | #endif 21 | #include "DatabaseInterface.cpp" 22 | #include "DeviceControlInterface.cpp" 23 | #ifdef ENABLE_SERIAL_SERVICE 24 | #include "SerialInterface.cpp" 25 | #endif 26 | #ifdef ENABLE_STORAGE_SERVICE 27 | #include "StorageInterface.cpp" 28 | #include "FileSystemInterface.cpp" 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /devices/arduinouno/arduinouno_pdi.h: -------------------------------------------------------------------------------- 1 | /****************** Arduino Uno Portable Device Interface ******************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #ifndef _ARDUINOUNO_PORTABLE_DEVICE_INTERFACE_H_ 12 | #define _ARDUINOUNO_PORTABLE_DEVICE_INTERFACE_H_ 13 | 14 | #if defined(LOGBEGIN) && ( defined(ENABLE_LOG_ALL) || defined(ENABLE_LOG_INFO) || defined(ENABLE_LOG_ERROR) || defined(ENABLE_LOG_WARNING) || defined(ENABLE_LOG_SUCCESS) ) 15 | #include "LoggerInterface.h" 16 | #endif 17 | #include "DatabaseInterface.h" 18 | #ifdef ENABLE_SERIAL_SERVICE 19 | #include "SerialInterface.h" 20 | #endif 21 | #include "DeviceControlInterface.h" 22 | #include "core/PDIEEPROM.h" 23 | #ifdef ENABLE_STORAGE_SERVICE 24 | #include "StorageInterface.h" 25 | #include "FileSystemInterface.h" 26 | #endif 27 | 28 | #endif // _ARDUINOUNO_PORTABLE_DEVICE_INTERFACE_H_ 29 | -------------------------------------------------------------------------------- /devices/arduinouno/core/PDIEEPROM.h: -------------------------------------------------------------------------------- 1 | /***************************** Custom EEPROM ********************************** 2 | This file is part of the pdi stack. It is modified/edited copy of 3 | arduino esp8266 eeprom library. 4 | 5 | This is free software. you can redistribute it and/or modify it but without any 6 | warranty. 7 | 8 | Author : Suraj I. 9 | created Date : 1st June 2019 10 | ******************************************************************************/ 11 | 12 | #ifndef _PDI_EEPROM_H_ 13 | #define _PDI_EEPROM_H_ 14 | 15 | #include 16 | 17 | #define EEPROM_VALIDITY_BYTES "EWEE" 18 | 19 | class PDIEEPROMClass : public EEPROMClass 20 | { 21 | public: 22 | /** 23 | * PDIEEPROMClass constructor. 24 | */ 25 | PDIEEPROMClass() {} 26 | /** 27 | * PDIEEPROMClass destructor. 28 | */ 29 | virtual ~PDIEEPROMClass() {} 30 | 31 | }; 32 | 33 | extern PDIEEPROMClass PDIEEPROM; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /devices/esp32/DatabaseInterface.cpp: -------------------------------------------------------------------------------- 1 | /***************************** Database Interface ***************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #include "DatabaseInterface.h" 12 | 13 | /** 14 | * begin eeprom configs. 15 | * 16 | * @param uint16_t _size 17 | */ 18 | void DatabaseInterface::beginConfigs(uint32_t _size) 19 | { 20 | EEPROM.begin(_size); 21 | } 22 | 23 | /** 24 | * clear eeprom by writing zero ot its all locations. 25 | */ 26 | void DatabaseInterface::cleanAllConfigs(void) 27 | { 28 | for (int i = 0; i < DATABASE_MAX_SIZE; i++) 29 | { 30 | EEPROM.write(i, 0); 31 | } 32 | EEPROM.end(); 33 | } 34 | 35 | /** 36 | * check whether database configs are valid 37 | * 38 | * @return bool 39 | */ 40 | bool DatabaseInterface::isValidConfigs(void) 41 | { 42 | return (EEPROM.read(CONFIG_START + 0) == CONFIG_VERSION[0] && 43 | EEPROM.read(CONFIG_START + 1) == CONFIG_VERSION[1] && 44 | EEPROM.read(CONFIG_START + 2) == CONFIG_VERSION[2]); 45 | } 46 | 47 | /** 48 | * maximum database size can be stored 49 | * 50 | * @return max db size 51 | */ 52 | uint32_t DatabaseInterface::getMaxDBSize() 53 | { 54 | return DATABASE_MAX_SIZE; 55 | } 56 | 57 | DatabaseInterface __i_db; 58 | -------------------------------------------------------------------------------- /devices/esp32/ExceptionsNotifier.h: -------------------------------------------------------------------------------- 1 | /**************************** Exception Notifier ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | #ifndef _ESPSAVECRASHSPIFFS_H_ 11 | #define _ESPSAVECRASHSPIFFS_H_ 12 | 13 | #include "esp32.h" 14 | 15 | 16 | /** 17 | * Structure of the single crash data set 18 | * 19 | * 1. Crash time 20 | * 2. Restart reason 21 | * 3. Exception cause 22 | * 4. epc1 23 | * 5. epc2 24 | * 6. epc3 25 | * 7. excvaddr 26 | * 8. depc 27 | * 9. adress of stack start 28 | * 10. adress of stack end 29 | * 11. stack trace bytes 30 | * ... 31 | */ 32 | #define CRASHFILEPATH "/crashdump.txt" 33 | #define CRASHFILEMAXSIZE 102400 34 | #define CRASH_HANDLER_DURATION 60000 35 | 36 | void beginCrashHandler( void ); 37 | void handleCrashData( void ); 38 | void readCrashFileToBuffer(String &_filepath, String &_filedata, uint16_t &_size); 39 | void saveCrashToSpiffs(struct rst_info *rst_info, uint32_t stack, uint32_t stack_end, Print& outputDev ); 40 | void clearCrashFile( void ); 41 | // void dummyCrash( void ); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /devices/esp32/FileSystemInterface.cpp: -------------------------------------------------------------------------------- 1 | /*************************** File System Interface **************************** 2 | This file is part of the PDI Stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | This interface defines the basic operations required for interacting with 8 | a file system, such as creating, reading, writing to files or directories. 9 | 10 | Author : Suraj I. 11 | Created Date : 6th Apr 2025 12 | ******************************************************************************/ 13 | 14 | #include "../../external/LittleFSWrapper.cpp" 15 | #include "FileSystemInterface.h" 16 | 17 | 18 | /** 19 | * @brief Global instance of the iFileSystemInterface class. 20 | * This instance is used to manage file system operations throughout the PDI stack. 21 | */ 22 | FileSystemInterface __i_fs; 23 | -------------------------------------------------------------------------------- /devices/esp32/NtpInterface.cpp: -------------------------------------------------------------------------------- 1 | /************************ N/W Time Protocol Interface ************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #include "NtpInterface.h" 12 | 13 | /** 14 | * Set sntp update delay by defining weak function in lwip arduino build 15 | * default delay of 1hour is used we can change it here and should be > 15 seconds 16 | */ 17 | uint32_t sntp_update_delay_MS_rfc_not_less_than_15000() 18 | { 19 | return 120000; // 120 seconds 20 | } 21 | 22 | /** 23 | * NtpInterface constructor. 24 | */ 25 | NtpInterface::NtpInterface() 26 | { 27 | // calling this here causing rtc wdt reset issue for esp32 28 | // so keep the call in later in time 29 | 30 | // this->init_ntp_time(); 31 | __task_scheduler.setTimeout( [&]() { this->init_ntp_time(); }, 1, __i_dvc_ctrl.millis_now() ); 32 | } 33 | 34 | /** 35 | * NtpInterface destructor 36 | */ 37 | NtpInterface::~NtpInterface() 38 | { 39 | } 40 | 41 | /** 42 | * initialize network time 43 | */ 44 | void NtpInterface::init_ntp_time() 45 | { 46 | configTime(TZ_SEC, DST_SEC, NTP_SERVER1); 47 | // configTime( TZ_Asia_Kolkata, NTP_SERVER1 ); 48 | } 49 | 50 | /** 51 | * check whether ntp time is valid 52 | */ 53 | bool NtpInterface::is_valid_ntptime() 54 | { 55 | return (time(nullptr) > LAUNCH_UNIX_TIME); 56 | } 57 | 58 | /** 59 | * get network time epoch time 60 | * 61 | * @return time_t 62 | */ 63 | long NtpInterface::get_ntp_time() 64 | { 65 | return time(nullptr); 66 | } 67 | 68 | NtpInterface __i_ntp; 69 | -------------------------------------------------------------------------------- /devices/esp32/NtpInterface.h: -------------------------------------------------------------------------------- 1 | /************************ N/W Time Protocol Interface ************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _NTP_SERVICE_PROVIDER_H_ 12 | #define _NTP_SERVICE_PROVIDER_H_ 13 | 14 | #include "esp32.h" 15 | #include 16 | 17 | 18 | /** 19 | * NtpInterface class 20 | */ 21 | class NtpInterface : public iNtpInterface { 22 | 23 | public: 24 | 25 | /** 26 | * NtpInterface constructor. 27 | */ 28 | NtpInterface(); 29 | 30 | /** 31 | * NtpInterface destructor 32 | */ 33 | ~NtpInterface(); 34 | 35 | void init_ntp_time(); 36 | bool is_valid_ntptime(); 37 | long get_ntp_time(); 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /devices/esp32/SerialInterface.h: -------------------------------------------------------------------------------- 1 | /****************************** Serial Interface ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _SERIAL_INTERFACE_H_ 12 | #define _SERIAL_INTERFACE_H_ 13 | 14 | #include "esp32.h" 15 | #include 16 | 17 | /** 18 | * UARTSerial class 19 | */ 20 | class UARTSerial : public iSerialInterface 21 | { 22 | 23 | public: 24 | /** 25 | * UARTSerial constructor. 26 | */ 27 | UARTSerial(); 28 | /** 29 | * UARTSerial destructor. 30 | */ 31 | ~UARTSerial(); 32 | 33 | // connect/disconnect api 34 | int16_t connect(uint16_t port, uint64_t speed) override; 35 | int16_t disconnect() override; 36 | 37 | // data sending api 38 | int32_t write(uint8_t c) override; 39 | int32_t write(const uint8_t *c_str) override; 40 | int32_t write(const uint8_t *c_str, uint32_t size) override; 41 | int32_t write_ro(const char *c_str) override; 42 | 43 | // received data read api 44 | uint8_t read() override; 45 | int32_t read(uint8_t *buf, uint32_t size) override; 46 | 47 | // useful api 48 | int32_t available() override; 49 | int8_t connected() override; 50 | void setTimeout(uint32_t timeout) override; 51 | void flush() override; 52 | 53 | // terminal api 54 | iTerminalInterface* with_timestamp() override; 55 | 56 | private: 57 | bool m_connected; 58 | 59 | }; 60 | 61 | extern UARTSerial __serial_uart; 62 | 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /devices/esp32/WiFiClientInterface.h: -------------------------------------------------------------------------------- 1 | /************************** WiFi Client Interface ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _WIFI_CLIENT_INTERFACE_H_ 12 | #define _WIFI_CLIENT_INTERFACE_H_ 13 | 14 | #include "esp32.h" 15 | #include 16 | 17 | 18 | /** 19 | * WiFiClientInterface class 20 | */ 21 | class WiFiClientInterface : public iWiFiClientInterface//, public Print 22 | { 23 | 24 | public: 25 | /** 26 | * WiFiClientInterface constructor. 27 | */ 28 | WiFiClientInterface(); 29 | /** 30 | * WiFiClientInterface destructor. 31 | */ 32 | ~WiFiClientInterface(); 33 | 34 | // connect/disconnect api 35 | int16_t connect(const uint8_t *host, uint16_t port) override; 36 | int16_t disconnect() override; 37 | 38 | // data sending api 39 | int32_t write(uint8_t c) override; 40 | // size_t write(uint8_t c) override; // from Print 41 | int32_t write(const uint8_t *c_str) override; 42 | int32_t write(const uint8_t *c_str, uint32_t size) override; 43 | 44 | // received data read api 45 | uint8_t read() override; 46 | int32_t read(uint8_t *buf, uint32_t size) override; 47 | 48 | // useful api 49 | int32_t available() override; 50 | int8_t connected() override; 51 | void setTimeout(uint32_t timeout) override; 52 | void flush() override; 53 | 54 | WiFiClient *getWiFiClient() { return &this->m_wifi_client; } 55 | 56 | // using Print::write; 57 | 58 | private: 59 | /** 60 | * @var WiFiClient m_wifi_client 61 | */ 62 | WiFiClient m_wifi_client; 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /devices/esp32/esp32_pdi.c: -------------------------------------------------------------------------------- 1 | /******************** ESP32 Portable Device Interface ************************ 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #include "../../devices/DeviceConfig.h" 12 | 13 | #ifdef ENABLE_STORAGE_SERVICE 14 | #include "../../external/LittleFSWrapper.c" 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /devices/esp32/esp32_pdi.cpp: -------------------------------------------------------------------------------- 1 | /********************* ESP32 Portable Device Interface ************************ 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #include "esp32_pdi.h" 12 | 13 | /* 14 | * Since arduino platform ide only considers the files inside "src" dir of root folder structure for compilation 15 | * So, here we are importing cpp source files which are part of this portable device interface (pdi) and which 16 | * needs to be compiled 17 | */ 18 | #if defined(LOGBEGIN) && ( defined(ENABLE_LOG_ALL) || defined(ENABLE_LOG_INFO) || defined(ENABLE_LOG_ERROR) || defined(ENABLE_LOG_WARNING) || defined(ENABLE_LOG_SUCCESS) ) 19 | #include "LoggerInterface.cpp" 20 | #endif 21 | #include "DatabaseInterface.cpp" 22 | #include "DeviceControlInterface.cpp" 23 | #ifdef ENABLE_WIFI_SERVICE 24 | #include "WiFiInterface.cpp" 25 | #include "WiFiClientInterface.cpp" 26 | #include "WiFiServerInterface.cpp" 27 | #endif 28 | #ifdef ENABLE_NETWORK_SERVICE 29 | #include "NtpInterface.cpp" 30 | #include "PingInterface.cpp" 31 | #include "TcpClientInterface.cpp" 32 | #include "TcpServerInterface.cpp" 33 | #endif 34 | #include "ExceptionsNotifier.cpp" 35 | #include "core/EEPROM.cpp" 36 | #ifdef ENABLE_SERIAL_SERVICE 37 | #include "SerialInterface.cpp" 38 | #endif 39 | #ifdef ENABLE_STORAGE_SERVICE 40 | #include "StorageInterface.cpp" 41 | #include "FileSystemInterface.cpp" 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /devices/esp32/esp32_pdi.h: -------------------------------------------------------------------------------- 1 | /********************* ESP32 Portable Device Interface ************************ 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #ifndef _ESP32_PORTABLE_DEVICE_INTERFACE_H_ 12 | #define _ESP32_PORTABLE_DEVICE_INTERFACE_H_ 13 | 14 | #if defined(LOGBEGIN) && ( defined(ENABLE_LOG_ALL) || defined(ENABLE_LOG_INFO) || defined(ENABLE_LOG_ERROR) || defined(ENABLE_LOG_WARNING) || defined(ENABLE_LOG_SUCCESS) ) 15 | #include "LoggerInterface.h" 16 | #endif 17 | #include "DatabaseInterface.h" 18 | #include "DeviceControlInterface.h" 19 | #ifdef ENABLE_WIFI_SERVICE 20 | #include "WiFiInterface.h" 21 | #include "WiFiClientInterface.h" 22 | #include "WiFiServerInterface.h" 23 | #endif 24 | #ifdef ENABLE_NETWORK_SERVICE 25 | #include "NtpInterface.h" 26 | #include "PingInterface.h" 27 | #include "TcpClientInterface.h" 28 | #include "TcpServerInterface.h" 29 | #endif 30 | #ifdef ENABLE_SERIAL_SERVICE 31 | #include "SerialInterface.h" 32 | #endif 33 | #ifdef ENABLE_STORAGE_SERVICE 34 | #include "StorageInterface.h" 35 | #include "FileSystemInterface.h" 36 | #endif 37 | 38 | #endif // _ESP32_PORTABLE_DEVICE_INTERFACE_H_ 39 | -------------------------------------------------------------------------------- /devices/esp8266/DatabaseInterface.cpp: -------------------------------------------------------------------------------- 1 | /***************************** Database Interface ***************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #include "DatabaseInterface.h" 12 | 13 | /** 14 | * begin eeprom configs. 15 | * 16 | * @param uint16_t _size 17 | */ 18 | void DatabaseInterface::beginConfigs(uint32_t _size) 19 | { 20 | EEPROM.begin(_size); 21 | } 22 | 23 | /** 24 | * clear eeprom by writing zero ot its all locations. 25 | */ 26 | void DatabaseInterface::cleanAllConfigs(void) 27 | { 28 | for (int i = 0; i < DATABASE_MAX_SIZE; i++) 29 | { 30 | EEPROM.write(i, 0); 31 | } 32 | EEPROM.end(); 33 | } 34 | 35 | /** 36 | * check whether database configs are valid 37 | * 38 | * @return bool 39 | */ 40 | bool DatabaseInterface::isValidConfigs(void) 41 | { 42 | return (EEPROM.read(CONFIG_START + 0) == CONFIG_VERSION[0] && 43 | EEPROM.read(CONFIG_START + 1) == CONFIG_VERSION[1] && 44 | EEPROM.read(CONFIG_START + 2) == CONFIG_VERSION[2]); 45 | } 46 | 47 | /** 48 | * maximum database size can be stored 49 | * 50 | * @return max db size 51 | */ 52 | uint32_t DatabaseInterface::getMaxDBSize() 53 | { 54 | return DATABASE_MAX_SIZE; 55 | } 56 | 57 | DatabaseInterface __i_db; 58 | -------------------------------------------------------------------------------- /devices/esp8266/ExceptionsNotifier.h: -------------------------------------------------------------------------------- 1 | /**************************** Exception Notifier ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | #ifndef _ESPSAVECRASHSPIFFS_H_ 11 | #define _ESPSAVECRASHSPIFFS_H_ 12 | 13 | #include "esp8266.h" 14 | 15 | 16 | /** 17 | * Structure of the single crash data set 18 | * 19 | * 1. Crash time 20 | * 2. Restart reason 21 | * 3. Exception cause 22 | * 4. epc1 23 | * 5. epc2 24 | * 6. epc3 25 | * 7. excvaddr 26 | * 8. depc 27 | * 9. adress of stack start 28 | * 10. adress of stack end 29 | * 11. stack trace bytes 30 | * ... 31 | */ 32 | #define CRASHFILEPATH "/crashdump.txt" 33 | #define CRASHFILEMAXSIZE 102400 34 | #define CRASH_HANDLER_DURATION 60000 35 | 36 | void beginCrashHandler( void ); 37 | void handleCrashData( void ); 38 | void readCrashFileToBuffer(String &_filepath, String &_filedata, uint16_t &_size); 39 | void saveCrashToSpiffs(struct rst_info *rst_info, uint32_t stack, uint32_t stack_end, Print& outputDev ); 40 | void clearCrashFile( void ); 41 | // void dummyCrash( void ); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /devices/esp8266/FileSystemInterface.cpp: -------------------------------------------------------------------------------- 1 | /*************************** File System Interface **************************** 2 | This file is part of the PDI Stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | This interface defines the basic operations required for interacting with 8 | a file system, such as creating, reading, writing to files or directories. 9 | 10 | Author : Suraj I. 11 | Created Date : 6th Apr 2025 12 | ******************************************************************************/ 13 | 14 | #include "../../external/LittleFSWrapper.cpp" 15 | #include "FileSystemInterface.h" 16 | 17 | 18 | /** 19 | * @brief Global instance of the iFileSystemInterface class. 20 | * This instance is used to manage file system operations throughout the PDI stack. 21 | */ 22 | FileSystemInterface __i_fs; 23 | -------------------------------------------------------------------------------- /devices/esp8266/NtpInterface.cpp: -------------------------------------------------------------------------------- 1 | /************************ N/W Time Protocol Interface ************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #include "NtpInterface.h" 12 | 13 | /** 14 | * Set sntp update delay by defining weak function in lwip arduino build 15 | * default delay of 1hour is used we can change it here and should be > 15 seconds 16 | */ 17 | uint32_t sntp_update_delay_MS_rfc_not_less_than_15000() 18 | { 19 | return 120000; // 120 seconds 20 | } 21 | 22 | /** 23 | * NtpInterface constructor. 24 | */ 25 | NtpInterface::NtpInterface() 26 | { 27 | this->init_ntp_time(); 28 | } 29 | 30 | /** 31 | * NtpInterface destructor 32 | */ 33 | NtpInterface::~NtpInterface() 34 | { 35 | } 36 | 37 | /** 38 | * initialize network time 39 | */ 40 | void NtpInterface::init_ntp_time() 41 | { 42 | configTime(TZ_SEC, DST_SEC, NTP_SERVER1); 43 | // configTime( TZ_Asia_Kolkata, NTP_SERVER1 ); 44 | } 45 | 46 | /** 47 | * check whether ntp time is valid 48 | */ 49 | bool NtpInterface::is_valid_ntptime() 50 | { 51 | return (time(nullptr) > LAUNCH_UNIX_TIME); 52 | } 53 | 54 | /** 55 | * get network time epoch time 56 | * 57 | * @return time_t 58 | */ 59 | long NtpInterface::get_ntp_time() 60 | { 61 | return time(nullptr); 62 | } 63 | 64 | NtpInterface __i_ntp; 65 | -------------------------------------------------------------------------------- /devices/esp8266/NtpInterface.h: -------------------------------------------------------------------------------- 1 | /************************ N/W Time Protocol Interface ************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _NTP_SERVICE_PROVIDER_H_ 12 | #define _NTP_SERVICE_PROVIDER_H_ 13 | 14 | #include "esp8266.h" 15 | #include 16 | 17 | 18 | /** 19 | * NtpInterface class 20 | */ 21 | class NtpInterface : public iNtpInterface { 22 | 23 | public: 24 | 25 | /** 26 | * NtpInterface constructor. 27 | */ 28 | NtpInterface(); 29 | 30 | /** 31 | * NtpInterface destructor 32 | */ 33 | ~NtpInterface(); 34 | 35 | void init_ntp_time(); 36 | bool is_valid_ntptime(); 37 | long get_ntp_time(); 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /devices/esp8266/PingInterface.h: -------------------------------------------------------------------------------- 1 | /****************************** Ping Interface ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _PING_INTERFACE_H_ 12 | #define _PING_INTERFACE_H_ 13 | 14 | #include "esp8266.h" 15 | #include 16 | 17 | // This function is called when a ping is received or the request times out: 18 | static void ICACHE_FLASH_ATTR ping_recv_cb(void* arg, void* pdata); 19 | // This function is called when a ping is sent 20 | static void ICACHE_FLASH_ATTR ping_sent_cb(void* arg, void* pdata); 21 | 22 | /** 23 | * PingInterface class 24 | */ 25 | class PingInterface : public iPingInterface { 26 | 27 | public: 28 | 29 | /** 30 | * PingInterface constructor. 31 | */ 32 | PingInterface(); 33 | /** 34 | * PingInterface destructor 35 | */ 36 | ~PingInterface(); 37 | 38 | /** 39 | * initialize ping 40 | */ 41 | void init_ping( iWiFiInterface* _wifi ) override; 42 | bool ping( void ) override; 43 | bool isHostRespondingToPing( void ) override; 44 | 45 | ping_option m_opt; 46 | // bool host_resp; 47 | 48 | protected: 49 | /** 50 | * @var iWiFiInterface*|&WiFi wifi 51 | */ 52 | iWiFiInterface *m_wifi; 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /devices/esp8266/SerialInterface.h: -------------------------------------------------------------------------------- 1 | /****************************** Serial Interface ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _SERIAL_INTERFACE_H_ 12 | #define _SERIAL_INTERFACE_H_ 13 | 14 | #include "esp8266.h" 15 | #include 16 | 17 | /** 18 | * UARTSerial class 19 | */ 20 | class UARTSerial : public iSerialInterface 21 | { 22 | 23 | public: 24 | /** 25 | * UARTSerial constructor. 26 | */ 27 | UARTSerial(); 28 | /** 29 | * UARTSerial destructor. 30 | */ 31 | ~UARTSerial(); 32 | 33 | // connect/disconnect api 34 | int16_t connect(uint16_t port, uint64_t speed) override; 35 | int16_t disconnect() override; 36 | 37 | // data sending api 38 | int32_t write(uint8_t c) override; 39 | int32_t write(const uint8_t *c_str) override; 40 | int32_t write(const uint8_t *c_str, uint32_t size) override; 41 | int32_t write_ro(const char *c_str) override; 42 | 43 | // received data read api 44 | uint8_t read() override; 45 | int32_t read(uint8_t *buf, uint32_t size) override; 46 | 47 | // useful api 48 | int32_t available() override; 49 | int8_t connected() override; 50 | void setTimeout(uint32_t timeout) override; 51 | void flush() override; 52 | 53 | // terminal api 54 | iTerminalInterface* with_timestamp() override; 55 | 56 | private: 57 | bool m_connected; 58 | 59 | }; 60 | 61 | extern UARTSerial __serial_uart; 62 | 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /devices/esp8266/WiFiClientInterface.h: -------------------------------------------------------------------------------- 1 | /************************** WiFi Client Interface ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _WIFI_CLIENT_INTERFACE_H_ 12 | #define _WIFI_CLIENT_INTERFACE_H_ 13 | 14 | #include "esp8266.h" 15 | #include 16 | 17 | /** 18 | * WiFiClientInterface class 19 | */ 20 | class WiFiClientInterface : public iWiFiClientInterface//, public Print 21 | { 22 | 23 | public: 24 | /** 25 | * WiFiClientInterface constructor. 26 | */ 27 | WiFiClientInterface(); 28 | /** 29 | * WiFiClientInterface destructor. 30 | */ 31 | ~WiFiClientInterface(); 32 | 33 | // connect/disconnect api 34 | int16_t connect(const uint8_t *host, uint16_t port) override; 35 | int16_t disconnect() override; 36 | 37 | // data sending api 38 | int32_t write(uint8_t c) override; 39 | int32_t write(const uint8_t *c_str) override; 40 | int32_t write(const uint8_t *c_str, uint32_t size) override; 41 | 42 | // received data read api 43 | uint8_t read() override; 44 | int32_t read(uint8_t *buf, uint32_t size) override; 45 | 46 | // useful api 47 | int32_t available() override; 48 | int8_t connected() override; 49 | void setTimeout(uint32_t timeout) override; 50 | void flush() override; 51 | 52 | WiFiClient *getWiFiClient() { return &this->m_wifi_client; } 53 | 54 | // using Print::write; 55 | 56 | private: 57 | /** 58 | * @var WiFiClient m_wifi_client 59 | */ 60 | WiFiClient m_wifi_client; 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /devices/esp8266/core/EW_EEPROM.h: -------------------------------------------------------------------------------- 1 | /***************************** Custom EEPROM ********************************** 2 | This file is part of the pdi stack. It is modified/edited copy of 3 | arduino esp8266 eeprom library. 4 | 5 | This is free software. you can redistribute it and/or modify it but without any 6 | warranty. 7 | 8 | Author : Suraj I. 9 | created Date : 1st June 2019 10 | ******************************************************************************/ 11 | 12 | #ifndef _EW_EEPROM_H_ 13 | #define _EW_EEPROM_H_ 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #define EEPROM_VALIDITY_BYTES "EWEE" 20 | 21 | class EW_EEPROMClass 22 | { 23 | public: 24 | EW_EEPROMClass(uint32_t sector); 25 | EW_EEPROMClass(void); 26 | 27 | void begin(size_t size); 28 | uint8_t read(int const address); 29 | void write(int const address, uint8_t const val); 30 | bool commit(); 31 | void end(); 32 | 33 | uint8_t *getDataPtr(); 34 | uint8_t const *getConstDataPtr() const; 35 | 36 | size_t length() { return m_size; } 37 | 38 | uint8_t &operator[](int const address) { return getDataPtr()[address]; } 39 | uint8_t const &operator[](int const address) const { return getConstDataPtr()[address]; } 40 | 41 | private: 42 | uint32_t m_sector; 43 | uint32_t m_copy_sector; 44 | uint8_t *m_data; 45 | size_t m_size; 46 | bool m_dirty; 47 | }; 48 | 49 | #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM) 50 | extern EW_EEPROMClass EEPROM; 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /devices/esp8266/core/EspnowConfig.h: -------------------------------------------------------------------------------- 1 | /*************************** ESPNOW Config page ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | #ifndef _ESPNOW_CONFIG_H_ 11 | #define _ESPNOW_CONFIG_H_ 12 | 13 | #include 14 | 15 | // #define ESP_NOW_KEY "jo bole so nihal" 16 | #define ESP_NOW_KEY "lets kill people" 17 | #define ESP_NOW_KEY_LENGTH 16 18 | #define ESP_NOW_CHANNEL 4 19 | #define ESP_NOW_MAX_PEER 8 20 | #define ESP_NOW_DEVICE_TABLE_MAX_SIZE 20 21 | #define ESP_NOW_MAX_BUFF_SIZE 250 22 | 23 | #define ESP_NOW_HANDLE_DURATION MILLISECOND_DURATION_5000 24 | 25 | enum esp_now_state { 26 | ESP_NOW_STATE_EMPTY, 27 | ESP_NOW_STATE_INIT, 28 | ESP_NOW_STATE_SENT, 29 | ESP_NOW_STATE_SENT_SUCCEED, 30 | ESP_NOW_STATE_SENT_FAILED, 31 | ESP_NOW_STATE_DATA_AVAILABLE, 32 | ESP_NOW_STATE_RECV_AVAILABLE 33 | }; 34 | 35 | typedef struct { 36 | uint8_t mac[6]; 37 | uint8_t mesh_level; 38 | } esp_now_device_t; 39 | 40 | typedef struct { 41 | uint8_t mac[6]; 42 | uint8_t role; 43 | uint8_t channel; 44 | esp_now_state state; 45 | uint8_t* buffer; 46 | uint8_t data_length; 47 | uint32_t last_receive; 48 | } esp_now_peer_t; 49 | 50 | extern esp_now_peer_t esp_now_peers[ESP_NOW_MAX_PEER]; 51 | extern pdiutil::vector esp_now_device_table; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /devices/esp8266/esp8266_pdi.c: -------------------------------------------------------------------------------- 1 | /****************** ESP8266 Portable Device Interface ************************ 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #include "../../devices/DeviceConfig.h" 12 | 13 | #ifdef ENABLE_STORAGE_SERVICE 14 | #include "../../external/LittleFSWrapper.c" 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /devices/esp8266/esp8266_pdi.cpp: -------------------------------------------------------------------------------- 1 | /****************** ESP8266 Portable Device Interface ************************ 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #include "esp8266_pdi.h" 12 | 13 | /* 14 | * Since arduino platform ide only considers the files inside "src" dir of root folder structure for compilation 15 | * So, here we are importing cpp source files which are part of this portable device interface (pdi) and which 16 | * needs to be compiled 17 | */ 18 | #if defined(LOGBEGIN) && ( defined(ENABLE_LOG_ALL) || defined(ENABLE_LOG_INFO) || defined(ENABLE_LOG_ERROR) || defined(ENABLE_LOG_WARNING) || defined(ENABLE_LOG_SUCCESS) ) 19 | #include "LoggerInterface.cpp" 20 | #endif 21 | #include "DatabaseInterface.cpp" 22 | #include "DeviceControlInterface.cpp" 23 | #ifdef ENABLE_WIFI_SERVICE 24 | #include "WiFiInterface.cpp" 25 | #include "WiFiClientInterface.cpp" 26 | #include "WiFiServerInterface.cpp" 27 | #endif 28 | #ifdef ENABLE_NETWORK_SERVICE 29 | #include "NtpInterface.cpp" 30 | #include "PingInterface.cpp" 31 | #include "TcpClientInterface.cpp" 32 | #include "TcpServerInterface.cpp" 33 | #endif 34 | #include "ExceptionsNotifier.cpp" 35 | #include "core/Espnow.cpp" 36 | #include "core/EW_EEPROM.cpp" 37 | #ifdef ENABLE_SERIAL_SERVICE 38 | #include "SerialInterface.cpp" 39 | #endif 40 | #ifdef ENABLE_STORAGE_SERVICE 41 | #include "StorageInterface.cpp" 42 | #include "FileSystemInterface.cpp" 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /devices/esp8266/esp8266_pdi.h: -------------------------------------------------------------------------------- 1 | /****************** ESP8266 Portable Device Interface ************************ 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #ifndef _ESP8266_PORTABLE_DEVICE_INTERFACE_H_ 12 | #define _ESP8266_PORTABLE_DEVICE_INTERFACE_H_ 13 | 14 | #if defined(LOGBEGIN) && ( defined(ENABLE_LOG_ALL) || defined(ENABLE_LOG_INFO) || defined(ENABLE_LOG_ERROR) || defined(ENABLE_LOG_WARNING) || defined(ENABLE_LOG_SUCCESS) ) 15 | #include "LoggerInterface.h" 16 | #endif 17 | #include "DatabaseInterface.h" 18 | #include "DeviceControlInterface.h" 19 | #ifdef ENABLE_WIFI_SERVICE 20 | #include "WiFiInterface.h" 21 | #include "WiFiClientInterface.h" 22 | #include "WiFiServerInterface.h" 23 | #endif 24 | #ifdef ENABLE_NETWORK_SERVICE 25 | #include "NtpInterface.h" 26 | #include "PingInterface.h" 27 | #include "TcpClientInterface.h" 28 | #include "TcpServerInterface.h" 29 | #endif 30 | #include "core/Espnow.h" 31 | #ifdef ENABLE_SERIAL_SERVICE 32 | #include "SerialInterface.h" 33 | #endif 34 | #ifdef ENABLE_STORAGE_SERVICE 35 | #include "StorageInterface.h" 36 | #include "FileSystemInterface.h" 37 | #endif 38 | 39 | 40 | #endif // _ESP8266_PORTABLE_DEVICE_INTERFACE_H_ 41 | -------------------------------------------------------------------------------- /devices/mockdevice/ClientInterface.h: -------------------------------------------------------------------------------- 1 | /****************************** Client Interface ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _MOCKDEVICE_CLIENT_INTERFACE_H_ 12 | #define _MOCKDEVICE_CLIENT_INTERFACE_H_ 13 | 14 | #include "mockdevice.h" 15 | #include 16 | 17 | /** 18 | * WiFiClientInterface class 19 | */ 20 | class WiFiClientInterface : public iWiFiClientInterface 21 | { 22 | 23 | public: 24 | /** 25 | * WiFiClientInterface constructor. 26 | */ 27 | WiFiClientInterface(){} 28 | /** 29 | * WiFiClientInterface destructor. 30 | */ 31 | ~WiFiClientInterface(){} 32 | 33 | // connect/disconnect api 34 | int16_t connect(const uint8_t *host, uint16_t port) override{return 0;} 35 | int16_t disconnect() override{return 0;} 36 | 37 | // data sending api 38 | uint32_t write(uint8_t c) override{return 0;} 39 | uint32_t write(const uint8_t *c_str) override{return 0;} 40 | uint32_t write(const uint8_t *c_str, uint32_t size) override{return 0;} 41 | 42 | // received data read api 43 | uint8_t read() override{return 0;} 44 | uint32_t read(uint8_t *buf, uint32_t size) override{return 0;} 45 | 46 | // useful api 47 | int32_t available() override{return 0;} 48 | int8_t connected() override{return 0;} 49 | void setTimeout(uint32_t timeout) override{} 50 | void flush() override{} 51 | 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /devices/mockdevice/DatabaseInterface.h: -------------------------------------------------------------------------------- 1 | /***************************** Database Interface ***************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #ifndef _MOCKDEVICE_DATABASE_INTERFACE_H_ 12 | #define _MOCKDEVICE_DATABASE_INTERFACE_H_ 13 | 14 | #include "mockdevice.h" 15 | #include 16 | 17 | /** 18 | * define eeprom max size available here 19 | */ 20 | // #define DATABASE_MAX_SIZE SPI_FLASH_SEC_SIZE 21 | 22 | /** 23 | * DatabaseInterface class 24 | */ 25 | class DatabaseInterface : public iDatabaseInterface 26 | { 27 | 28 | public: 29 | /** 30 | * DatabaseInterface constructor. 31 | */ 32 | DatabaseInterface() {} 33 | /** 34 | * DatabaseInterface destructor. 35 | */ 36 | virtual ~DatabaseInterface() {} 37 | 38 | void beginConfigs(uint32_t _size) override{} 39 | void cleanAllConfigs() override{} 40 | bool isValidConfigs() override{return 0;} 41 | uint32_t getMaxDBSize() override{return 0;} 42 | 43 | template 44 | void saveConfig(uint16_t _address, T *_object){} 45 | 46 | template 47 | void loadConfig(uint16_t _address, T *_object){} 48 | 49 | template 50 | void clearConfig(uint16_t _address){} 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /devices/mockdevice/ExceptionsNotifier.h: -------------------------------------------------------------------------------- 1 | /**************************** Exception Notifier ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | #ifndef _MOCKDEVICE_ESPSAVECRASHSPIFFS_H_ 11 | #define _MOCKDEVICE_ESPSAVECRASHSPIFFS_H_ 12 | 13 | #include "mockdevice.h" 14 | 15 | 16 | /** 17 | * Structure of the single crash data set 18 | * 19 | * 1. Crash time 20 | * 2. Restart reason 21 | * 3. Exception cause 22 | * 4. epc1 23 | * 5. epc2 24 | * 6. epc3 25 | * 7. excvaddr 26 | * 8. depc 27 | * 9. adress of stack start 28 | * 10. adress of stack end 29 | * 11. stack trace bytes 30 | * ... 31 | */ 32 | #define CRASHFILEPATH "/crashdump.txt" 33 | #define CRASHFILEMAXSIZE 102400 34 | #define CRASH_HANDLER_DURATION 60000 35 | 36 | void beginCrashHandler( void ){} 37 | void handleCrashData( void ){} 38 | // void readCrashFileToBuffer(String &_filepath, String &_filedata, uint16_t &_size){} 39 | // void saveCrashToSpiffs(struct rst_info *rst_info, uint32_t stack, uint32_t stack_end, Print& outputDev ){} 40 | void clearCrashFile( void ){} 41 | // void dummyCrash( void ){} 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /devices/mockdevice/NtpInterface.h: -------------------------------------------------------------------------------- 1 | /************************ N/W Time Protocol Interface ************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _MOCKDEVICE_NTP_SERVICE_PROVIDER_H_ 12 | #define _MOCKDEVICE_NTP_SERVICE_PROVIDER_H_ 13 | 14 | #include "mockdevice.h" 15 | #include 16 | 17 | 18 | /** 19 | * NtpInterface class 20 | */ 21 | class NtpInterface : public iNtpInterface { 22 | 23 | public: 24 | 25 | /** 26 | * NtpInterface constructor. 27 | */ 28 | NtpInterface(){} 29 | 30 | /** 31 | * NtpInterface destructor 32 | */ 33 | ~NtpInterface(){} 34 | 35 | void init_ntp_time() override{} 36 | bool is_valid_ntptime() override{return 0;} 37 | long get_ntp_time() override{return 0;} 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /devices/mockdevice/PingInterface.h: -------------------------------------------------------------------------------- 1 | /****************************** Ping Interface ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _MOCKDEVICE_PING_INTERFACE_H_ 12 | #define _MOCKDEVICE_PING_INTERFACE_H_ 13 | 14 | #include "mockdevice.h" 15 | #include 16 | #include "LoggerInterface.h" 17 | 18 | /** 19 | * PingInterface class 20 | */ 21 | class PingInterface : public iPingInterface { 22 | 23 | public: 24 | 25 | /** 26 | * PingInterface constructor. 27 | */ 28 | PingInterface(){} 29 | /** 30 | * PingInterface destructor 31 | */ 32 | ~PingInterface(){} 33 | 34 | /** 35 | * initialize ping 36 | */ 37 | void init_ping( iWiFiInterface* _wifi ) override{} 38 | bool ping( void ) override{return 0;} 39 | bool isHostRespondingToPing( void ) override{return 0;} 40 | 41 | protected: 42 | /** 43 | * @var iWiFiInterface*|&WiFi wifi 44 | */ 45 | iWiFiInterface *m_wifi; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /devices/mockdevice/SerialInterface.h: -------------------------------------------------------------------------------- 1 | /****************************** Serial Interface ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _MOCKDEVICE_SERIAL_INTERFACE_H_ 12 | #define _MOCKDEVICE_SERIAL_INTERFACE_H_ 13 | 14 | #include "mockdevice.h" 15 | #include 16 | 17 | /** 18 | * UARTSerial class 19 | */ 20 | class UARTSerial : public iSerialInterface 21 | { 22 | 23 | public: 24 | /** 25 | * UARTSerial constructor. 26 | */ 27 | UARTSerial(); 28 | /** 29 | * UARTSerial destructor. 30 | */ 31 | ~UARTSerial(); 32 | 33 | // connect/disconnect api 34 | int16_t connect(uint16_t port, uint64_t speed) override{ return 0; } 35 | int16_t disconnect() override { return 0; } 36 | 37 | // data sending api 38 | uint32_t write(uint8_t c) override { return 0; } 39 | uint32_t write(const uint8_t *c_str) override { return 0; } 40 | uint32_t write(const uint8_t *c_str, uint32_t size) override { return 0; } 41 | 42 | // received data read api 43 | uint8_t read() override { return 0; } 44 | uint32_t read(uint8_t *buf, uint32_t size) override { return 0; } 45 | 46 | // useful api 47 | int32_t available() override { return -1; } 48 | int8_t connected() override { return 0; } 49 | void setTimeout(uint32_t timeout) override {} 50 | void flush() override {} 51 | }; 52 | 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /devices/mockdevice/mockdevice_pdi.cpp: -------------------------------------------------------------------------------- 1 | /************************* Mock device Interface ***************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | #include 11 | 12 | #ifdef MOCK_DEVICE_TEST 13 | 14 | #include "mockdevice_pdi.h" 15 | 16 | LoggerInterface __i_logger; 17 | DatabaseInterface __i_db; 18 | DeviceControlInterface __i_dvc_ctrl; 19 | #ifdef ENABLE_WIFI_SERVICE 20 | WiFiInterface __i_wifi; 21 | WiFiClientInterface __i_wifi_client; 22 | WiFiServerInterface __i_wifi_server; 23 | #endif 24 | #ifdef ENABLE_NETWORK_SERVICE 25 | NtpInterface __i_ntp; 26 | PingInterface __i_ping; 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /devices/mockdevice/mockdevice_pdi.h: -------------------------------------------------------------------------------- 1 | /********************** Mock Portable Device Interface ************************ 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #ifndef _MOCKDEVICE_PORTABLE_DEVICE_INTERFACE_H_ 12 | #define _MOCKDEVICE_PORTABLE_DEVICE_INTERFACE_H_ 13 | 14 | #include "LoggerInterface.h" 15 | #include "DatabaseInterface.h" 16 | #include "DeviceControlInterface.h" 17 | #include "ClientInterface.h" 18 | #include "ServerInterface.h" 19 | #ifdef ENABLE_WIFI_SERVICE 20 | #include "WiFiInterface.h" 21 | #endif 22 | #ifdef ENABLE_NETWORK_SERVICE 23 | #include "NtpInterface.h" 24 | #include "PingInterface.h" 25 | #endif 26 | #ifdef ENABLE_SERIAL_SERVICE 27 | #include "SerialInterface.h" 28 | #endif 29 | 30 | #endif // _MOCKDEVICE_PORTABLE_DEVICE_INTERFACE_H_ 31 | -------------------------------------------------------------------------------- /doc/configs-hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/configs-hierarchy.png -------------------------------------------------------------------------------- /doc/dashboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/dashboard.jpg -------------------------------------------------------------------------------- /doc/email-config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/email-config.jpg -------------------------------------------------------------------------------- /doc/ewings_stack.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/ewings_stack.jpg -------------------------------------------------------------------------------- /doc/gpio-alert-control.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/gpio-alert-control.jpg -------------------------------------------------------------------------------- /doc/gpio-control-menu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/gpio-control-menu.jpg -------------------------------------------------------------------------------- /doc/gpio-control.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/gpio-control.jpg -------------------------------------------------------------------------------- /doc/gpio-mode-config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/gpio-mode-config.jpg -------------------------------------------------------------------------------- /doc/gpio-monitor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/gpio-monitor.jpg -------------------------------------------------------------------------------- /doc/gpio-server-config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/gpio-server-config.jpg -------------------------------------------------------------------------------- /doc/login-config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/login-config.jpg -------------------------------------------------------------------------------- /doc/login-nav-page.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/login-nav-page.jpg -------------------------------------------------------------------------------- /doc/login-page.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/login-page.jpg -------------------------------------------------------------------------------- /doc/mqtt-general-config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/mqtt-general-config.jpg -------------------------------------------------------------------------------- /doc/mqtt-lwt-config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/mqtt-lwt-config.jpg -------------------------------------------------------------------------------- /doc/mqtt-pubsub-config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/mqtt-pubsub-config.jpg -------------------------------------------------------------------------------- /doc/mqtt-submenu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/mqtt-submenu.jpg -------------------------------------------------------------------------------- /doc/ota-config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/ota-config.jpg -------------------------------------------------------------------------------- /doc/pdi-framework.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/pdi-framework.jpg -------------------------------------------------------------------------------- /doc/portal_home_menu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/portal_home_menu.jpg -------------------------------------------------------------------------------- /doc/terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/terminal.png -------------------------------------------------------------------------------- /doc/wifi-config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/doc/wifi-config.jpg -------------------------------------------------------------------------------- /examples/DeviceIotExample/DeviceIotExample.ino: -------------------------------------------------------------------------------- 1 | /* stack initialize the services in setup and 2 | * should serve in loop continueously 3 | */ 4 | 5 | #include "DeviceIotSensor.h" 6 | 7 | DeviceIotSensor sensor; 8 | 9 | void setup() { 10 | PdiStack.initialize(); 11 | __device_iot_service.initDeviceIotSensor(&sensor); 12 | } 13 | 14 | void loop() { 15 | PdiStack.serve(); 16 | } 17 | -------------------------------------------------------------------------------- /examples/DeviceIotExample/DeviceIotSensor.h: -------------------------------------------------------------------------------- 1 | /*************************** Device IOT Sensor ******************************** 2 | This is free software. you can redistribute it and/or modify it but without any 3 | warranty. 4 | 5 | Author : Suraj I. 6 | created Date : 1st June 2019 7 | ******************************************************************************/ 8 | 9 | #ifndef _DEVICE_IOT_SENSOR_H_ 10 | #define _DEVICE_IOT_SENSOR_H_ 11 | 12 | #include 13 | 14 | #ifndef ENABLE_DEVICE_IOT 15 | #error "device iot service is disabled ( in config/Common.h of ewings esp framework library ). please enable(uncomment ENABLE_DEVICE_IOT) it for this example" 16 | #endif 17 | 18 | #define DEVICE_IOT_SENSOR_TYPE "sensor_t" 19 | 20 | /** 21 | * DeviceIotSensor class 22 | */ 23 | class DeviceIotSensor : public iDeviceIotInterface { 24 | 25 | public: 26 | 27 | /** 28 | * DeviceIotSensor constructor. 29 | */ 30 | DeviceIotSensor(); 31 | /** 32 | * DeviceIotSensor destructor 33 | */ 34 | ~DeviceIotSensor(); 35 | 36 | void init( void ); 37 | void sampleHook( void ); 38 | void dataHook( pdiutil::string &_payload ); 39 | void resetSampleHook( void ); 40 | 41 | protected: 42 | /** 43 | * @var sensor variables 44 | */ 45 | double m_sensor_samples[SENSOR_DATA_SAMPLES_PER_PUBLISH_MAX_BUFF]; 46 | uint16_t m_sensor_sample_index; 47 | double m_sensor_sample_value; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /examples/PdiStack/PdiStack.ino: -------------------------------------------------------------------------------- 1 | /* stack initialize the services in setup and 2 | * should serve in loop continueously 3 | */ 4 | 5 | #include 6 | 7 | void setup() { 8 | PdiStack.initialize(); 9 | } 10 | 11 | void loop() { 12 | PdiStack.serve(); 13 | } 14 | -------------------------------------------------------------------------------- /external/LittleFSWrapper.c: -------------------------------------------------------------------------------- 1 | /***************************** LittleFS Wrapper ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 6th Apr 2025 9 | ******************************************************************************/ 10 | 11 | // #pragma GCC diagnostic ignored "-Wmissing-field-initializers" 12 | #define LFS_NAME_MAX 24 13 | #define LFS_NO_DEBUG 14 | #define LFS_NO_WARN 15 | #define LFS_NO_ERROR 16 | 17 | #include "littlefs/lfs_util.c" 18 | #include "littlefs/lfs.c" 19 | -------------------------------------------------------------------------------- /keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For PDISTACK 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | PdiStack KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | initialize KEYWORD2 16 | serve KEYWORD2 17 | 18 | ####################################### 19 | # Constants (LITERAL1) 20 | ####################################### 21 | 22 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=pdi-framework 2 | version=1.1.6 3 | author=Suraj I. 4 | maintainer=Suraj I. 5 | sentence=pdi framework stack for easy configurable applications 6 | paragraph=pdi framework includes all services like gpio, wifi, http, mqtt, ntp, ota, napt, espnow, mesh, server etc. which are ready to use in all applications 7 | category=Other 8 | url=https://github.com/Suraj151/pdi-framework 9 | architectures=avr,esp8266,esp32 10 | dot_a_linkage=true 11 | -------------------------------------------------------------------------------- /lwip/include/arch/sys_arch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/include/arch/sys_arch.h -------------------------------------------------------------------------------- /lwip/include/lwip/app/espconn_buf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ringbuf.h 3 | * 4 | * Created on: Apr 22, 2016 5 | * Author: liuhan 6 | */ 7 | 8 | #ifndef _ESPCONN_BUF_H_ 9 | #define _ESPCONN_BUF_H_ 10 | 11 | /* 12 | * ringbuffer.c 13 | * 14 | * Created on: Apr 22, 2016 15 | * Author: liuhan 16 | */ 17 | #include "c_types.h" 18 | 19 | #include "ets_sys.h" 20 | #include "os_type.h" 21 | 22 | typedef struct ringbuf_t { 23 | uint8_t *buf; 24 | uint8_t *head, *tail; 25 | size_t size; 26 | } ringbuf, *ringbuf_t; 27 | 28 | ringbuf_t ringbuf_new(size_t capacity); 29 | 30 | size_t ringbuf_buffer_size(const struct ringbuf_t *rb); 31 | 32 | void ringbuf_reset(ringbuf_t rb); 33 | 34 | void ringbuf_free(ringbuf_t *rb); 35 | 36 | size_t ringbuf_capacity(const struct ringbuf_t *rb); 37 | 38 | size_t ringbuf_bytes_free(const struct ringbuf_t *rb); 39 | 40 | size_t ringbuf_bytes_used(const struct ringbuf_t *rb); 41 | 42 | int ringbuf_is_full(const struct ringbuf_t *rb); 43 | 44 | int ringbuf_is_empty(const struct ringbuf_t *rb); 45 | 46 | const void* ringbuf_tail(const struct ringbuf_t *rb); 47 | 48 | const void* ringbuf_head(const struct ringbuf_t *rb); 49 | 50 | static uint8_t *ringbuf_nextp(ringbuf_t rb, const uint8_t *p); 51 | 52 | size_t ringbuf_findchr(const struct ringbuf_t *rb, int c, size_t offset); 53 | 54 | size_t ringbuf_memset(ringbuf_t dst, int c, size_t len); 55 | 56 | void *ringbuf_memcpy_into(ringbuf_t dst, const void *src, size_t count); 57 | 58 | void *ringbuf_memcpy_from(void *dst, ringbuf_t src, size_t count); 59 | 60 | #endif /* RINGBUF_H_ */ 61 | -------------------------------------------------------------------------------- /lwip/include/lwip/ip_route.h: -------------------------------------------------------------------------------- 1 | #ifndef __LWIP_IP_ROUTE_H__ 2 | #define __LWIP_IP_ROUTE_H__ 3 | 4 | #include "lwip/opt.h" 5 | #include "lwip/ip_addr.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define MAX_ROUTES 50 12 | 13 | struct route_entry { 14 | ip_addr_t ip; 15 | ip_addr_t mask; 16 | ip_addr_t gw; 17 | }; 18 | 19 | extern struct route_entry ip_rt_table[MAX_ROUTES]; 20 | extern int ip_route_max; 21 | 22 | /* Add a static route, true on success */ 23 | bool ip_add_route(ip_addr_t ip, ip_addr_t mask, ip_addr_t gw); 24 | 25 | /* Remove a static route, true on success */ 26 | bool ip_rm_route(ip_addr_t ip, ip_addr_t mask); 27 | 28 | /* Finds a route entry for an address, NULL if none */ 29 | struct route_entry *ip_find_route(ip_addr_t ip); 30 | 31 | /* Delete all static routes */ 32 | void ip_delete_routes(void); 33 | 34 | /* Returns the n_th entry of the routing table, true on success */ 35 | bool ip_get_route(uint32_t no, ip_addr_t *ip, ip_addr_t *mask, ip_addr_t *gw); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* __LWIP_IP_ROUTE_H__ */ 42 | -------------------------------------------------------------------------------- /lwip/include/lwip/puck_def.h: -------------------------------------------------------------------------------- 1 | /* 2 | * puck_def.h 3 | * 4 | * Created on: Jul 22, 2010 5 | * Author: dtoma 6 | */ 7 | 8 | #ifndef PUCK_DEF_H_ 9 | #define PUCK_DEF_H_ 10 | 11 | 12 | 13 | #define INSTRUMENT_PORT 8760 14 | 15 | #define INSTRUMENT_LENGTH 80 16 | 17 | #define MDNS_NAME_LENGTH 68 //68 18 | 19 | char* PUCK_SERVICE = NULL; 20 | //#define PUCK_SERVICE "_Escpressif._tcp.local" 21 | #define DNS_SD_SERVICE "_services._dns-sd._udp.local" 22 | #define SERVICE_DESCRIPTION "PUCK PROTOCOL" 23 | #define PUCK_SERVICE_LENGTH 30 24 | 25 | #define UUID_LEN 16 26 | #define DS_VERS_LEN 2 27 | #define DS_SIZE_LEN 2 28 | #define MAN_ID_LEN 4 29 | #define MAN_MODEL_LEN 2 30 | #define MAN_VERS_LEN 2 31 | #define SER_NUM_LEN 4 32 | #define NAME_LEN 64 33 | #define PUCK_DATASHEET_SIZE 96 34 | 35 | #define UUID_OFFSET 0 36 | #define DS_VERS_OFFSET UUID_LEN + UUID_OFFSET 37 | #define DS_SIZE_OFFSET DS_VERS_LEN + DS_VERS_OFFSET 38 | #define MAN_ID_OFFSET DS_SIZE_LEN + DS_SIZE_OFFSET 39 | #define MAN_MODEL_OFFSET MAN_ID_LEN + MAN_ID_OFFSET 40 | #define MAN_VERS_OFFSET MAN_MODEL_LEN + MAN_MODEL_OFFSET 41 | #define SER_NUM_OFFSET MAN_VERS_LEN + MAN_VERS_OFFSET 42 | #define NAME_OFFSET SER_NUM_LEN + SER_NUM_OFFSET 43 | 44 | #endif /* __PUCK_DEF_H__ */ 45 | -------------------------------------------------------------------------------- /lwip/include/lwip/sntp.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_SNTP_H 2 | #define LWIP_SNTP_H 3 | 4 | #include "lwip/opt.h" 5 | #include "lwip/ip_addr.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef long time_t; 12 | 13 | /** The maximum number of SNTP servers that can be set */ 14 | #ifndef SNTP_MAX_SERVERS 15 | #define SNTP_MAX_SERVERS 3 16 | #endif 17 | 18 | /** Set this to 1 to implement the callback function called by dhcp when 19 | * NTP servers are received. */ 20 | #ifndef SNTP_GET_SERVERS_FROM_DHCP 21 | #define SNTP_GET_SERVERS_FROM_DHCP 0//LWIP_DHCP_GET_NTP_SRV 22 | #endif 23 | 24 | /* Set this to 1 to support DNS names (or IP address strings) to set sntp servers */ 25 | #ifndef SNTP_SERVER_DNS 26 | #define SNTP_SERVER_DNS 1 27 | #endif 28 | 29 | bool sntp_get_timetype(void); 30 | void sntp_set_receive_time_size(void); 31 | /** One server address/name can be defined as default if SNTP_SERVER_DNS == 1: 32 | * #define SNTP_SERVER_ADDRESS "pool.ntp.org" 33 | */ 34 | uint32 sntp_get_current_timestamp(); 35 | char* sntp_get_real_time(long t); 36 | 37 | void sntp_init(void); 38 | void sntp_stop(void); 39 | 40 | sint8 sntp_get_timezone(void); 41 | bool sntp_set_timezone(sint8 timezone); 42 | void sntp_setserver(u8_t idx, ip_addr_t *addr); 43 | ip_addr_t sntp_getserver(u8_t idx); 44 | 45 | #if SNTP_SERVER_DNS 46 | void sntp_setservername(u8_t idx, char *server); 47 | char *sntp_getservername(u8_t idx); 48 | #endif /* SNTP_SERVER_DNS */ 49 | 50 | #if SNTP_GET_SERVERS_FROM_DHCP 51 | void sntp_servermode_dhcp(int set_servers_from_dhcp); 52 | #else /* SNTP_GET_SERVERS_FROM_DHCP */ 53 | #define sntp_servermode_dhcp(x) 54 | #endif /* SNTP_GET_SERVERS_FROM_DHCP */ 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* LWIP_SNTP_H */ 61 | -------------------------------------------------------------------------------- /lwip/include/netif/wlan_lwip_if.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2011 Espressif System 3 | * 4 | */ 5 | 6 | #ifndef _WLAN_LWIP_IF_H_ 7 | #define _WLAN_LWIP_IF_H_ 8 | 9 | #define LWIP_IF0_PRIO 28 10 | #define LWIP_IF1_PRIO 29 11 | 12 | enum { 13 | SIG_LWIP_RX = 0, 14 | }; 15 | 16 | struct netif * eagle_lwip_if_alloc(struct ieee80211_conn *conn, const uint8 *macaddr, struct ip_info *info); 17 | struct netif * eagle_lwip_getif(uint8 index); 18 | 19 | #ifndef IOT_SIP_MODE 20 | sint8 ieee80211_output_pbuf(struct netif *ifp, struct pbuf* pb); 21 | #else 22 | sint8 ieee80211_output_pbuf(struct ieee80211_conn *conn, esf_buf *eb); 23 | #endif 24 | 25 | #endif /* _WLAN_LWIP_IF_H_ */ 26 | -------------------------------------------------------------------------------- /lwip/src/Makefile: -------------------------------------------------------------------------------- 1 | TOOLCHAIN_DIR ?= ../../../xtensa-lx106-elf 2 | TOOLS_PATH ?= $(TOOLCHAIN_DIR)/bin/xtensa-lx106-elf- 3 | LWIP_LIB ?= liblwip_src.a 4 | SDK_PATH ?= $(abspath ../../) 5 | 6 | BUILD_PATH = build 7 | LWIP_SRCS = $(patsubst %.c,$(BUILD_PATH)/%.o,$(wildcard */*.c)) $(patsubst %.c,$(BUILD_PATH)/%.o,$(wildcard */*/*.c)) 8 | 9 | LWIP_INCLUDE = -Ibuild -I$(SDK_PATH)/include -I$(SDK_PATH)/lwip/include 10 | BUILD_FLAGS = -c -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=gnu99 -ffunction-sections -fdata-sections 11 | BUILD_DEFINES = -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -DLWIP_OPEN_SRC 12 | 13 | ifdef WITH_DEBUG_PREFIX_MAP 14 | EXTRA_FLAGS = -fdebug-prefix-map=$(PWD)= -fdebug-prefix-map=$(TOOLCHAIN_DIR)=xtensa-lx106-elf -gno-record-gcc-switches 15 | endif 16 | 17 | CC=$(TOOLS_PATH)gcc 18 | AR=$(TOOLS_PATH)ar 19 | 20 | $(BUILD_PATH)/%.h: 21 | @mkdir -p $(dir $@) 22 | @touch $@ 23 | 24 | $(BUILD_PATH)/%.o: %.c 25 | @mkdir -p $(dir $@) 26 | $(CC) $(BUILD_FLAGS) $(BUILD_DEFINES) $(LWIP_INCLUDE) $(EXTRA_FLAGS) $< -o $@ 27 | 28 | $(LWIP_LIB): $(BUILD_PATH)/user_config.h $(LWIP_SRCS) 29 | $(AR) cru $(LWIP_LIB) $(LWIP_SRCS) 30 | 31 | all: $(LWIP_LIB) 32 | 33 | install: all 34 | cp -f $(LWIP_LIB) $(SDK_PATH)/lib/$(LWIP_LIB) 35 | 36 | release: all 37 | cp -f $(LWIP_LIB) $(SDK_PATH)/lib/liblwip_gcc.a 38 | 39 | clean: 40 | @rm -rf $(BUILD_PATH) $(LWIP_LIB) 41 | -------------------------------------------------------------------------------- /lwip/src/api/netbuf.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/api/netbuf.c -------------------------------------------------------------------------------- /lwip/src/api/tcpip.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/api/tcpip.c -------------------------------------------------------------------------------- /lwip/src/build/api/api_lib.d: -------------------------------------------------------------------------------- 1 | build/api/api_lib.o: api/api_lib.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h 13 | -------------------------------------------------------------------------------- /lwip/src/build/api/api_lib.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/api/api_lib.o -------------------------------------------------------------------------------- /lwip/src/build/api/api_msg.d: -------------------------------------------------------------------------------- 1 | build/api/api_msg.o: api/api_msg.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h 13 | -------------------------------------------------------------------------------- /lwip/src/build/api/api_msg.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/api/api_msg.o -------------------------------------------------------------------------------- /lwip/src/build/api/err.d: -------------------------------------------------------------------------------- 1 | build/api/err.o: api/err.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/err.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 12 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 13 | build/user_config.h 14 | -------------------------------------------------------------------------------- /lwip/src/build/api/err.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/api/err.o -------------------------------------------------------------------------------- /lwip/src/build/api/netbuf.d: -------------------------------------------------------------------------------- 1 | build/api/netbuf.o: api/netbuf.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h 13 | -------------------------------------------------------------------------------- /lwip/src/build/api/netbuf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/api/netbuf.o -------------------------------------------------------------------------------- /lwip/src/build/api/netdb.d: -------------------------------------------------------------------------------- 1 | build/api/netdb.o: api/netdb.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/netdb.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 12 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 13 | build/user_config.h 14 | -------------------------------------------------------------------------------- /lwip/src/build/api/netdb.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/api/netdb.o -------------------------------------------------------------------------------- /lwip/src/build/api/netifapi.d: -------------------------------------------------------------------------------- 1 | build/api/netifapi.o: api/netifapi.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h 13 | -------------------------------------------------------------------------------- /lwip/src/build/api/netifapi.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/api/netifapi.o -------------------------------------------------------------------------------- /lwip/src/build/api/sockets.d: -------------------------------------------------------------------------------- 1 | build/api/sockets.o: api/sockets.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h 13 | -------------------------------------------------------------------------------- /lwip/src/build/api/sockets.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/api/sockets.o -------------------------------------------------------------------------------- /lwip/src/build/api/tcpip.d: -------------------------------------------------------------------------------- 1 | build/api/tcpip.o: api/tcpip.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h 13 | -------------------------------------------------------------------------------- /lwip/src/build/api/tcpip.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/api/tcpip.o -------------------------------------------------------------------------------- /lwip/src/build/app/dhcpserver.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/app/dhcpserver.o -------------------------------------------------------------------------------- /lwip/src/build/app/espconn.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/app/espconn.o -------------------------------------------------------------------------------- /lwip/src/build/app/espconn_buf.d: -------------------------------------------------------------------------------- 1 | build/app/espconn_buf.o: app/espconn_buf.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/memp.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 12 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 13 | build/user_config.h \ 14 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/memp_std.h \ 15 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/mem.h \ 16 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/def.h \ 17 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/os_type.h \ 18 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 19 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/app/espconn_buf.h 20 | -------------------------------------------------------------------------------- /lwip/src/build/app/espconn_buf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/app/espconn_buf.o -------------------------------------------------------------------------------- /lwip/src/build/app/espconn_mdns.d: -------------------------------------------------------------------------------- 1 | build/app/espconn_mdns.o: app/espconn_mdns.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/os_type.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/mdns.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 12 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 13 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 14 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 15 | build/user_config.h 16 | -------------------------------------------------------------------------------- /lwip/src/build/app/espconn_mdns.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/app/espconn_mdns.o -------------------------------------------------------------------------------- /lwip/src/build/app/espconn_tcp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/app/espconn_tcp.o -------------------------------------------------------------------------------- /lwip/src/build/app/espconn_udp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/app/espconn_udp.o -------------------------------------------------------------------------------- /lwip/src/build/app/netio.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/app/netio.o -------------------------------------------------------------------------------- /lwip/src/build/app/ping.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/app/ping.o -------------------------------------------------------------------------------- /lwip/src/build/core/def.d: -------------------------------------------------------------------------------- 1 | build/core/def.o: core/def.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h \ 13 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/def.h 14 | -------------------------------------------------------------------------------- /lwip/src/build/core/def.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/def.o -------------------------------------------------------------------------------- /lwip/src/build/core/dhcp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/dhcp.o -------------------------------------------------------------------------------- /lwip/src/build/core/dns.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/dns.o -------------------------------------------------------------------------------- /lwip/src/build/core/init.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/init.o -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/autoip.d: -------------------------------------------------------------------------------- 1 | build/core/ipv4/autoip.o: core/ipv4/autoip.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h 13 | -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/autoip.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/ipv4/autoip.o -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/icmp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/ipv4/icmp.o -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/igmp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/ipv4/igmp.o -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/inet.d: -------------------------------------------------------------------------------- 1 | build/core/ipv4/inet.o: core/ipv4/inet.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h \ 13 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/inet.h \ 14 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/def.h \ 15 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/ip_addr.h 16 | -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/inet.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/ipv4/inet.o -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/inet_chksum.d: -------------------------------------------------------------------------------- 1 | build/core/ipv4/inet_chksum.o: core/ipv4/inet_chksum.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h \ 13 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/inet_chksum.h \ 14 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/pbuf.h \ 15 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/err.h \ 16 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/ip_addr.h \ 17 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/def.h 18 | -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/inet_chksum.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/ipv4/inet_chksum.o -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/ip.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/ipv4/ip.o -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/ip_addr.d: -------------------------------------------------------------------------------- 1 | build/core/ipv4/ip_addr.o: core/ipv4/ip_addr.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h \ 13 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/ip_addr.h \ 14 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/def.h \ 15 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/netif.h \ 16 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/err.h \ 17 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/pbuf.h 18 | -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/ip_addr.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/ipv4/ip_addr.o -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/ip_frag.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/ipv4/ip_frag.o -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/ip_route.d: -------------------------------------------------------------------------------- 1 | build/core/ipv4/ip_route.o: core/ipv4/ip_route.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h \ 13 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/ip.h \ 14 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/def.h \ 15 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/pbuf.h \ 16 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/err.h \ 17 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/ip_addr.h \ 18 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/netif.h \ 19 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/ip_route.h 20 | -------------------------------------------------------------------------------- /lwip/src/build/core/ipv4/ip_route.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/ipv4/ip_route.o -------------------------------------------------------------------------------- /lwip/src/build/core/mdns.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/mdns.o -------------------------------------------------------------------------------- /lwip/src/build/core/mem.d: -------------------------------------------------------------------------------- 1 | build/core/mem.o: core/mem.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h 13 | -------------------------------------------------------------------------------- /lwip/src/build/core/mem.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/mem.o -------------------------------------------------------------------------------- /lwip/src/build/core/memp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/memp.o -------------------------------------------------------------------------------- /lwip/src/build/core/netif.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/netif.o -------------------------------------------------------------------------------- /lwip/src/build/core/pbuf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/pbuf.o -------------------------------------------------------------------------------- /lwip/src/build/core/raw.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/raw.o -------------------------------------------------------------------------------- /lwip/src/build/core/sntp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/sntp.o -------------------------------------------------------------------------------- /lwip/src/build/core/stats.d: -------------------------------------------------------------------------------- 1 | build/core/stats.o: core/stats.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h 13 | -------------------------------------------------------------------------------- /lwip/src/build/core/stats.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/stats.o -------------------------------------------------------------------------------- /lwip/src/build/core/sys.d: -------------------------------------------------------------------------------- 1 | build/core/sys.o: core/sys.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 7 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 12 | build/user_config.h \ 13 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/sys.h \ 14 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h 15 | -------------------------------------------------------------------------------- /lwip/src/build/core/sys.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/sys.o -------------------------------------------------------------------------------- /lwip/src/build/core/sys_arch.d: -------------------------------------------------------------------------------- 1 | build/core/sys_arch.o: core/sys_arch.c \ 2 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 3 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 4 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/c_types.h \ 5 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h \ 6 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h \ 7 | build/user_config.h \ 8 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/os_type.h \ 9 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/ets_sys.h \ 10 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/opt.h \ 11 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwipopts.h \ 12 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/debug.h \ 13 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/arch.h \ 14 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/arch/cc.h \ 15 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/lwip/include/lwip/sys.h \ 16 | /home/suraj/Arduino/hardware/esp8266com/esp8266/tools/sdk/include/eagle_soc.h 17 | -------------------------------------------------------------------------------- /lwip/src/build/core/sys_arch.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/sys_arch.o -------------------------------------------------------------------------------- /lwip/src/build/core/tcp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/tcp.o -------------------------------------------------------------------------------- /lwip/src/build/core/tcp_in.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/tcp_in.o -------------------------------------------------------------------------------- /lwip/src/build/core/tcp_out.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/tcp_out.o -------------------------------------------------------------------------------- /lwip/src/build/core/timers.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/timers.o -------------------------------------------------------------------------------- /lwip/src/build/core/udp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/core/udp.o -------------------------------------------------------------------------------- /lwip/src/build/netif/etharp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/netif/etharp.o -------------------------------------------------------------------------------- /lwip/src/build/user_config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/build/user_config.h -------------------------------------------------------------------------------- /lwip/src/core/sys_arch.c: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2010 - 2011 espressif system 3 | */ 4 | 5 | #include "c_types.h" 6 | #include "ets_sys.h" 7 | #include "osapi.h" 8 | #include "os_type.h" 9 | 10 | #include "lwip/opt.h" 11 | #include "lwip/sys.h" 12 | 13 | #include "eagle_soc.h" 14 | -------------------------------------------------------------------------------- /lwip/src/liblwip_src.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Suraj151/esp8266-framework/a062461ee0e2d2bb392f3bee4bee44e78d647842/lwip/src/liblwip_src.a -------------------------------------------------------------------------------- /scripts/CreateDBSourceFromJson.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | """ 4 | Create sets of DB C++ classes based on json schemas 5 | """ 6 | 7 | import os 8 | import sys 9 | import argparse 10 | 11 | # consts 12 | IsPython3 = ( sys.version_info[0] >= 3 ) 13 | 14 | def cleanpath(pathtoclean): 15 | 16 | path = os.path.dirname(os.path.realpath(__file__)) 17 | 18 | if not path.endswith(os.sep): 19 | path += os.sep 20 | 21 | if pathtoclean != "": 22 | path += pathtoclean 23 | 24 | if not path.endswith(os.sep): 25 | path += os.sep 26 | 27 | dir_list = os.listdir(path) 28 | 29 | for file in dir_list: 30 | os.remove(path+file) 31 | 32 | if __name__ == "__main__": 33 | 34 | usage = """ 35 | CreateDBSourceFromJson 36 | 37 | CreateDBSourceFromJson [--schema|-s schema] [--outpath|-o outpath] 38 | """ 39 | 40 | parser = argparse.ArgumentParser(usage=usage) 41 | 42 | parser.add_argument('--schema', '-s', 43 | help='schema file to process', 44 | default='../src/database/config/DBTableSchema.json' 45 | ) 46 | parser.add_argument('--outpath', '-o', 47 | help='folder path to store auto generated files', 48 | default='../src/database/tables' 49 | ) 50 | 51 | args = parser.parse_args() 52 | 53 | try: 54 | 55 | schema = args.schema 56 | outpath = args.outpath 57 | cleanpath(outpath) 58 | os.system('python3 JsonToCpp.py -s ' + schema + ' -o ' + outpath) 59 | 60 | except Exception as ex: 61 | print("Exception : %s" %ex) 62 | 63 | except KeyboardInterrupt: 64 | print("Aborted by keyboard interrupt !") -------------------------------------------------------------------------------- /src/config/Common.h: -------------------------------------------------------------------------------- 1 | /*************************** Common Config page ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | #ifndef _COMMON_CONFIG_H_ 11 | #define _COMMON_CONFIG_H_ 12 | 13 | #include 14 | 15 | /** 16 | * @define common time durations 17 | */ 18 | #define MILLISECOND_DURATION_1000 1000 19 | #define MILLISECOND_DURATION_5000 5000 20 | #define MILLISECOND_DURATION_10000 10000 21 | 22 | /** 23 | * @define default username/ssid and password 24 | */ 25 | #if defined(ENABLE_HTTP_SERVER) || defined(ENABLE_AUTH_SERVICE) || defined(ENABLE_WIFI_SERVICE) 26 | #define USER "pdiStack" 27 | #define PASSPHRASE "pdiStack@123" 28 | #endif 29 | 30 | /** 31 | * @define general http parameters 32 | */ 33 | #define HTTP_HOST_ADDR_MAX_SIZE 100 34 | #define HTTP_REQUEST_DURATION MILLISECOND_DURATION_10000 35 | #define HTTP_REQUEST_RETRY 1 36 | 37 | /** 38 | * max tasks and callbacks 39 | */ 40 | #define MAX_SCHEDULABLE_TASKS 25 41 | #define MAX_FACTORY_RESET_CALLBACKS MAX_SCHEDULABLE_TASKS 42 | 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/config/EventConfig.h: -------------------------------------------------------------------------------- 1 | /*************************** Event Config page ******************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | #ifndef _EVENT_CONFIG_H_ 11 | #define _EVENT_CONFIG_H_ 12 | 13 | #include "Common.h" 14 | 15 | /** 16 | * max event listener callbacks 17 | */ 18 | #define MAX_EVENT_LISTENERS MAX_SCHEDULABLE_TASKS 19 | 20 | /** 21 | * available event names 22 | */ 23 | typedef enum event_name{ 24 | 25 | EVENT_WIFI_STA_CONNECTED = 0, 26 | EVENT_WIFI_STA_DISCONNECTED, 27 | EVENT_WIFI_AP_STACONNECTED, 28 | EVENT_WIFI_AP_STADISCONNECTED, 29 | EVENT_FACTORY_RESET, 30 | EVENT_SERIAL_AVAILABLE, 31 | EVENT_NAME_MAX, 32 | } event_name_t; 33 | 34 | /** 35 | * event listener struct type for event 36 | */ 37 | typedef struct event_listener { 38 | 39 | // Default Constructor 40 | event_listener(){ 41 | clear(); 42 | } 43 | 44 | // Clear members method 45 | void clear(){ 46 | _event = 0; 47 | _event_handler = nullptr; 48 | } 49 | 50 | int _event; 51 | CallBackVoidPointerArgFn _event_handler; 52 | } event_listener_t; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/config/GlobalConfig.h: -------------------------------------------------------------------------------- 1 | /*************************** Global Config page ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | #ifndef _GLOBAL_CONFIG_H_ 11 | #define _GLOBAL_CONFIG_H_ 12 | 13 | #include "Common.h" 14 | 15 | /** 16 | * common default configurations for all stack 17 | */ 18 | #define CONFIG_START 5 19 | #define CONFIG_VERSION "1.0" 20 | #define FIRMWARE_VERSION 2019041100 21 | #define RELEASE "uEOS-A" 22 | #define LAUNCH_YEAR 19 23 | #define LAUNCH_UNIX_TIME 1546300800 // 2019 Unix time stamp 24 | 25 | struct global_config { 26 | 27 | // Default Constructor 28 | global_config(){ 29 | clear(); 30 | } 31 | 32 | // Clear members method 33 | void clear(){ 34 | memset(config_version, 0, 4); 35 | memcpy(config_version, CONFIG_VERSION, sizeof(CONFIG_VERSION)); 36 | current_year = LAUNCH_YEAR; 37 | firmware_version = FIRMWARE_VERSION; 38 | } 39 | 40 | char config_version[4]; 41 | uint8_t current_year; 42 | uint32_t firmware_version; 43 | }; 44 | 45 | 46 | // const global_config PROGMEM _global_config_defaults = { 47 | // CONFIG_VERSION, LAUNCH_YEAR, FIRMWARE_VERSION 48 | // }; 49 | 50 | const int global_config_size = sizeof(global_config) + 5; 51 | 52 | using global_config_table = global_config; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/config/NetworkConfig.h: -------------------------------------------------------------------------------- 1 | /*************************** Network Config page ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | #ifndef _NETWORK_CONFIG_H_ 11 | #define _NETWORK_CONFIG_H_ 12 | 13 | #include "Common.h" 14 | 15 | /** 16 | * network configurations for device communication 17 | */ 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/config/OtaConfig.h: -------------------------------------------------------------------------------- 1 | /****************************** OTA Config page ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | #ifndef _OTA_CONFIG_H_ 11 | #define _OTA_CONFIG_H_ 12 | 13 | #include "Common.h" 14 | 15 | #define OTA_HOST_BUF_SIZE 50 16 | #define OTA_VERSION_KEY "latest" 17 | #define OTA_VERSION_LENGTH 15 18 | #define OTA_VERSION_API_RESP_LENGTH OTA_HOST_BUF_SIZE 19 | #define OTA_API_CHECK_DURATION 15000 20 | 21 | #define OTA_VERSION_CHECK_URL "/api/fordevice/ota-version?mac_id=[mac]" 22 | #define OTA_BINARY_DOWNLOAD_URL "/api/fordevice/ota-bin?mac_id=[mac]&version=" 23 | 24 | /** 25 | * enable/disable ota config modification here 26 | */ 27 | #define ALLOW_OTA_CONFIG_MODIFICATION 28 | 29 | struct ota_configs { 30 | 31 | // Default Constructor 32 | ota_configs(){ 33 | clear(); 34 | } 35 | 36 | // Clear members method 37 | void clear(){ 38 | memset(ota_host, 0, OTA_HOST_BUF_SIZE); 39 | ota_port = 80; 40 | } 41 | 42 | char ota_host[OTA_HOST_BUF_SIZE]; 43 | int ota_port; 44 | }; 45 | 46 | // const ota_configs PROGMEM _ota_config_defaults = { 47 | // {0}, 80 48 | // }; 49 | 50 | const int ota_config_size = sizeof(ota_configs) + 5; 51 | 52 | using ota_config_table = ota_configs; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/helpers/ClientHelper.h: -------------------------------------------------------------------------------- 1 | /******************************* Client helper ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _CLIENT_HELPER_H_ 12 | #define _CLIENT_HELPER_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | /* client support functions */ 19 | 20 | bool connectToServer( iClientInterface *client, char *host, uint16_t port, uint16_t timeout=500 ); 21 | bool disconnect( iClientInterface *client ); 22 | bool isConnected( iClientInterface *client ); 23 | bool sendPacket( iClientInterface *client, uint8_t *buffer, uint16_t len ); 24 | uint16_t readPacket( iClientInterface *client, uint8_t *buffer, uint16_t maxlen, int32_t timeout, uint8_t readUntilChar=0 ); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/interface/interface_includes.h: -------------------------------------------------------------------------------- 1 | /***************************** Interface Includes ***************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _INTERFACE_INCLUDES_H_ 12 | #define _INTERFACE_INCLUDES_H_ 13 | 14 | #include 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/interface/pdi.c: -------------------------------------------------------------------------------- 1 | /*********************** Device Control Interface ***************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #include "../../devices/DeviceConfig.h" 12 | 13 | #if defined(DEVICE_ESP32) 14 | #include "../../devices/esp32/esp32_pdi.c" 15 | #elif defined(DEVICE_ESP8266) 16 | #include "../../devices/esp8266/esp8266_pdi.c" 17 | #elif defined(DEVICE_ARDUINOUNO) 18 | #include "../../devices/arduinouno/arduinouno_pdi.c" 19 | #else 20 | #include "../../devices/mockdevice/mockdevice_pdi.c" 21 | #endif 22 | -------------------------------------------------------------------------------- /src/interface/pdi.cpp: -------------------------------------------------------------------------------- 1 | /*********************** Device Control Interface ***************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #include "pdi.h" 12 | 13 | #if defined(DEVICE_ESP32) 14 | #include "../../devices/esp32/esp32_pdi.cpp" 15 | #elif defined(DEVICE_ESP8266) 16 | #include "../../devices/esp8266/esp8266_pdi.cpp" 17 | #elif defined(DEVICE_ARDUINOUNO) 18 | #include "../../devices/arduinouno/arduinouno_pdi.cpp" 19 | #else 20 | #include "../../devices/mockdevice/mockdevice_pdi.cpp" 21 | #endif 22 | -------------------------------------------------------------------------------- /src/interface/pdi.h: -------------------------------------------------------------------------------- 1 | /*********************** Device Control Interface ***************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #ifndef _PORTABLE_DEVICE_INTERFACE_H_ 12 | #define _PORTABLE_DEVICE_INTERFACE_H_ 13 | 14 | #include 15 | 16 | #if defined(DEVICE_ESP32) 17 | #include "../../devices/esp32/esp32_pdi.h" 18 | #elif defined(DEVICE_ESP8266) 19 | #include "../../devices/esp8266/esp8266_pdi.h" 20 | #elif defined(DEVICE_ARDUINOUNO) 21 | #include "../../devices/arduinouno/arduinouno_pdi.h" 22 | #else 23 | #include "../../devices/mockdevice/mockdevice_pdi.h" 24 | #endif 25 | 26 | #include 27 | 28 | #endif // _PORTABLE_DEVICE_INTERFACE_H_ 29 | -------------------------------------------------------------------------------- /src/interface/pdi/drivers/iWdtInterface.h: -------------------------------------------------------------------------------- 1 | /************************ watchdog timer Interface *************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #ifndef _I_WATCHDOG_TIMER_INTERFACE_H_ 12 | #define _I_WATCHDOG_TIMER_INTERFACE_H_ 13 | 14 | #include 15 | 16 | /** 17 | * iWdtInterface class 18 | * 19 | * This interface handles watchdog timer operations of device 20 | */ 21 | class iWdtInterface 22 | { 23 | 24 | public: 25 | /** 26 | * iWdtInterface constructor. 27 | */ 28 | iWdtInterface(){} 29 | 30 | /** 31 | * iWdtInterface destructor. 32 | */ 33 | virtual ~iWdtInterface(){} 34 | 35 | // Wdt methods 36 | virtual void enableWdt(uint8_t mode_if_any=0) = 0; 37 | virtual void disableWdt() = 0; 38 | virtual void feedWdt() = 0; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/interface/pdi/iDatabaseInterface.h: -------------------------------------------------------------------------------- 1 | /***************************** Database Interface ***************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #ifndef _I_DATABASE_INTERFACE_H_ 12 | #define _I_DATABASE_INTERFACE_H_ 13 | 14 | #include 15 | 16 | 17 | // forward declaration of derived class for this interface 18 | class DatabaseInterface; 19 | 20 | /** 21 | * iDatabaseInterface class 22 | */ 23 | class iDatabaseInterface 24 | { 25 | 26 | public: 27 | /** 28 | * iDatabaseInterface constructor. 29 | */ 30 | iDatabaseInterface() {} 31 | /** 32 | * iDatabaseInterface destructor. 33 | */ 34 | virtual ~iDatabaseInterface() {} 35 | 36 | virtual void beginConfigs(uint32_t _size) = 0; 37 | virtual void cleanAllConfigs() = 0; 38 | virtual bool isValidConfigs() = 0; 39 | virtual uint32_t getMaxDBSize() = 0; 40 | 41 | /** 42 | * Below template methods are must to define by derived 43 | */ 44 | 45 | // template 46 | // void saveConfig(uint16_t _address, T *_object); 47 | 48 | // template 49 | // void loadConfig(uint16_t _address, T *_object); 50 | 51 | // template 52 | // void clearConfig(uint16_t _address); 53 | }; 54 | 55 | // derived class must define this 56 | extern DatabaseInterface __i_db; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/interface/pdi/iDeviceIotInterface.h: -------------------------------------------------------------------------------- 1 | /************************** Device Iot Interface ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _I_DEVICE_IOT_INTERFACE_H_ 12 | #define _I_DEVICE_IOT_INTERFACE_H_ 13 | 14 | #include 15 | 16 | /** 17 | * iDeviceIotInterface class 18 | */ 19 | class iDeviceIotInterface { 20 | 21 | public: 22 | 23 | /** 24 | * iDeviceIotInterface constructor. 25 | */ 26 | iDeviceIotInterface(){} 27 | /** 28 | * iDeviceIotInterface destructor. 29 | */ 30 | virtual ~iDeviceIotInterface(){} 31 | 32 | virtual void init( void ) = 0; 33 | virtual void sampleHook( void ) = 0; 34 | virtual void dataHook( pdiutil::string &_payload ) = 0; 35 | virtual void resetSampleHook( void ) = 0; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/interface/pdi/middlewares/iNtpInterface.h: -------------------------------------------------------------------------------- 1 | /************************ i network time Interface **************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _I_NTP_INTERFACE_H_ 12 | #define _I_NTP_INTERFACE_H_ 13 | 14 | #include 15 | 16 | #ifndef TZ_Asia_Kolkata 17 | #define TZ_Asia_Kolkata "IST-5:30" 18 | #endif 19 | 20 | #define TZ 5.5 // (utc+) TZ in hours 21 | #define TZ_MN ((TZ)*60) 22 | #define TZ_SEC ((TZ)*3600) 23 | #define DST_MN 0 // use 60mn for summer time in some countries 24 | #define DST_SEC ((DST_MN)*60) 25 | 26 | /** 27 | * NTP servers 28 | */ 29 | #define NTP_SERVER1 "pool.ntp.org" 30 | 31 | // forward declaration of derived class for this interface 32 | class NtpInterface; 33 | 34 | /** 35 | * iNtpInterface class 36 | */ 37 | class iNtpInterface 38 | { 39 | 40 | public: 41 | /** 42 | * iNtpInterface constructor. 43 | */ 44 | iNtpInterface() {} 45 | /** 46 | * iNtpInterface destructor. 47 | */ 48 | virtual ~iNtpInterface() {} 49 | 50 | virtual void init_ntp_time() = 0; 51 | virtual bool is_valid_ntptime() = 0; 52 | virtual long get_ntp_time() = 0; 53 | }; 54 | 55 | // derived class must define this 56 | extern NtpInterface __i_ntp; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/interface/pdi/middlewares/iPingInterface.h: -------------------------------------------------------------------------------- 1 | /***************************** Ping Interface ********************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _I_PING_INTERFACE_H_ 12 | #define _I_PING_INTERFACE_H_ 13 | 14 | #include 15 | 16 | 17 | // forward declaration of derived class for this interface 18 | class PingInterface; 19 | 20 | /** 21 | * iPingInterface class 22 | */ 23 | class iPingInterface { 24 | 25 | public: 26 | 27 | /** 28 | * iPingInterface constructor. 29 | */ 30 | iPingInterface(){} 31 | /** 32 | * iPingInterface destructor 33 | */ 34 | virtual ~iPingInterface(){} 35 | 36 | /** 37 | * initialize ping 38 | */ 39 | virtual void init_ping( iWiFiInterface* _wifi ) = 0; 40 | virtual bool ping( void ) = 0; 41 | virtual bool isHostRespondingToPing( void ) = 0; 42 | }; 43 | 44 | extern PingInterface __i_ping; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/interface/pdi/middlewares/iUpgradeInterface.h: -------------------------------------------------------------------------------- 1 | /***************************** Upgrade Interface ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st Jan 2024 9 | ******************************************************************************/ 10 | 11 | #ifndef _I_UPGRADE_INTERFACE_H_ 12 | #define _I_UPGRADE_INTERFACE_H_ 13 | 14 | #include 15 | 16 | /** 17 | * iUpgradeInterface class 18 | */ 19 | class iUpgradeInterface 20 | { 21 | 22 | public: 23 | /** 24 | * iUpgradeInterface constructor. 25 | */ 26 | iUpgradeInterface() {} 27 | /** 28 | * iUpgradeInterface destructor. 29 | */ 30 | virtual ~iUpgradeInterface() {} 31 | 32 | // upgrade api 33 | virtual upgrade_status_t Upgrade(const char *path, const char *version) = 0; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/interface/pdi/modules/wifi/iWiFiClientInterface.h: -------------------------------------------------------------------------------- 1 | /************************ i WiFi Client Interface ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _I_WIFI_CLIENT_INTERFACE_H_ 12 | #define _I_WIFI_CLIENT_INTERFACE_H_ 13 | 14 | #include 15 | #include 16 | 17 | // forward declaration of derived class for this interface 18 | class WiFiClientInterface; 19 | 20 | /** 21 | * iWiFiClientInterface class 22 | */ 23 | class iWiFiClientInterface : public iClientInterface 24 | { 25 | 26 | public: 27 | /** 28 | * iWiFiClientInterface constructor. 29 | */ 30 | iWiFiClientInterface() {} 31 | /** 32 | * iWiFiClientInterface destructor. 33 | */ 34 | virtual ~iWiFiClientInterface() {} 35 | }; 36 | 37 | // derived class must define this 38 | extern WiFiClientInterface __i_wifi_client; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/interface/pdi/modules/wifi/iWiFiServerInterface.h: -------------------------------------------------------------------------------- 1 | /************************ i WiFi Server Interface ****************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _I_WIFI_SERVER_INTERFACE_H_ 12 | #define _I_WIFI_SERVER_INTERFACE_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | // forward declaration of derived class for this interface 19 | class WiFiHttpServerInterface; 20 | 21 | /** 22 | * iWiFiHttpServerInterface class 23 | */ 24 | class iWiFiHttpServerInterface : public iHttpServerInterface 25 | { 26 | 27 | public: 28 | /** 29 | * iWiFiHttpServerInterface constructor. 30 | */ 31 | iWiFiHttpServerInterface() {} 32 | /** 33 | * iWiFiHttpServerInterface destructor. 34 | */ 35 | virtual ~iWiFiHttpServerInterface() {} 36 | }; 37 | 38 | // derived class must define this 39 | extern WiFiHttpServerInterface __i_wifi_http_server; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/service_provider/ServiceProvider.cpp: -------------------------------------------------------------------------------- 1 | /***************************** service provider ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #include "ServiceProvider.h" 12 | 13 | 14 | // Static member variable to hold the service instances 15 | ServiceProvider *ServiceProvider::m_services[SERVICE_MAX] = {nullptr}; 16 | 17 | // Static member variable to hold the terminal interface 18 | iTerminalInterface *ServiceProvider::m_terminal = nullptr; 19 | -------------------------------------------------------------------------------- /src/service_provider/auth/AuthServiceProvider.h: -------------------------------------------------------------------------------- 1 | /******************************** Auth Services ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _AUTH_SERVICE_H_ 12 | #define _AUTH_SERVICE_H_ 13 | 14 | #include 15 | #include 16 | 17 | /** 18 | * AuthServiceProvider class 19 | */ 20 | class AuthServiceProvider : public ServiceProvider 21 | { 22 | 23 | public: 24 | /** 25 | * AuthServiceProvider constructor 26 | */ 27 | AuthServiceProvider(); 28 | 29 | /** 30 | * AuthServiceProvider destructor 31 | */ 32 | ~AuthServiceProvider(); 33 | 34 | bool initService(void *arg = nullptr) override; 35 | bool isAuthorized(const char *username, const char *password); 36 | 37 | void setAuthorized(bool auth); 38 | bool getAuthorized(); 39 | const char* getUsername(); 40 | 41 | void printConfigToTerminal(iTerminalInterface *terminal) override; 42 | private: 43 | 44 | /** 45 | * @var login_credential_table login_credentials 46 | */ 47 | login_credential_table m_login_credentials; 48 | 49 | /** 50 | * @var bool m_initStatus 51 | */ 52 | bool m_initStatus; 53 | 54 | /** 55 | * @var bool m_isAuthorized 56 | */ 57 | bool m_isAuthorized; 58 | }; 59 | 60 | extern AuthServiceProvider __auth_service; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/service_provider/cmd/commands/ClearScreenCommand.h: -------------------------------------------------------------------------------- 1 | /****************************** Clear Screen Command ************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _CLEAR_SCREEN_COMMAND_H_ 12 | #define _CLEAR_SCREEN_COMMAND_H_ 13 | 14 | #include "CommandCommon.h" 15 | 16 | /** 17 | * clear screen command 18 | * 19 | * e.g. if we want to clear the terminal screen, we can execute command as below 20 | * cls 21 | */ 22 | struct ClearScreenCommand : public CommandBase { 23 | 24 | /* Constructor */ 25 | ClearScreenCommand(){ 26 | Clear(); 27 | SetCommand(CMD_NAME_CLS); 28 | } 29 | 30 | /* execute command with provided options */ 31 | cmd_result_t execute(){ 32 | 33 | cmd_result_t result = CMD_RESULT_OK; 34 | 35 | if(nullptr != m_terminal){ 36 | 37 | // clear the display 38 | m_terminal->csi_erase_display(); 39 | } 40 | 41 | return result; 42 | } 43 | }; 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/service_provider/cmd/commands/PWDFSCommand.h: -------------------------------------------------------------------------------- 1 | /**************************** PWD File System Command ************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _PWD_FILE_SYSTEM_COMMAND_H_ 12 | #define _PWD_FILE_SYSTEM_COMMAND_H_ 13 | 14 | #include "CommandCommon.h" 15 | 16 | #ifdef ENABLE_STORAGE_SERVICE 17 | /** 18 | * pwd file system command 19 | * 20 | * e.g. if we want to print the current working directory, we can execute command as below 21 | * pwd 22 | */ 23 | struct PWDFSCommand : public CommandBase { 24 | 25 | /* Constructor */ 26 | PWDFSCommand (){ 27 | Clear(); 28 | SetCommand(CMD_NAME_PWD); 29 | } 30 | 31 | #ifdef ENABLE_AUTH_SERVICE 32 | /* override the necesity of required permission */ 33 | bool needauth() override { return true; } 34 | #endif 35 | 36 | /* execute command with provided options */ 37 | cmd_result_t execute(){ 38 | 39 | #ifdef ENABLE_AUTH_SERVICE 40 | // return in case authentication needed and not authorized yet 41 | if( needauth() && !__auth_service.getAuthorized()){ 42 | return CMD_RESULT_NEED_AUTH; 43 | } 44 | #endif 45 | 46 | cmd_result_t result = CMD_RESULT_OK; 47 | 48 | if(nullptr != m_terminal){ 49 | m_terminal->putln(); 50 | m_terminal->write(__i_fs.pwd()->c_str()); 51 | } 52 | 53 | return result; 54 | } 55 | }; 56 | #endif 57 | 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/service_provider/cmd/commands/SchedulerTaskCommand.h: -------------------------------------------------------------------------------- 1 | /***************************** Scheduler Task Command ************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _SCHED_TASK_COMMAND_H_ 12 | #define _SCHED_TASK_COMMAND_H_ 13 | 14 | #include "CommandCommon.h" 15 | 16 | /** 17 | * Scheduler tasks command 18 | * 19 | * e.g. if we want to list tasks then use below command 20 | * scht 21 | */ 22 | struct SchedulerTaskCommand : public CommandBase { 23 | 24 | /* Constructor */ 25 | SchedulerTaskCommand(){ 26 | Clear(); 27 | SetCommand(CMD_NAME_SCHED_TASK); 28 | setAcceptArgsOptions(true); 29 | } 30 | 31 | /* execute command with provided options */ 32 | cmd_result_t execute(){ 33 | 34 | cmd_result_t result = CMD_RESULT_OK; 35 | 36 | if(nullptr != m_terminal){ 37 | 38 | // options will be available at first index 39 | CommandOption *cmdoptn = &m_options[0]; 40 | 41 | 42 | if(nullptr != cmdoptn && nullptr != cmdoptn->optionval && cmdoptn->optionvalsize > 0){ 43 | 44 | // check if list option provided 45 | if( __strstr(cmdoptn->optionval, CMD_OPTION_NAME_L, cmdoptn->optionvalsize) != -1 ){ 46 | 47 | __task_scheduler.printTasksToTerminal(m_terminal); 48 | } 49 | } 50 | } 51 | 52 | return result; 53 | } 54 | }; 55 | 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/service_provider/device/FactoryResetServiceProvider.h: -------------------------------------------------------------------------------- 1 | /****************************** Reset Factory ******************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _DEVICE_FACTORY_RESET_SERVICE_H_ 12 | #define _DEVICE_FACTORY_RESET_SERVICE_H_ 13 | 14 | #include 15 | 16 | /** 17 | * DeviceFactoryReset class 18 | */ 19 | class DeviceFactoryReset : public ServiceProvider 20 | { 21 | 22 | public: 23 | /** 24 | * DeviceFactoryReset constructor 25 | */ 26 | DeviceFactoryReset(); 27 | /** 28 | * DeviceFactoryReset destructor 29 | */ 30 | ~DeviceFactoryReset(); 31 | 32 | bool initService(void *arg = nullptr) override; 33 | void factory_reset(void); 34 | void check_device_factory_request(void); 35 | 36 | protected: 37 | /** 38 | * @var uint8_t|0 m_flash_key_pressed 39 | */ 40 | uint8_t m_flash_key_pressed; 41 | }; 42 | 43 | extern DeviceFactoryReset __factory_reset; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/service_provider/device/OtaServiceProvider.h: -------------------------------------------------------------------------------- 1 | /************** Over The Air firmware update service ************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _HTTP_OTA_SERVICE_PROVIDER_H_ 12 | #define _HTTP_OTA_SERVICE_PROVIDER_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | /** 19 | * ota status enum 20 | */ 21 | enum http_ota_status{ 22 | GET_VERSION_FAILED, 23 | VERSION_NOT_FOUND, 24 | UPDATE_FAILD, 25 | NO_UPDATES, 26 | UPDATE_OK, 27 | UNKNOWN 28 | }; 29 | 30 | /** 31 | * OtaServiceProvider class 32 | */ 33 | class OtaServiceProvider : public ServiceProvider{ 34 | 35 | public: 36 | 37 | /** 38 | * OtaServiceProvider constructor. 39 | */ 40 | OtaServiceProvider(); 41 | /** 42 | * OtaServiceProvider destructor. 43 | */ 44 | ~OtaServiceProvider(); 45 | 46 | bool initService(void *arg = nullptr) override; 47 | void handleOta(); 48 | http_ota_status handle(); 49 | void printConfigToTerminal(iTerminalInterface *terminal) override; 50 | 51 | /** 52 | * @var Http_Client*|nullptr m_http_client 53 | */ 54 | Http_Client *m_http_client; 55 | }; 56 | 57 | extern OtaServiceProvider __ota_service; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/service_provider/email/EmailServiceProvider.h: -------------------------------------------------------------------------------- 1 | /******************************* Email service ********************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _EMAIL_SERVICE_PROVIDER_H_ 12 | #define _EMAIL_SERVICE_PROVIDER_H_ 13 | 14 | #include 15 | #ifdef ENABLE_GPIO_SERVICE 16 | #include 17 | #endif 18 | #include 19 | 20 | /** 21 | * EmailServiceProvider class 22 | */ 23 | class EmailServiceProvider : public ServiceProvider 24 | { 25 | 26 | public: 27 | /** 28 | * EmailServiceProvider constructor. 29 | */ 30 | EmailServiceProvider(); 31 | /** 32 | * EmailServiceProvider destructor 33 | */ 34 | ~EmailServiceProvider(); 35 | 36 | bool initService(void *arg = nullptr) override; 37 | bool sendMail(pdiutil::string &mail_body); 38 | bool sendMail(char *mail_body); 39 | bool sendMail(const char * mail_body); 40 | // template bool sendMail( T mail_body ); 41 | void handleEmail(void); 42 | void printConfigToTerminal(iTerminalInterface *terminal) override; 43 | 44 | /** 45 | * @var int|0 m_mail_handler_cb_id 46 | */ 47 | int m_mail_handler_cb_id; 48 | 49 | protected: 50 | iClientInterface *m_client; 51 | SMTPClient m_smtp; 52 | }; 53 | 54 | extern EmailServiceProvider __email_service; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/service_provider/transport/SerialServiceProvider.h: -------------------------------------------------------------------------------- 1 | /****************************** Serial Services ******************************* 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st June 2019 9 | ******************************************************************************/ 10 | 11 | #ifndef _SERIAL_SERVICE_H_ 12 | #define _SERIAL_SERVICE_H_ 13 | 14 | #include 15 | 16 | /** 17 | * SerialServiceProvider class 18 | */ 19 | class SerialServiceProvider : public ServiceProvider 20 | { 21 | 22 | public: 23 | /** 24 | * SerialServiceProvider constructor 25 | */ 26 | SerialServiceProvider(); 27 | 28 | /** 29 | * SerialServiceProvider destructor 30 | */ 31 | ~SerialServiceProvider(); 32 | 33 | bool initService(void *arg = nullptr) override; 34 | void processSerial(serial_event_t *se); 35 | }; 36 | 37 | extern SerialServiceProvider __serial_service; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/service_provider/transport/TelnetServiceProvider.h: -------------------------------------------------------------------------------- 1 | /************************** Telnet service *********************************** 2 | This file is part of the pdi stack. 3 | 4 | This is free software. you can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | Author : Suraj I. 8 | created Date : 1st May 2025 9 | ******************************************************************************/ 10 | 11 | #ifndef _TELNET_SERVICE_PROVIDER_H_ 12 | #define _TELNET_SERVICE_PROVIDER_H_ 13 | 14 | #include 15 | 16 | /** 17 | * @brief TelnetServiceProvider provides a basic Telnet server using TcpServerInterface. 18 | */ 19 | class TelnetServiceProvider : public ServiceProvider { 20 | public: 21 | TelnetServiceProvider(); 22 | virtual ~TelnetServiceProvider(); 23 | 24 | /** 25 | * @brief Start the Telnet service on the specified port. 26 | * @param port The port to listen on (default 23). 27 | * @return true if started successfully, false otherwise. 28 | */ 29 | bool start(uint16_t port = 23); 30 | 31 | /** 32 | * @brief Init the service. 33 | * @param arg Optional argument, can be used to pass the port number. 34 | * @return true if initialized successfully, false otherwise. 35 | */ 36 | bool initService(void *arg = nullptr) override; 37 | 38 | /** 39 | * @brief Stop the Telnet service. 40 | */ 41 | void stop(); 42 | 43 | /** 44 | * @brief close current client. 45 | */ 46 | void closeClient(); 47 | 48 | /** 49 | * @brief Handle incoming Telnet clients and data. 50 | */ 51 | void handle(); 52 | 53 | private: 54 | iTcpServerInterface* m_server; 55 | iClientInterface* m_client; 56 | }; 57 | 58 | extern TelnetServiceProvider __telnet_service; 59 | 60 | #endif -------------------------------------------------------------------------------- /src/utility/Base64.h: -------------------------------------------------------------------------------- 1 | /****************************** Base64 Utility ******************************** 2 | This file is part of the PDI stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | The Base64 utility provides functionality for encoding data into Base64 format. 8 | It is useful for encoding binary data into a text-based format for transmission 9 | or storage. 10 | 11 | Author : Suraj I. 12 | Created Date : 1st June 2019 13 | ******************************************************************************/ 14 | 15 | #ifndef _BASE64_H_ 16 | #define _BASE64_H_ 17 | 18 | /** 19 | * @brief Encodes a string into Base64 format. 20 | * 21 | * This function takes an input string and encodes it into Base64 format. 22 | * 23 | * @param input_str The input string to encode. 24 | * @param len_str The length of the input string. 25 | * @param res_str The buffer to store the resulting Base64-encoded string. 26 | * @return True if the encoding was successful, false otherwise. 27 | */ 28 | bool base64Encode(char input_str[], int len_str, char *res_str); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/utility/Utility.cpp: -------------------------------------------------------------------------------- 1 | /******************************* Utility ************************************** 2 | This file is part of the PDI stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | The Utility module serves as the implementation file for utility functions and 8 | components used in the PDI stack. It integrates various utilities such as task 9 | scheduling, event handling, data type conversions, and more. 10 | 11 | Author : Suraj I. 12 | Created Date : 1st June 2019 13 | ******************************************************************************/ 14 | 15 | #include "Utility.h" 16 | 17 | // Implementation of utility functions and components goes here. 18 | -------------------------------------------------------------------------------- /src/utility/pdistl/abi/abi.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc C++ Library. This library is free 4 | software; you can redistribute it and/or modify it under the 5 | terms of the GNU General Public License as published by the 6 | Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License along 15 | with this library; see the file COPYING. If not, write to the Free 16 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. 18 | */ 19 | 20 | #include "../cstdlib" 21 | #include "../typeinfo" 22 | #include "../basic_definitions" 23 | 24 | /* This file implements a number of the language support features 25 | * needed to deal with the C++ abi, as originally documented in the 26 | * Itanium C++ ABI, though now industry standard 27 | */ 28 | 29 | extern "C" { 30 | 31 | #if defined(ARDUINO) 32 | /* Arduino defines some of these. 33 | * There can be link issues if they're redefined 34 | */ 35 | #else 36 | /* This function is called in the event that a non-overidden 37 | * pure virtual function is called. The compiler should never 38 | * let that happen. We get to choose what to do - we will abort 39 | */ 40 | void __cxa_pure_virtual (){ 41 | abort(); 42 | } 43 | 44 | #endif 45 | } 46 | -------------------------------------------------------------------------------- /src/utility/pdistl/abi/libgcc_eh/Makefile: -------------------------------------------------------------------------------- 1 | top_srcdir=../../../ 2 | top_builddir=../../../ 3 | include $(top_srcdir)Rules.mak 4 | include Makefile.in 5 | -------------------------------------------------------------------------------- /src/utility/pdistl/abi/libgcc_eh/Makefile.in: -------------------------------------------------------------------------------- 1 | LIBGCC_EH_OUT := $(top_builddir)src/abi/libgcc_eh/ 2 | 3 | OBJS = $(call list-archive-members,$(LIBGCC_EH)) 4 | libgcc_eh-$(IMPORT_LIBGCC_EH) := $(OBJS) 5 | 6 | LIBGCC_EH_VAR := $(call variablify,$(LIBGCC_EH)) 7 | LIBGCC_EH_DEP := $(LIBGCC_EH_OUT).$(call print-hash,$(LIBGCC_EH_VAR)).dep 8 | 9 | ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) 10 | -include $(LIBGCC_EH_DEP) 11 | endif 12 | 13 | 14 | ifneq ($(libgcc_eh-y),) 15 | $(libgcc_eh-y): $(LIBGCC_EH) 16 | endif 17 | $(LIBGCC_EH_DEP): $(LIBGCC_EH) 18 | $(Q)$(RM) $(LIBGCC_EH_OUT).*dep $(LIBGCC_EH_OUT)*.o 19 | $(Q)$(if $(LIBGCC_EH),(cd $(LIBGCC_EH_OUT) && $(AR) x $(LIBGCC_EH))) 20 | $(Q)printf "# %s\n\n%s\n" "$(LIBGCC_EH)" "libgcc_eh-y := \$$(addprefix \$$(LIBGCC_EH_OUT),$(libgcc_eh-y))" > $@ 21 | 22 | CLEAN_src/abi/libgcc_eh: ; 23 | DISTCLEAN_src/abi/libgcc_eh: 24 | $(do_rm) $(addprefix $(LIBGCC_EH_OUT),.*dep *.o) 25 | -------------------------------------------------------------------------------- /src/utility/pdistl/abi/libsupc/Makefile: -------------------------------------------------------------------------------- 1 | top_srcdir=../../../ 2 | top_builddir=../../../ 3 | include $(top_srcdir)Rules.mak 4 | include Makefile.in 5 | -------------------------------------------------------------------------------- /src/utility/pdistl/abi/libsupc/Makefile.in: -------------------------------------------------------------------------------- 1 | LIBSUPC_OUT := $(top_builddir)src/abi/libsupc/ 2 | 3 | OBJS = $(call list-archive-members,$(LIBSUP)) 4 | OBJS-OMIT = $(filter new_op%.o del_op%.o pure.o new_handler.o eh_alloc.o eh_globals.o,$(OBJS)) 5 | libsupc-$(IMPORT_LIBSUP) := $(filter-out $(OBJS-OMIT),$(OBJS)) 6 | 7 | LIBSUP_VAR := $(call variablify,$(LIBSUP)) 8 | LIBSUP_DEP := $(LIBSUPC_OUT).$(call print-hash,$(LIBSUP_VAR)).dep 9 | 10 | ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) 11 | -include $(LIBSUP_DEP) 12 | endif 13 | 14 | ifneq ($(libsupc-y),) 15 | $(libsupc-y): $(LIBSUP) 16 | endif 17 | $(LIBSUP_DEP): $(LIBSUP) $(LIBSUPC_OUT)Makefile.in 18 | $(Q)$(RM) $(LIBSUPC_OUT).*dep $(LIBSUPC_OUT)*.o 19 | $(Q)$(if $(LIBSUP),(cd $(LIBSUPC_OUT) && $(AR) x $(LIBSUP) && $(RM) $(OBJS-OMIT))) 20 | $(Q)printf "# %s\n\n%s\n" "$(LIBSUP)" "libsupc-y := \$$(addprefix \$$(LIBSUPC_OUT),$(libsupc-y))" > $@ 21 | 22 | CLEAN_src/abi/libsupc: ; 23 | DISTCLEAN_src/abi/libsupc: 24 | $(do_rm) $(addprefix $(LIBSUPC_OUT), .*dep *.o) 25 | -------------------------------------------------------------------------------- /src/utility/pdistl/algorithm.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | 15 | #include "algorithm" 16 | 17 | 18 | namespace pdistd{ 19 | 20 | 21 | 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/utility/pdistl/associative_base.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2007 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | #include "associative_base" 21 | 22 | namespace pdistd{ 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/utility/pdistl/bitset.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | #include "bitset" 21 | 22 | namespace pdistd{ 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/utility/pdistl/cassert: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2005 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | -------------------------------------------------------------------------------- /src/utility/pdistl/cctype: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include 15 | 16 | namespace pdistd{ 17 | 18 | using ::isalnum; 19 | using ::isalpha; 20 | using ::iscntrl; 21 | using ::isdigit; 22 | using ::isgraph; 23 | using ::islower; 24 | using ::isprint; 25 | using ::ispunct; 26 | using ::isspace; 27 | using ::isupper; 28 | using ::isxdigit; 29 | using ::tolower; 30 | using ::toupper; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/utility/pdistl/cerrno: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include 15 | -------------------------------------------------------------------------------- /src/utility/pdistl/cfloat: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include 15 | 16 | #ifndef __PDISTD_HEADER_CFLOAT 17 | #define __PDISTD_HEADER_CFLOAT 1 18 | 19 | 20 | #include 21 | 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /src/utility/pdistl/char_traits.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #define __UCLIBCXX_COMPILE_CHAR_TRAITS__ 1 15 | 16 | 17 | #include "basic_definitions" 18 | #include "char_traits" 19 | 20 | namespace pdistd{ 21 | 22 | _UCXXEXPORT const char_traits::char_type* char_traits::find(const char_type* s, int n, const char_type& a){ 23 | for(int i=0; i < n; i++){ 24 | if(eq(s[i], a)){ 25 | return (s+i); 26 | } 27 | } 28 | return 0; 29 | } 30 | 31 | _UCXXEXPORT bool char_traits::eq(const char_type& c1, const char_type& c2){ 32 | if(strncmp(&c1, &c2, 1) == 0){ 33 | return true; 34 | } 35 | return false; 36 | } 37 | 38 | _UCXXEXPORT char_traits::char_type char_traits::to_char_type(const int_type & i){ 39 | if(i > 0 && i <= 255){ 40 | return (char)(unsigned char)i; 41 | } 42 | 43 | //Out of range 44 | return 0; 45 | } 46 | 47 | 48 | 49 | #ifdef __UCLIBCXX_HAS_WCHAR__ 50 | 51 | _UCXXEXPORT const char_traits::char_type* char_traits::find(const char_type* s, int n, const char_type& a){ 52 | for(int i=0; i < n; i++){ 53 | if(eq(s[i], a)){ 54 | return (s+i); 55 | } 56 | } 57 | return 0; 58 | } 59 | 60 | #endif 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/utility/pdistl/cinttypes: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /src/utility/pdistl/climits: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #ifndef __PDISTD_HEADER_CLIMITS 15 | #define __PDISTD_HEADER_CLIMITS 1 16 | 17 | 18 | #include 19 | 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /src/utility/pdistl/clocale: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #ifndef __PDISTD_HEADER_CLOCALE 15 | #define __PDISTD_HEADER_CLOCALE 1 16 | 17 | #include 18 | 19 | namespace pdistd{ 20 | using ::lconv; 21 | using ::setlocale; 22 | using ::localeconv; 23 | } 24 | 25 | #endif // __PDISTD_HEADER_CLOCALE 26 | -------------------------------------------------------------------------------- /src/utility/pdistl/complex.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "complex" 15 | 16 | 17 | namespace pdistd{ 18 | 19 | 20 | template class _UCXXEXPORT complex; 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/utility/pdistl/csetjmp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #ifndef __PDISTD_HEADER_CSETJMP 15 | #define __PDISTD_HEADER_CSETJMP 1 16 | 17 | #include 18 | 19 | 20 | //From GCC Header files 21 | #undef longjmp 22 | 23 | // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 24 | #ifndef setjmp 25 | #define setjmp(env) setjmp (env) 26 | #endif 27 | 28 | //Mine again 29 | 30 | 31 | namespace pdistd{ 32 | using ::longjmp; 33 | using ::jmp_buf; 34 | } 35 | 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /src/utility/pdistl/csignal: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- forwarding header. 2 | 3 | // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 4 | // Free Software Foundation, Inc. 5 | // 6 | // This file is part of the GNU ISO C++ Library. This library is free 7 | // software; you can redistribute it and/or modify it under the 8 | // terms of the GNU General Public License as published by the 9 | // Free Software Foundation; either version 2, or (at your option) 10 | // any later version. 11 | 12 | /***************************** PDI STD File *********************************** 13 | This file is taken from external sources. this is taken from open source uClibc++ 14 | library available on github. below is reference link. Thanking to author for 15 | providing this . 16 | 17 | This is free software. you can redistribute it and/or modify it but without any 18 | warranty. 19 | 20 | referred from : https://github.com/mike-matera/ArduinoSTL 21 | added Date : 1st Dec 2024 22 | added by : Suraj I. 23 | ******************************************************************************/ 24 | 25 | #ifndef _CPP_CSIGNAL 26 | #define _CPP_CSIGNAL 1 27 | 28 | #pragma GCC system_header 29 | 30 | #include 31 | 32 | // Get rid of those macros defined in in lieu of real functions. 33 | #undef raise 34 | 35 | namespace pdistd 36 | { 37 | using ::sig_atomic_t; 38 | using ::signal; 39 | using ::raise; 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/utility/pdistl/cstdarg: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #ifndef _CPP_CSTDARG 15 | #define _CPP_CSTDARG 1 16 | 17 | #pragma GCC system_header 18 | 19 | #include 20 | 21 | // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 22 | #ifndef va_end 23 | #define va_end(ap) va_end (ap) 24 | #endif 25 | 26 | namespace std 27 | { 28 | using ::va_list; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/utility/pdistl/cstddef: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #ifndef _CPP_CSTDDEF 15 | #define _CPP_CSTDDEF 1 16 | 17 | #ifdef __GCC__ 18 | #pragma GCC system_header 19 | #endif 20 | 21 | #include 22 | 23 | namespace pdistd 24 | { 25 | using ::ptrdiff_t; 26 | using ::size_t; 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/utility/pdistl/cstdint: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | #ifndef _CPP_CSTDINT 14 | #define _CPP_CSTDINT 1 15 | 16 | #ifdef __GCC__ 17 | #pragma GCC system_header 18 | #endif 19 | 20 | #include 21 | 22 | namespace pdistd{ 23 | 24 | using :: int8_t; using :: int16_t; 25 | using :: int32_t; using :: int64_t; 26 | using :: uint8_t; using :: uint16_t; 27 | using :: uint32_t; using :: uint64_t; 28 | 29 | using :: int_least8_t; using :: int_least16_t; 30 | using :: int_least32_t; using :: int_least64_t; 31 | using :: uint_least8_t; using :: uint_least16_t; 32 | using :: uint_least32_t; using :: uint_least64_t; 33 | 34 | using :: int_fast8_t; using :: int_fast16_t; 35 | using :: int_fast32_t; using :: int_fast64_t; 36 | using :: uint_fast8_t; using :: uint_fast16_t; 37 | using :: uint_fast32_t; using :: uint_fast64_t; 38 | 39 | using :: intmax_t; using :: intptr_t; 40 | using :: uintmax_t; using :: uintptr_t; 41 | 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/utility/pdistl/cstdlib: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include 15 | #include "basic_definitions" 16 | 17 | #ifndef __HEADER_CSTDLIB 18 | #define __HEADER_CSTDLIB 1 19 | 20 | 21 | namespace pdistd{ 22 | using ::abort; 23 | using ::abs; 24 | using ::atexit; 25 | using ::atol; 26 | using ::atof; 27 | using ::atoi; 28 | using ::bsearch; 29 | using ::calloc; 30 | using ::div; 31 | using ::exit; 32 | using ::free; 33 | using ::getenv; 34 | using ::labs; 35 | using ::ldiv; 36 | using ::malloc; 37 | using ::qsort; 38 | using ::rand; 39 | using ::realloc; 40 | using ::srand; 41 | using ::strtod; 42 | using ::strtol; 43 | using ::strtoul; 44 | using ::system; 45 | #ifdef __UCLIBCXX_HAS_WCHAR__ 46 | using ::mblen; 47 | using ::mbstowcs; 48 | using ::mbtowc; 49 | using ::wctomb; 50 | using ::wcstombs; 51 | #endif 52 | 53 | /* Defined in Arduino 54 | inline long abs(long i){ 55 | return labs(i); 56 | } 57 | */ 58 | // inline ldiv_t div(long i, long j){ 59 | // return ldiv(i, j); 60 | // } 61 | 62 | } 63 | 64 | 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /src/utility/pdistl/ctime: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #ifndef _CPP_CTIME 15 | #define _CPP_CTIME 1 16 | 17 | #pragma GCC system_header 18 | 19 | #include "cstddef" 20 | 21 | #include 22 | 23 | // Get rid of those macros defined in in lieu of real functions. 24 | #undef clock 25 | #undef difftime 26 | #undef mktime 27 | #undef time 28 | #undef asctime 29 | #undef ctime 30 | #undef gmtime 31 | #undef localtime 32 | #undef strftime 33 | 34 | namespace pdistd 35 | { 36 | using ::clock_t; 37 | using ::time_t; 38 | using ::tm; 39 | 40 | using ::clock; 41 | using ::difftime; 42 | using ::mktime; 43 | using ::time; 44 | using ::asctime; 45 | using ::ctime; 46 | using ::gmtime; 47 | using ::localtime; 48 | using ::strftime; 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/utility/pdistl/del_op.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | // Arduino 1.0 contains an implementation for this. 15 | #if ARDUINO < 100 16 | 17 | #include "new" 18 | #include "cstdlib" 19 | #include "func_exception" 20 | 21 | _UCXXEXPORT void operator delete(void* ptr) _UCXX_USE_NOEXCEPT{ 22 | free(ptr); 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/utility/pdistl/del_opnt.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "new" 15 | #include "cstdlib" 16 | #include "func_exception" 17 | 18 | #ifndef NO_NOTHROW 19 | _UCXXEXPORT void operator delete(void* ptr, const pdistd::nothrow_t& ) _UCXX_USE_NOEXCEPT { 20 | free(ptr); 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /src/utility/pdistl/del_ops.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "new" 15 | #include "cstdlib" 16 | #include "func_exception" 17 | 18 | _UCXXEXPORT void operator delete(void* ptr, pdistd::size_t) _UCXX_USE_NOEXCEPT{ 19 | ::operator delete (ptr); 20 | } 21 | -------------------------------------------------------------------------------- /src/utility/pdistl/del_opv.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | // Arduino 1.0 contains an implementation for this. 15 | #if ARDUINO < 100 16 | 17 | #include "new" 18 | #include "cstdlib" 19 | #include "func_exception" 20 | 21 | _UCXXEXPORT void operator delete[](void * ptr) _UCXX_USE_NOEXCEPT{ 22 | free(ptr); 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/utility/pdistl/del_opvnt.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | #include "new" 14 | #include "cstdlib" 15 | #include "func_exception" 16 | 17 | #ifndef NO_NOTHROW 18 | _UCXXEXPORT void operator delete[](void* ptr, const pdistd::nothrow_t& ) _UCXX_USE_NOEXCEPT{ 19 | free(ptr); 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /src/utility/pdistl/del_opvs.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "new" 15 | #include "cstdlib" 16 | #include "func_exception" 17 | 18 | _UCXXEXPORT void operator delete[](void * ptr, pdistd::size_t) _UCXX_USE_NOEXCEPT{ 19 | ::operator delete[] (ptr); 20 | } 21 | -------------------------------------------------------------------------------- /src/utility/pdistl/deque.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "deque" 15 | 16 | 17 | namespace pdistd{ 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | } 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/utility/pdistl/eh_globals.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "cstdlib" 15 | #include "cstring" 16 | #include "func_exception" 17 | 18 | //This is a system-specific header which does all of the error-handling management 19 | #include "unwind-cxx.h" 20 | 21 | //The following functionality is derived from reading of the GNU libstdc++ code and making it...simple 22 | 23 | 24 | namespace __cxxabiv1{ 25 | 26 | static __UCLIBCXX_TLS __cxa_eh_globals eh_globals; 27 | 28 | extern "C" __cxa_eh_globals* __cxa_get_globals() _UCXX_USE_NOEXCEPT{ 29 | return &eh_globals; 30 | } 31 | 32 | extern "C" __cxa_eh_globals* __cxa_get_globals_fast() _UCXX_USE_NOEXCEPT{ 33 | return &eh_globals; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/utility/pdistl/exception.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "exception" 15 | 16 | //We can't do this yet because gcc is too stupid to be able to handle 17 | //different implementations of exception class. 18 | 19 | #undef __UCLIBCXX_EXCEPTION_SUPPORT__ 20 | 21 | #ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ 22 | 23 | namespace pdistd{ 24 | _UCXXEXPORT static char * __std_exception_what_value = "exception"; 25 | 26 | //We are providing our own versions to be sneaky 27 | 28 | 29 | _UCXXEXPORT exception::~exception() _UCXX_USE_NOEXCEPT{ 30 | //Empty function 31 | } 32 | 33 | _UCXXEXPORT const char* exception::what() const _UCXX_USE_NOEXCEPT{ 34 | return __std_exception_what_value; 35 | } 36 | 37 | _UCXXEXPORT bad_exception::~bad_exception() _UCXX_USE_NOEXCEPT{ 38 | 39 | } 40 | 41 | 42 | } 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/utility/pdistl/func_exception: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "basic_definitions" 15 | #include "exception" 16 | 17 | 18 | #ifndef HEADER_IMPLEMENTATION_FUNC_EXCEPTION 19 | #define HEADER_IMPLEMENTATION_FUNC_EXCEPTION 20 | 21 | #pragma GCC visibility push(default) 22 | 23 | namespace pdistd{ 24 | 25 | _UCXXEXPORT void __throw_bad_alloc(); 26 | _UCXXEXPORT void __throw_out_of_range(const char * message = 0); 27 | _UCXXEXPORT void __throw_overflow_error(const char * message = 0); 28 | _UCXXEXPORT void __throw_length_error(const char * message = 0); 29 | _UCXXEXPORT void __throw_invalid_argument(const char * message = 0); 30 | } 31 | 32 | #pragma GCC visibility pop 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /src/utility/pdistl/initializer_list: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | 15 | #ifndef __PDISTD_HEADER_INITIALIZER_LIST 16 | #define __PDISTD_HEADER_INITIALIZER_LIST 17 | 18 | #pragma GCC visibility push(default) 19 | 20 | namespace pdistd{ 21 | 22 | template 23 | class initializer_list { 24 | 25 | private: 26 | const T* array; 27 | size_t len; 28 | 29 | // Initialize from a { ... } construct 30 | initializer_list(const T *a, size_t l): array(a), len(l) { } 31 | 32 | public: 33 | 34 | // default constructor 35 | initializer_list() : array(NULL), len(0) {} 36 | 37 | size_t size() const { 38 | return len; 39 | } 40 | 41 | const T *begin() { 42 | return array; 43 | } 44 | 45 | const T *end() { 46 | return array + len; 47 | } 48 | 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/utility/pdistl/iomanip.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "iomanip" 15 | 16 | namespace pdistd{ 17 | 18 | 19 | 20 | 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/utility/pdistl/iostream.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #define __UCLIBCXX_COMPILE_IOSTREAM__ 1 15 | 16 | #include "iostream" 17 | 18 | namespace pdistd{ 19 | 20 | #ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ 21 | #ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ 22 | 23 | template _UCXXEXPORT basic_iostream >:: 24 | basic_iostream(basic_streambuf >* sb); 25 | template _UCXXEXPORT basic_iostream >::~basic_iostream(); 26 | 27 | #endif 28 | #endif 29 | 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/utility/pdistl/iterator.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "iterator" 15 | 16 | namespace pdistd{ 17 | 18 | 19 | 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/utility/pdistl/limits.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "limits" 15 | 16 | namespace pdistd{ 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/utility/pdistl/list.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "list" 15 | 16 | namespace pdistd{ 17 | 18 | 19 | 20 | 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/utility/pdistl/locale.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "locale" 15 | #include "cstring" 16 | #include "string" 17 | #include "stdexcept" 18 | #include "cctype" 19 | 20 | namespace pdistd{ 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/utility/pdistl/map.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "map" 15 | 16 | namespace pdistd{ 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/utility/pdistl/new_handler.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "new" 15 | 16 | const pdistd::nothrow_t pdistd::nothrow = { }; 17 | 18 | //Name selected to be compatable with g++ code 19 | pdistd::new_handler __new_handler; 20 | 21 | _UCXXEXPORT pdistd::new_handler pdistd::set_new_handler(pdistd::new_handler new_p) _UCXX_USE_NOEXCEPT{ 22 | pdistd::new_handler retval = __new_handler; 23 | __new_handler = new_p; 24 | return retval; 25 | } 26 | -------------------------------------------------------------------------------- /src/utility/pdistl/new_op.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | // Arduino 1.0 contains an implementation for this. 15 | #if ARDUINO < 100 16 | 17 | #include "new" 18 | #include "cstdlib" 19 | #include "func_exception" 20 | 21 | _UCXXEXPORT void* operator new(pdistd::size_t numBytes) _UCXX_THROW(pdistd::bad_alloc) 22 | { 23 | //C++ stardard 5.3.4.8 requires that a valid pointer be returned for 24 | //a call to new(0). Thus: 25 | if(numBytes == 0){ 26 | numBytes = 1; 27 | } 28 | void * p = malloc(numBytes); 29 | if(p == 0){ 30 | pdistd::__throw_bad_alloc(); 31 | } 32 | return p; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/utility/pdistl/new_opnt.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "new" 15 | #include "cstdlib" 16 | #include "func_exception" 17 | 18 | #ifndef NO_NOTHROW 19 | _UCXXEXPORT void* operator new(pdistd::size_t numBytes, const pdistd::nothrow_t& ) _UCXX_USE_NOEXCEPT{ 20 | return malloc(numBytes); 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /src/utility/pdistl/new_opv.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | // Arduino 1.0 contains an implementation for this. 15 | #if ARDUINO < 100 16 | 17 | #include "new" 18 | #include "cstdlib" 19 | #include "func_exception" 20 | 21 | _UCXXEXPORT void* operator new[](pdistd::size_t numBytes)_UCXX_THROW(pdistd::bad_alloc){ 22 | //C++ stardard 5.3.4.8 requires that a valid pointer be returned for 23 | //a call to new(0). Thus: 24 | if(numBytes == 0){ 25 | numBytes = 1; 26 | } 27 | void * p = malloc(numBytes); 28 | if(p == 0){ 29 | pdistd::__throw_bad_alloc(); 30 | } 31 | return p; 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/utility/pdistl/new_opvnt.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "new" 15 | #include "cstdlib" 16 | #include "func_exception" 17 | 18 | #ifndef NO_NOTHROW 19 | _UCXXEXPORT void* operator new[](pdistd::size_t numBytes, const pdistd::nothrow_t& ) _UCXX_USE_NOEXCEPT{ 20 | return malloc(numBytes); 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /src/utility/pdistl/numeric.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "numeric" 15 | 16 | namespace pdistd{ 17 | 18 | 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/utility/pdistl/queue_stl.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "queue" 15 | 16 | 17 | namespace pdistd{ 18 | 19 | 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/utility/pdistl/set.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | 15 | #include "set" 16 | 17 | namespace pdistd{ 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/utility/pdistl/stack.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "stack" 15 | 16 | 17 | namespace pdistd{ 18 | 19 | 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/utility/pdistl/stdexcept.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "exception" 15 | #include "stdexcept" 16 | 17 | #ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ 18 | 19 | namespace pdistd{ 20 | 21 | _UCXXEXPORT logic_error::logic_error() _UCXX_USE_NOEXCEPT : mstring(){ 22 | 23 | } 24 | 25 | _UCXXEXPORT logic_error::logic_error(const string& what_arg) : mstring(what_arg){ 26 | 27 | } 28 | 29 | _UCXXEXPORT const char * logic_error::what() const _UCXX_USE_NOEXCEPT{ 30 | return mstring.c_str(); 31 | } 32 | 33 | 34 | _UCXXEXPORT out_of_range::out_of_range() : logic_error(){ 35 | 36 | } 37 | 38 | _UCXXEXPORT out_of_range::out_of_range(const string & what_arg) : logic_error(what_arg) { 39 | 40 | } 41 | 42 | _UCXXEXPORT runtime_error::runtime_error() : mstring(){ 43 | 44 | } 45 | 46 | _UCXXEXPORT runtime_error::runtime_error(const string& what_arg) : mstring(what_arg){ 47 | 48 | } 49 | 50 | _UCXXEXPORT const char * runtime_error::what() const _UCXX_USE_NOEXCEPT{ 51 | return mstring.c_str(); 52 | } 53 | 54 | } 55 | 56 | #endif 57 | 58 | -------------------------------------------------------------------------------- /src/utility/pdistl/streambuf.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #define __UCLIBCXX_COMPILE_STREAMBUF__ 1 15 | 16 | #include "streambuf" 17 | 18 | namespace pdistd{ 19 | 20 | #ifdef __UCLIBCXX_EXPAND_STREAMBUF_CHAR__ 21 | 22 | #ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ 23 | 24 | template _UCXXEXPORT streambuf::basic_streambuf(); 25 | template _UCXXEXPORT streambuf::~basic_streambuf(); 26 | 27 | #endif 28 | 29 | template _UCXXEXPORT locale streambuf::pubimbue(const locale &loc); 30 | template _UCXXEXPORT streamsize streambuf::in_avail(); 31 | template _UCXXEXPORT streambuf::int_type streambuf::sbumpc(); 32 | template _UCXXEXPORT streambuf::int_type streambuf::snextc(); 33 | template _UCXXEXPORT streambuf::int_type streambuf::sgetc(); 34 | template _UCXXEXPORT streambuf::int_type streambuf::sputbackc(char_type c); 35 | template _UCXXEXPORT streambuf::int_type streambuf::sungetc(); 36 | template _UCXXEXPORT streambuf::int_type streambuf::sputc(char_type c); 37 | 38 | #endif 39 | 40 | 41 | } 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/utility/pdistl/typeinfo.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "typeinfo" 15 | 16 | namespace pdistd{ 17 | 18 | _UCXXEXPORT bad_cast::~bad_cast() _UCXX_USE_NOEXCEPT{ 19 | 20 | } 21 | 22 | _UCXXEXPORT bad_typeid::~bad_typeid() _UCXX_USE_NOEXCEPT{ 23 | 24 | } 25 | 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/utility/pdistl/utility.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | 15 | #include "utility" 16 | 17 | 18 | namespace pdistd{ 19 | 20 | 21 | 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/utility/pdistl/valarray.cpp: -------------------------------------------------------------------------------- 1 | /***************************** PDI STD File *********************************** 2 | This file is taken from external sources. this is taken from open source uClibc++ 3 | library available on github. below is reference link. Thanking to author for 4 | providing this . 5 | 6 | This is free software. you can redistribute it and/or modify it but without any 7 | warranty. 8 | 9 | referred from : https://github.com/mike-matera/ArduinoSTL 10 | added Date : 1st Dec 2024 11 | added by : Suraj I. 12 | ******************************************************************************/ 13 | 14 | #include "valarray" 15 | 16 | namespace pdistd{ 17 | 18 | 19 | 20 | 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/utility/queue/ringbuf.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @brief Ring Buffer library 4 | */ 5 | 6 | #include "ringbuf.h" 7 | 8 | /** 9 | * @brief init a RINGBUF object 10 | * @param r pointer to a RINGBUF object 11 | * @param buf pointer to a byte array 12 | * @param size size of buf 13 | * @return 0 if successfull, otherwise failed 14 | */ 15 | int RINGBUF_Init(RINGBUF *r, unsigned char *buf, unsigned int size) 16 | { 17 | if (r == NULL || buf == NULL || size < 2) 18 | return -1; 19 | 20 | r->p_o = r->p_r = r->p_w = buf; 21 | r->fill_cnt = 0; 22 | r->size = size; 23 | 24 | return 0; 25 | } 26 | /** 27 | * @brief put a character into ring buffer 28 | * @param r pointer to a ringbuf object 29 | * @param c character to be put 30 | * @return 0 if successfull, otherwise failed 31 | */ 32 | int RINGBUF_Put(RINGBUF *r, unsigned char c) 33 | { 34 | if (r->fill_cnt >= r->size) 35 | return -1; // ring buffer is full, this should be atomic operation 36 | 37 | r->fill_cnt++; // increase filled slots count, this should be atomic operation 38 | 39 | *r->p_w++ = c; // put character into buffer 40 | 41 | if (r->p_w >= r->p_o + r->size) // rollback if write pointer go pass 42 | r->p_w = r->p_o; // the physical boundary 43 | 44 | return 0; 45 | } 46 | /** 47 | * @brief get a character from ring buffer 48 | * @param r pointer to a ringbuf object 49 | * @param c read character 50 | * @return 0 if successfull, otherwise failed 51 | */ 52 | int RINGBUF_Get(RINGBUF *r, unsigned char *c) 53 | { 54 | if (r->fill_cnt <= 0) 55 | return -1; // ring buffer is empty, this should be atomic operation 56 | 57 | r->fill_cnt--; // decrease filled slots count 58 | 59 | *c = *r->p_r++; // get the character out 60 | 61 | if (r->p_r >= r->p_o + r->size) // rollback if write pointer go pass 62 | r->p_r = r->p_o; // the physical boundary 63 | 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /src/webserver/pages/DeviceIotPage.h: -------------------------------------------------------------------------------- 1 | /**************************** Device IoT HTML Pages *************************** 2 | This file is part of the PDI stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | The `DeviceIotPage.h` file defines the HTML content for the IoT device 8 | registration configuration page of the web server. This page allows users to 9 | configure and register IoT devices through a web interface. The HTML content 10 | is stored in program memory (PROG_RODT_ATTR) to optimize memory usage on embedded 11 | systems. 12 | 13 | Author : Suraj I. 14 | Created Date : 1st June 2019 15 | ******************************************************************************/ 16 | 17 | #ifndef _WEB_SERVER_DEVICE_IOT_PAGE_H_ 18 | #define _WEB_SERVER_DEVICE_IOT_PAGE_H_ 19 | 20 | #include 21 | 22 | /** 23 | * @brief HTML content for the IoT device registration configuration page. 24 | * 25 | * This static HTML content is used to render the top section of the IoT device 26 | * registration configuration page on the web server. It includes a form for 27 | * submitting device registration details. 28 | */ 29 | static const char WEB_SERVER_DEVICE_REGISTER_CONFIG_PAGE_TOP[] PROG_RODT_ATTR = "\ 30 |

Device Register Configuration

\ 31 |
\ 32 | "; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/webserver/pages/EmailConfigPage.h: -------------------------------------------------------------------------------- 1 | /*************************** Email Config HTML Page **************************** 2 | This file is part of the PDI stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | The `EmailConfigPage.h` file defines the HTML content for the email configuration 8 | page of the web server. This page allows users to configure email settings, such 9 | as SMTP server details, credentials, and other related parameters. The HTML content 10 | is stored in program memory (PROG_RODT_ATTR) to optimize memory usage on embedded systems. 11 | 12 | Author : Suraj I. 13 | Created Date : 1st June 2019 14 | ******************************************************************************/ 15 | 16 | #ifndef _WEB_SERVER_EMAIL_CONFIG_PAGE_H_ 17 | #define _WEB_SERVER_EMAIL_CONFIG_PAGE_H_ 18 | 19 | #include 20 | 21 | /** 22 | * @brief HTML content for the email configuration page. 23 | * 24 | * This static HTML content is used to render the top section of the email 25 | * configuration page on the web server. It includes a form for submitting 26 | * email configuration details. 27 | */ 28 | static const char WEB_SERVER_EMAIL_CONFIG_PAGE_TOP[] PROG_RODT_ATTR = "\ 29 |

Email Configuration

\ 30 | \ 31 |
"; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/webserver/pages/LoginConfigPage.h: -------------------------------------------------------------------------------- 1 | /************************** Login Config HTML Page **************************** 2 | This file is part of the PDI stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | The `LoginConfigPage.h` file defines the HTML content for the login configuration 8 | page of the web server. This page allows users to configure login credentials, 9 | such as username and password, through a web interface. The HTML content is 10 | stored in program memory (PROG_RODT_ATTR) to optimize memory usage on embedded systems. 11 | 12 | Author : Suraj I. 13 | Created Date : 1st June 2019 14 | ******************************************************************************/ 15 | 16 | #ifndef _WEB_SERVER_LOGIN_CONFIG_PAGE_H_ 17 | #define _WEB_SERVER_LOGIN_CONFIG_PAGE_H_ 18 | 19 | #include 20 | 21 | /** 22 | * @brief HTML content for the login configuration page. 23 | * 24 | * This static HTML content is used to render the top section of the login 25 | * configuration page on the web server. It includes a form for submitting 26 | * login credentials. 27 | */ 28 | static const char WEB_SERVER_LOGIN_CONFIG_PAGE_TOP[] PROG_RODT_ATTR = "\ 29 |

Login Configuration

\ 30 | \ 31 |
"; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/webserver/pages/LoginPage.h: -------------------------------------------------------------------------------- 1 | /**************************** Login HTML Page ********************************* 2 | This file is part of the PDI stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | The `LoginPage.h` file defines the HTML content for the login page of the web 8 | server. This page allows users to log in by providing their username and 9 | password. The HTML content is stored in program memory (PROG_RODT_ATTR) to optimize 10 | memory usage on embedded systems. 11 | 12 | Author : Suraj I. 13 | Created Date : 1st June 2019 14 | ******************************************************************************/ 15 | 16 | #ifndef _WEB_SERVER_LOGIN_PAGE_H_ 17 | #define _WEB_SERVER_LOGIN_PAGE_H_ 18 | 19 | #include 20 | 21 | /** 22 | * @brief HTML content for the login page. 23 | * 24 | * This static HTML content is used to render the login page of the web server. 25 | * It includes a form with fields for entering a username and password, and a 26 | * button to submit the login credentials. 27 | */ 28 | static const char WEB_SERVER_LOGIN_PAGE[] PROG_RODT_ATTR = "\ 29 |

Login to Continue !

\ 30 | \ 31 |
\ 32 | \ 33 | \ 34 | \ 35 | \ 36 | \ 37 | \ 38 | \ 39 | \ 40 | \ 41 | \ 42 | \ 47 | \ 48 |
Username:
Password:
\ 43 | \ 46 |
\ 49 |
"; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/webserver/pages/LogoutPage.h: -------------------------------------------------------------------------------- 1 | /**************************** Logout HTML Page ******************************** 2 | This file is part of the PDI stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | The `LogoutPage.h` file defines the HTML content for the logout page of the web 8 | server. This page is displayed to users after they have successfully logged out. 9 | It provides a message confirming the logout and a link to navigate back to the 10 | login page. The HTML content is stored in program memory (PROG_RODT_ATTR) to optimize 11 | memory usage on embedded systems. 12 | 13 | Author : Suraj I. 14 | Created Date : 1st June 2019 15 | ******************************************************************************/ 16 | 17 | #ifndef _WEB_SERVER_LOGOUT_PAGE_H_ 18 | #define _WEB_SERVER_LOGOUT_PAGE_H_ 19 | 20 | #include 21 | 22 | /** 23 | * @brief HTML content for the logout page. 24 | * 25 | * This static HTML content is used to render the logout page of the web server. 26 | * It includes a message confirming the logout and a button linking to the login 27 | * page for reauthentication. 28 | */ 29 | static const char WEB_SERVER_LOGOUT_PAGE[] PROG_RODT_ATTR = "\ 30 |

Logged Out Successfully

\ 31 |
\ 32 | \ 33 | \ 36 | \ 37 | to login again\ 38 |
"; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/webserver/pages/NotFound.h: -------------------------------------------------------------------------------- 1 | /************************** 404 Not Found HTML Page **************************** 2 | This file is part of the PDI stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | The `NotFound.h` file defines the HTML content for the "404 Not Found" page of 8 | the web server. This page is displayed when a user attempts to access a route 9 | or resource that does not exist. It provides a message indicating the page was 10 | not found and includes a link to navigate back to the home page. The HTML content 11 | is stored in program memory (PROG_RODT_ATTR) to optimize memory usage on embedded systems. 12 | 13 | Author : Suraj I. 14 | Created Date : 1st June 2019 15 | ******************************************************************************/ 16 | 17 | #ifndef _WEB_SERVER_404_PAGE_H_ 18 | #define _WEB_SERVER_404_PAGE_H_ 19 | 20 | #include 21 | 22 | /** 23 | * @brief HTML content for the "404 Not Found" page. 24 | * 25 | * This static HTML content is used to render the "404 Not Found" page of the 26 | * web server. It includes a message indicating the page was not found and a 27 | * button linking to the home page. 28 | */ 29 | static const char WEB_SERVER_404_PAGE[] PROG_RODT_ATTR = "\ 30 |

Page Not Found

\ 31 |
\ 32 | Go to\ 33 | \ 34 | \ 37 | \ 38 |
"; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/webserver/pages/OtaConfigPage.h: -------------------------------------------------------------------------------- 1 | /**************************** OTA Config HTML Page **************************** 2 | This file is part of the PDI stack. 3 | 4 | This is free software. You can redistribute it and/or modify it but without any 5 | warranty. 6 | 7 | The `OtaConfigPage.h` file defines the HTML content for the OTA (Over-The-Air) 8 | configuration page of the web server. This page allows users to configure OTA 9 | update settings through a web interface. The HTML content is stored in program 10 | memory (PROG_RODT_ATTR) to optimize memory usage on embedded systems. 11 | 12 | Author : Suraj I. 13 | Created Date : 1st June 2019 14 | ******************************************************************************/ 15 | 16 | #ifndef _WEB_SERVER_OTA_CONFIG_PAGE_H_ 17 | #define _WEB_SERVER_OTA_CONFIG_PAGE_H_ 18 | 19 | #include 20 | 21 | /** 22 | * @brief HTML content for the OTA configuration page. 23 | * 24 | * This static HTML content is used to render the top section of the OTA 25 | * configuration page on the web server. It includes a form for submitting OTA 26 | * update settings. 27 | */ 28 | static const char WEB_SERVER_OTA_CONFIG_PAGE_TOP[] PROG_RODT_ATTR = "\ 29 |

OTA Configuration

\ 30 |
\ 31 | "; 32 | 33 | #endif 34 | --------------------------------------------------------------------------------