### WiFiServer Initialization Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Methods to start the server and bind it to a port. ```cpp void begin(int port) ``` ```cpp void begin() ``` -------------------------------- ### Install can-utils Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/Arduino_CAN/README.md Install the can-utils package, which provides essential tools like 'cansend' and 'candump' for CAN bus interaction. ```bash sudo apt-get install can-utils ``` -------------------------------- ### FatFs Disk I/O Glue Function Example Source: https://github.com/arduino/arduinocore-renesas/blob/main/extras/Filesystems/FatFs/source/00readme.txt An example implementation of the glue function to connect an existing disk I/O module with FatFs. This file demonstrates how to adapt your hardware-specific I/O to FatFs. ```c diskio.c ``` -------------------------------- ### Initialize WiFiSSLClient Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Constructs a new WiFiSSLClient object. No specific setup is required before calling this constructor. ```cpp WiFiSSLClient() ``` -------------------------------- ### FatFs Optional OS Related Functions Example Source: https://github.com/arduino/arduinocore-renesas/blob/main/extras/Filesystems/FatFs/source/00readme.txt An example implementation of optional operating system related functions for FatFs. This is useful for integrating FatFs into an RTOS environment. ```c ffsystem.c ``` -------------------------------- ### Initialize and Configure SSLClient for Secure Connections Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/SSLClient/README.md Demonstrates initializing an SSLClient with a transport layer (e.g., TinyGsmClient) and configuring X.509 certificates and private keys for secure communication. This setup is often required before establishing a connection to a secure server or service. ```arduino TinyGsmClient transport(modem); SSLClient secure(&transport); ... // Configure certificates to be used secure.setCACert(AWS_CERT_CA); secure.setCertificate(AWS_CERT_CRT); secure.setPrivateKey(AWS_CERT_PRIVATE); ... ``` -------------------------------- ### WiFiServer Methods Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Documentation for key methods of the WiFiServer class, including checking for available clients, accepting connections, starting and ending the server, and writing data. ```APIDOC ### available() Checks if there are any incoming client connections waiting to be accepted. This function queries the server to check if there is a client waiting to be accepted. If a client is available, it returns a [WiFiClient](#class_wi_fi_client) object representing the client. It uses the modem to query the server for an available client socket and accepts the connection if a valid client is found. #### Returns * [WiFiClient](#class_wi_fi_client) - A [WiFiClient](#class_wi_fi_client) object representing the next client connection that is available for processing. ### accept() Accepts an incoming client connection on the server. #### Returns * [WiFiClient](#class_wi_fi_client) - A [WiFiClient](#class_wi_fi_client) object representing the accepted client. ### begin(int port) Starts the Wi-Fi server and binds it to the specified port. #### Parameters * `port` (int) - The port number which the server will listen to for incoming connections. ### begin() Starts the Wi-Fi server and binds it to the default port. This function initializes the server and binds it to a default port. ### write(uint8_t) Writes a single byte to all connected clients. #### Parameters * `b` (uint8_t) - The byte to be sent to the clients. ### write(const char *buffer, size_t size) Writes data to all connected clients. #### Parameters * `buffer` (const char *) - Pointer to the data buffer to be sent. * `size` (size_t) - The number of bytes to send from the buffer. ### end() Ends the Wi-Fi server and closes the server socket. ### operator bool() Converts the [WiFiSSLClient](#class_wi_fi_s_s_l_client) object to a boolean value. ### operator==(const WiFiServer &) Compares two [WiFiServer](#class_wi_server) objects for equality. ### operator!=(const WiFiServer &) Compares two [WiFiServer](#class_wi_server) objects for inequality. ``` -------------------------------- ### Start UDP Socket on IP and Port Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Starts a UDP socket bound to a specific IP address and port. Returns 1 if successful, 0 otherwise. Ensure the IP and port are available. ```cpp virtual uint8_t begin(IPAddress a, uint16_t p) ``` -------------------------------- ### Start UDP Socket on Port Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Starts a UDP socket on the specified local port. Returns 1 if successful, 0 otherwise. Ensure the port is not already in use. ```cpp virtual uint8_t begin(uint16_t) ``` -------------------------------- ### Start UDP Multicast Socket Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Starts a UDP multicast socket bound to a specific IP address and port. Returns 1 if successful, 0 otherwise. Ensure the IP and port are available for multicast. ```cpp virtual uint8_t beginMulticast(IPAddress, uint16_t) ``` -------------------------------- ### Initialize and Use littlefs Source: https://github.com/arduino/arduinocore-renesas/blob/main/extras/Filesystems/littlefs/README.md Demonstrates mounting the filesystem, reading a boot counter, and updating it safely. Requires user-provided block device operation functions. ```c #include "lfs.h" // variables used by the filesystem lfs_t lfs; lfs_file_t file; // configuration of the filesystem is provided by this struct const struct lfs_config cfg = { // block device operations .read = user_provided_block_device_read, .prog = user_provided_block_device_prog, .erase = user_provided_block_device_erase, .sync = user_provided_block_device_sync, // block device configuration .read_size = 16, .prog_size = 16, .block_size = 4096, .block_count = 128, .cache_size = 16, .lookahead_size = 16, .block_cycles = 500, }; // entry point int main(void) { // mount the filesystem int err = lfs_mount(&lfs, &cfg); // reformat if we can't mount the filesystem // this should only happen on the first boot if (err) { lfs_format(&lfs, &cfg); lfs_mount(&lfs, &cfg); } // read current count uint32_t boot_count = 0; lfs_file_open(&lfs, &file, "boot_count", LFS_O_RDWR | LFS_O_CREAT); lfs_file_read(&lfs, &file, &boot_count, sizeof(boot_count)); // update boot count boot_count += 1; lfs_file_rewind(&lfs, &file); lfs_file_write(&lfs, &file, &boot_count, sizeof(boot_count)); // remember the storage is not updated until the file is closed successfully lfs_file_close(&lfs, &file); // release any resources we were using lfs_unmount(&lfs); // print the boot count printf("boot_count: %d\n", boot_count); } ``` -------------------------------- ### Initialize WiFiFileSystem Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Constructs an object for the WiFiFileSystem class. This is the first step before performing any file system operations. ```cpp WiFiFileSystem() ``` -------------------------------- ### Build esp-hosted for Portenta C33 Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFi/extra/README.md Commands to clone the repository, apply patches, configure the environment, and build the firmware. ```bash git clone https://github.com/espressif/esp-hosted.git --recursive cd esp-hosted/ #git checkout release/fg-v0.0.5 git checkout fe0b10584417629908cee8141699c2f35ea05a25 patch -p1 < ../0001-Defaults-for-C33-BLE.patch cd esp_hosted_fg/esp/esp_driver/ ./esp-idf/install.sh esp32s3 . ./esp-idf/export.sh cd network_adapter/ idf.py set-target esp32c3 cp ../../../../../sdkconfig.default.c33 sdkconfig idf.py build cd ../../../../../ python combine.py ``` -------------------------------- ### Build and run CAN tests Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/Arduino_CAN/extras/test/README.md Use these commands to create a build directory, configure the project with CMake, and execute the test binary. ```bash mkdir build && cd build cmake .. make && bin/can-test ``` -------------------------------- ### Initialize OPAMP Library Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/OPAMP/README.md Include the OPAMP library and initialize the OPAMP peripheral with a specified speed. Choose between low-speed (lower power) or high-speed (higher power) modes. ```cpp #include void setup () { OPAMP.begin(OPAMP_SPEED_HIGHSPEED); } void loop() {} ``` -------------------------------- ### parsePacket Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Starts processing the next available incoming packet. ```APIDOC ## parsePacket ### Description Start processing the next available incoming packet. ### Returns - **int** - Returns the size of the incoming packet, or 0 if no packet is available. ``` -------------------------------- ### Connect to Server Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Establishes a connection to a server using either an IP address or a hostname. ```cpp virtual int connect(IPAddress ip, uint16_t port) ``` ```cpp virtual int connect(const char * host, uint16_t port) ``` -------------------------------- ### Get Remote Port Number Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Retrieves the remote port number of the server the WiFiClient is connected to. Returns 0 if not connected. ```cpp virtual uint16_t remotePort() ``` -------------------------------- ### Compile the Portenta C33 Bootloader Source: https://github.com/arduino/arduinocore-renesas/blob/main/bootloaders/PORTENTA_H33/README.md Steps to clone the necessary repositories and build the bootloader using the provided Makefile. ```bash git clone https://github.com/arduino/arduino-renesas-bootloader git clone https://github.com/hathach/tinyusb cd tinyusb # This step is temporary patch -p1 < ../arduino-renesas-bootloader/0001-fix-arduino-bootloaders.patch python tools/get_deps.py ra cd .. cd arduino-renesas-bootloader TINYUSB_ROOT=$PWD/../tinyusb make -f Makefile.c33 ``` -------------------------------- ### Get Remote IP Address Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Retrieves the IP address of the server the WiFiClient is connected to. Returns IPAddress(0, 0, 0, 0) if not connected. ```cpp virtual IPAddress remoteIP() ``` -------------------------------- ### FSP Build Recipes Source: https://github.com/arduino/arduinocore-renesas/blob/main/platform.txt Defines the specific command patterns for compiling source files, creating archives, and linking the final ELF binary. ```text ## Compile c files recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 {compiler.fsp.cflags} {compiler.tinyusb.cflags} {compiler.c.extra_flags} {build.extra_flags} {tinyusb.includes} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" {includes} "-iprefix{runtime.platform.path}" "@{compiler.fsp.includes}" -o "{object_file}" "{source_file}" ## Compile c++ files recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DARDUINO={runtime.ide.version} "-DPROJECT_NAME="{build.path}/{build.project_name}"" -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 {compiler.fsp.cxxflags} {compiler.tinyusb.cxxflags} {compiler.cpp.extra_flags} {build.extra_flags} {tinyusb.includes} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" {includes} "-iprefix{runtime.platform.path}" "@{compiler.fsp.includes}" "{source_file}" -o "{object_file}" ## Compile asm files recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 {includes} {build.extra_flags} {build.extra_ldflags} {compiler.S.extra_flags} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" {includes} "-iprefix{runtime.platform.path}" "@{compiler.fsp.includes}" "{source_file}" -o "{object_file}" ## Create archives recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" ## Combine gc-sections, archives, and objects recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {build.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" "-L{build.variant.path}" "-T{build.variant.path}/fsp.ld" {object_files} -Wl,--whole-archive -Wl,--start-group {compiler.fsp} "{build.path}/{archive_file}" -Wl,--no-whole-archive {compiler.fsp.extra_ldflags} {compiler.libraries.ldflags} -Wl,--end-group "-Wl,-Map,{build.path}/{build.project_name}.map" ``` -------------------------------- ### Directory Move: Begin Move Source: https://github.com/arduino/arduinocore-renesas/blob/main/extras/Filesystems/littlefs/DESIGN.md Shows the state after initiating a directory move. A reference is added to the destination directory, and 'gstate' is updated to reflect the ongoing directory move. ```text begin move, add reference in dir C, change gstate to have move => .--------. gstate = moving dir B in root (m1^~m1^m2) .| root | || | .--------------|| | | |'--------' | '--|-|-|-' | .-------' | '----------. | v | v | .--------. | .--------. '->| dir A |-. | .->| dir C | || gdelta | | | | || gdelta | || =~m1 | | | | || =m1^m2 | |'--------' | | | |'--------' '--------' | | | '---|--|-' | | .-------' | | v v | v | .--------. | .--------. ``` -------------------------------- ### WiFiServer Constructor Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Constructors for initializing a WiFiServer object, either with default settings or a specific port. ```cpp WiFiServer() ``` ```cpp WiFiServer(int p) ``` -------------------------------- ### Block Allocation Simulation Source: https://github.com/arduino/arduinocore-renesas/blob/main/extras/Filesystems/littlefs/DESIGN.md Simulates the process of allocating blocks on a busy filesystem using a lookahead buffer. Shows how the buffer is populated and depleted. ```text boot... lookahead: fs blocks: fffff9fffffffffeffffffffffff0000 scanning... lookahead: fffff9ff fs blocks: fffff9fffffffffeffffffffffff0000 alloc = 21 lookahead: fffffdff fs blocks: fffffdfffffffffeffffffffffff0000 alloc = 22 lookahead: ffffffff fs blocks: fffffffffffffffeffffffffffff0000 scanning... lookahead: fffffffe fs blocks: fffffffffffffffeffffffffffff0000 alloc = 63 lookahead: ffffffff fs blocks: ffffffffffffffffffffffffffff0000 scanning... lookahead: ffffffff ``` -------------------------------- ### WiFiClient Constructor and Destructor Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Initializes a new WiFiClient instance or cleans up an existing one. ```cpp WiFiClient(const WiFiClient & c) ``` ```cpp ~WiFiClient() ``` -------------------------------- ### Atomic File Move: Begin Move Source: https://github.com/arduino/arduinocore-renesas/blob/main/extras/Filesystems/littlefs/DESIGN.md Illustrates the state after initiating a file move. A reference is added to the destination directory, and 'gstate' is updated to reflect the ongoing move. ```text begin move, add reference in dir C, change gstate to have move => .--------. gstate = moving file D in dir A (m1) .| root | || | .-------------|| | | |'--------' | '--|-|-|-' | .------' | '-------. | v v v | .--------. .--------. .--------. '->| dir A |->| dir B |->| dir C | || | || | || gdelta | || | || | || =m1 | |'--------' |'--------' |'--------' '----|---' '--------' '----|---' | .----------------' v v .--------. | file D | | | | | '--------' ``` -------------------------------- ### Run littlefs test suite Source: https://github.com/arduino/arduinocore-renesas/blob/main/extras/Filesystems/littlefs/README.md Execute the test suite on a Linux environment using make. ```bash make test ``` -------------------------------- ### WiFiServer Connection Handling Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Methods to check for and accept incoming client connections. ```cpp WiFiClient available() ``` ```cpp WiFiClient accept() ``` -------------------------------- ### Include EEPROM Library Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/EEPROM/README.md Add the library header to your sketch to enable EEPROM functionality. ```Arduino #include void setup(){ } void loop(){ } ``` -------------------------------- ### Connect to Server by Hostname Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Establishes a secure SSL connection to a server using its hostname and port. Returns 1 on success, 0 otherwise. ```cpp virtual int connect(const char * host, uint16_t port) ``` -------------------------------- ### Flash the Bootloader via rfp-cli Source: https://github.com/arduino/arduinocore-renesas/blob/main/bootloaders/PORTENTA_H33/README.md Command to flash the compiled hex file to the device using the Renesas Flash Programmer CLI. ```bash rfp-cli -device ra -port $portname -p dfu_c33.hex ``` -------------------------------- ### Flash firmware to ESP32-C3 Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFi/extra/README.md Methods for flashing the compiled binary using either espflash or esptool. ```bash espflash write-bin 0x0 ESP32-C3.bin ``` ```bash esptool.py --chip esp32c3 -p /dev/ttyACM0 -b 230400 --before=default_reset --after=hard_reset --no-stub write_flash --flash_mode dio --flash_freq 80m --flash_size 2MB 0x0 ESP32-C3.bin ``` -------------------------------- ### Compiler and Build Configuration Source: https://github.com/arduino/arduinocore-renesas/blob/main/platform.txt Defines the toolchain paths, warning levels, optimization flags, and command-line arguments for C, C++, and assembly compilation. ```text name=Arduino Renesas fsp Boards version=1.5.3 # Compile variables # ------------------------ compiler.warning_flags=-w compiler.warning_flags.none=-w compiler.warning_flags.default= compiler.warning_flags.more=-Wall compiler.warning_flags.all=-Wall -Wextra compiler.optimization_flags=-Os compiler.optimization_flags.release=-Os compiler.optimization_flags.debug=-Og compiler.path={build.compiler_path} compiler.c.cmd={build.crossprefix}gcc compiler.c.flags=-c {compiler.warning_flags} {compiler.optimization_flags} -g3 -nostdlib {build.defines} -MMD -std=gnu11 -mcpu={build.mcu} {build.float-abi} {build.fpu} -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin compiler.c.elf.cmd={build.crossprefix}g++ compiler.c.elf.flags=-Wl,--gc-sections --specs=nosys.specs {compiler.warning_flags} -mcpu={build.mcu} {build.float-abi} {build.fpu} compiler.S.cmd={build.crossprefix}g++ compiler.S.flags=-c -g -x assembler-with-cpp {compiler.optimization_flags} -mcpu={build.mcu} {build.float-abi} {build.fpu} -fsigned-char -ffunction-sections -fdata-sections compiler.cpp.cmd={build.crossprefix}g++ compiler.cpp.flags=-c {compiler.warning_flags} {compiler.optimization_flags} -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -MMD -nostdlib {build.defines} -MMD -std=gnu++17 -mcpu={build.mcu} {build.float-abi} {build.fpu} -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin compiler.ar.cmd={build.crossprefix}ar compiler.ar.flags=rcs compiler.ar.extra_flags= compiler.objcopy.cmd= compiler.objcopy.eep.flags= compiler.elf2hex.bin.flags=-O binary -j .text -j .data compiler.elf2hex.hex.flags=-O ihex -j .text -j .data compiler.elf2hex.extra_flags= compiler.elf2hex.cmd={build.crossprefix}objcopy compiler.ldflags= compiler.libraries.ldflags= compiler.size.cmd={build.crossprefix}size compiler.define=-DARDUINO= # this can be overriden in boards.txt build.extra_flags= build.extra_ldflags= # These can be overridden in platform.local.txt compiler.c.extra_flags= compiler.c.elf.extra_flags= compiler.S.extra_flags= compiler.cpp.extra_flags= compiler.ar.extra_flags= compiler.objcopy.eep.extra_flags= compiler.elf2hex.extra_flags= tinyusb.includes="-I{build.core.path}/tinyusb" # USB Flags # --------- build.usb_flags= ``` -------------------------------- ### Module Configuration Overview Source: https://github.com/arduino/arduinocore-renesas/blob/main/extras/e2studioProjects/Santiago/ra_cfg.txt General configuration settings for hardware modules like I/O, ADC, and communication interfaces. ```APIDOC ## Module Configuration ### Description Provides default BSP parameter checking and specific feature toggles for hardware modules. ### Modules - **I/O Port (r_ioport)**: Default BSP parameter checking. - **ADC (r_adc)**: Default BSP parameter checking. - **I2C Master (r_iic_master)**: 10-bit slave addressing disabled, DTC disabled. - **SPI (r_spi)**: Transfer API enabled, RXI interrupt transmission disabled. - **UART (r_sci_uart)**: FIFO, DTC, and Flow Control enabled. - **Flash (r_flash_lp)**: Data Flash programming enabled, Code Flash programming disabled. ``` -------------------------------- ### beginPacket Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Begins constructing a UDP packet for sending to a specific destination. ```APIDOC ## beginPacket ### Description Begins constructing a UDP packet for sending to a specific IP address or hostname and port. ### Parameters - **ip** (IPAddress) - Required - The destination IP address. - **host** (const char *) - Required - The destination hostname. - **port** (uint16_t) - Required - The destination port number. ### Returns - **int** - Returns 1 if the packet preparation is successful. Or 0 if there is an error or the socket is not initialized. ``` -------------------------------- ### WiFiClient Constructors Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Constructors for initializing a WiFiClient instance, either as a default object or with a specific socket descriptor. ```cpp WiFiClient() ``` ```cpp WiFiClient(int s) ``` -------------------------------- ### Deploy Library to SSLClient Source: https://github.com/arduino/arduinocore-renesas/blob/main/extras/net/README.md Moves the generated static library file to the appropriate directory within the SSLClient library structure. ```bash cp liblwIP.a ../../libraries/lwIpWrapper/src/cortex-m33/ ``` -------------------------------- ### Configure SocketCAN Interface Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/Arduino_CAN/README.md Set up the SocketCAN interface with a specific bitrate. Ensure your CAN/USB dongle is connected and recognized as 'can0'. ```bash sudo ip link set can0 type can bitrate 250000 sudo ip link set up can0 ``` -------------------------------- ### WiFiServer Constructors Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Details the constructors for the WiFiServer class, including default initialization and initialization with a specific port. ```APIDOC ### WiFiServer() Initializes objects of the [WiFiServer](#class_wi_fi_server) class. ### WiFiServer(int p) Constructs a [WiFiServer](#class_wi_fi_server) object with the specified port. #### Parameters * `p` (int) - The port number on which the server will listen for incoming connections. ``` -------------------------------- ### connect (hostname) Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Establishes a secure SSL connection to a specified host and port. ```APIDOC ## connect(const char * host, uint16_t port) ### Description Establishes a secure SSL connection to a specified host and port. ### Parameters #### Path Parameters - **host** (const char *) - Required - The hostname or IP address of the server. - **port** (uint16_t) - Required - The port number. ### Response - **Returns** (int) - Returns 1 if the connection is successfully established, 0 otherwise. ``` -------------------------------- ### Connect to Server by IP Address Source: https://github.com/arduino/arduinocore-renesas/blob/main/libraries/WiFiS3/docs/api.md Establishes a secure SSL connection to a server using its IP address and port. Ensure the IPAddress object and port number are valid. ```cpp virtual int connect(IPAddress ip, uint16_t port) ``` -------------------------------- ### Updating Global State with Changes Source: https://github.com/arduino/arduinocore-renesas/blob/main/extras/Filesystems/littlefs/DESIGN.md Demonstrates how to update the global state by XORing the current state with changes and any existing delta in a metadata pair, then committing the new delta. ```text .--------. .--------. .--------. .--------. .--------. .| |->| gdelta |->| |->| gdelta |->| gdelta | || | || 0x23 | || | || 0xff | || 0xce | || | || | || | || | || | |'--------' |'--------' |'--------' |'--------' |'--------' '--------' '----|---' '--------' '--|---|-' '----|---' v v | 0x00 --> xor ----------------> xor -| | | change gstate to 0xab | --> xor | v .--------. .--------. .--------. .--------. .--------. .| |->| gdelta |->| |->| gdelta |->| gdelta | || | || 0x23 | || | || 0x46 | || 0xce | || | || | || | || | || | |'--------' |'--------' |'--------' |'--------' |'--------' '--------' '----|---' '--------' '----|---' '----|---' v v v 0x00 --> xor ------------------> xor ------> xor --> gstate = 0xab ```