Skip to main content
  • Products
  • Evaluate our Software
  • Downloads
  • Free Utilities
  • Purchase
  • Silicon Vendors
  • Support
  • About Us
  • Blog
  • Forum
  • Search
  • Jobs
  • Newsletter
  • Blog
  • Contact
  • Shop
  • emNet
  • CoAP Server/Client

    CoAP Server/Client

    The emNet Constrained Application Protocol (CoAP) client/server is an optional extension which adds CoAP support to the stack.

    Contact us
    Downloads
    Documentation
    SEGGER emNet
    1. 1.Relevant parts
    2. 2.Requirements
    3. 3.Resource usage
    4. 4.CoAP background

    Overview

    The emNet Constrained Application Protocol (CoAP) client/server is an optional extension which adds CoAP support to the stack. It combines a maximum of performance with a small memory footprint.

    The CoAP server allows an embedded system to handle CoAP requests from a CoAP client. The CoAP client allows an embedded system to send request to a CoAP server.

    Key features

    • Low memory footprint
    • GET, DELETE, PUT, POST supported
    • Confirmable (CON) and non-confirmable (NON) requests supported
    • The server supports multiple clients
    • Independent of the UDP/IP stack: any stack with sockets can be used
    • Block transfer supported
    • Observe option supported
    • Example applications included
    • Demo included with various options, request types, observable data
    • Project for executable on PC for Microsoft Visual Studio included

    Relevant parts

    The CoAP client/server implements the relevant parts of the following Request For Comments (RFC).

    RFC#Description
    [RFC 7252]Direct Link: The Constrained Application Protocol (CoAP)
    [RFC 6690]Direct Link: Constrained RESTful Environments (CoRE) Link Format
    [RFC 7641]Direct Link: Observing Resources in the Constrained Application Protocol (CoAP)
    [RFC 7959]Direct Link: Block-Wise Transfers in the Constrained Application Protocol (CoAP)


    The following table shows the contents of the emNet CoAP root directory:

    DirectoryContent
    ApplicationContains the example application to run the CoAP client/server with emNet.
    ConfigContains the CoAP configuration file. Refer to the documentation for detailed information.
    IncContains the required include files.
    IPContains the CoAP sources and header files.
    Windows\IP\CoAP_ServerContains the source, the project files and an executable to run the emNet CoAP server example on a Microsoft Windows host.
    Windows\IP\CoAP_ClientContains the source, the project files and an executable to run the emNet CoAP client on a Microsoft Windows host.

    Requirements

    TCP/IP stack

    The emNet CoAP client/server requires a UDP/IP stack. It is optimized for emNet, but any RFC-compliant UDP/IP stack can be used. The shipment includes a Win32 simulation, which uses the standard Winsock API and an implementation which uses the socket API of emNet.

     

    Multi tasking

    The client/server does not require any multi-tasking environment to run. But the various CoAP APIs are not thread safe and should be protected accordingly if used in different threads.

    Resource usage

    ROM Usage

    The ROM usage depends on the compiler options, the compiler version and the used CPU. The memory requirements of the CoAP client/server presented in the tables below have been measured on a Cortex-M4 system with the default configuration.

    Add-onROM
    emNet CoAP clientApproximately 6.5 KByte
    emNet CoAP serverApproximately 9.2 KByte

    RAM Usage

    All the RAM used is taken from buffers given by the application.

    Add-onRAM
    emNet CoAP clientMinimal configuration 456 Bytes. More for observer usage and bigger message buffer.
    emNet CoAP serverMinimal configuration 548 Bytes + 48 bytes per resources. More for observer usage and bigger message buffer.

    CoAP background

    The Constrained Application Protocol (CoAP) is an Internet of Things (IoT) protocol which allows machine to machine (M2M) communication with small footprint applications. It uses Uniform Resource Identifier (URI) to identify resources on the server. With its small and simple 4 bytes header, it's ideal for devices with limited resources.

    The CoAP protocol implements a RESTful client-server based on four methods:

    • GET: The GET method retrieves a representation for the information that currently corresponds to the resource identified by the request URI.
    • PUT: The PUT method requests that the resource identified by the request URI be updated with the enclosed representation.
    • POST: The POST method requests that the representation enclosed in the request be processed to create a new resource or update an existing one.
    • DELETE: The DELETE method requests that the resource identified by the request URI be deleted.

    The CoAP protocol is based on UDP (or DTLS for the secured version) and thus has to deal with potential message loss and repetition. It is a simple message exchange between endpoints. It relies on confirmable (CON) or non-confirmable (NON) messages.

    The emNet CoAP server implementation can not be used as a proxy. But the client can send requests to a CoAP proxy.

    Block transfer option

    The emNet CoAP client/server supports the block transfer option. This option allows to transfer big amounts of data cut into smaller chunks. This is especially useful when the network MTU is relatively small or when the system implementing the CoAP client/server has strong constrains on memory usage.

    Observe option

    The emNet CoAP client/server supports the observe option. With this option, a client does not have to poll a server periodically to monitor the state of a resource. It can instead register to the resource and be automatically notified by the server when the resource changes.

    COA Server Client
    • User manual
    • Online documentation
    • List of downloads
    • Release notes
    • Update notification
    • Pricing
    • Support
    • Silicon vendor resources

    Headquarters

    SEGGER Microcontroller GmbH

    Ecolab-Allee 5
    40789 Monheim am Rhein, Germany
    info@segger.com
    Tel.: +49-2173-99312-0
    Fax: +49-2173-99312-28

    Locations

    USA: SEGGER Microcontroller Systems LLC

    Boston area
    101 Suffolk Lane
    Gardner, MA 01440, USA
    us-east@segger.com
    Tel.: +1-978-874-0299
    Fax: +1-978-874-0599

    Silicon Valley
    Milpitas, CA 95035, USA
    us-west@segger.com
    Tel.: +1-408-767-4068

    China: SEGGER Microcontroller China Co., Ltd.

    Room 218, Block A, Dahongqiaoguoji
    No. 133 Xiulian Road
    Minhang District, Shanghai 201199, China
    china@segger.com
    Tel.: +86-133-619-907-60

    ISO 9001 certified

    ISO 9001

    30+ years of experience

    First-class embedded software tools since 1992
    • Imprint
    • Disclaimer
    • Code of Conduct
    • Privacy Policy
    © 2025 SEGGER - All rights reserved.