---
title: "[RE] QNEthernet library"
url: "https://maker.wiznet.io/josephsr/projects/re-qnethernet-library/"
markdown_url: "https://maker.wiznet.io/josephsr/projects/re-qnethernet-library/md"
type: "UCC: User Created Content"
author: "joseph"
author_url: "https://maker.wiznet.io/ssekim/projects/qnethernet/"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "joseph"
original_url: "https://maker.wiznet.io/ssekim/projects/qnethernet/"
published: "2024-06-04"
language: "en"
likes: 0
views: 665
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# [RE] QNEthernet library

> Provide a library for simple and efficient Ethernet communication

Original author: joseph (source: https://maker.wiznet.io/ssekim/projects/qnethernet/)

## Documents and links

- [QNEthernet](https://github.com/ssilverman/QNEthernet) (code)

## Article

## **Project Introduction**

QNEthernet is a library for simple and efficient Ethernet communication, providing intuitive APIs and robust functionality.

## **Key Features**

- **DHCP Support**

- **TCP and UDP Communication**

- **Ethernet Event Handling**

## **Key Functions**

- **DHCP**: Set IP addresses automatically using `Ethernet.begin()`.

- **Ethernet Link Status**: Detect link status changes using `Ethernet.onLinkState()`.

- **IP Address Changes**: Detect IP address changes using `Ethernet.onAddressChanged()`.

- Support other events and examples

## **Code Example**

```plaintext
#include <QNEthernet.h>
using namespace qindesign::network;

void setup() {
    // Start Ethernet and set IP address using DHCP
    Ethernet.begin();
    // Detect and print link status changes
    Ethernet.onLinkState([](bool state) {
        Serial.println(state ? "Link up" : "Link down");
    });
    // Detect and print IP address changes
    Ethernet.onAddressChanged([](IPAddress ip) {
        Serial.print("IP Address: ");
        Serial.println(ip);
    });
}

void loop() {
    // Code for periodically sending and receiving data
}
```

---

Source: https://maker.wiznet.io/josephsr/projects/re-qnethernet-library/
