Internet Middleware API Reference  Rev 1.0
Introduction

Overview

The MediaTek LinkItâ„¢ Development Platform for RTOS integrates several widely adopted protocols using various open source libraries, to reduce development effort and enable device communication over IP. The open source libraries are actively supported by the open source community, with comprehensive online resources and support forums.
MediaTek has also ported Internet protocols and added extensions listed in this API reference. For information on the core platform APIs please refer to the MediaTek LinkItâ„¢ Development Platform for RTOS API Reference.
Please note that the Internet Middleware API is Open Source Software implementation dependent and is not guaranteed to be updated for future changes in the underlying APIs.

Terms and acronyms

Acronyms Definition
DHCP The Dynamic Host Configuration Protocol (DHCP) is a standardized network protocol used on Internet Protocol networks for dynamically distributing network configuration parameters.
For more information, please refer to introduction to DHCP in Wikipedia.
HTTP The Hypertext Transfer Protocol (HTTP) is the foundation of data communication for the World Wide Web.
For more information, please refer to introduction to HTTP in Wikipedia.
MQTT MQTT (formerly MQ Telemetry Transport) is a publish-subscribe based "light weight" messaging protocol for use on top of the TCP/IP protocol.
For more information, please refer to introduction to MQTT in Wikipedia.
TLS Transport Layer Security (TLS) is a cryptographic protocol designed to provide communications security over a computer network.
For more information, please refer to introduction to TLS in Wikipedia.
CGI Common Gateway Interface (CGI) is a standard environment for web servers to interface with executable programs installed on a server that generate web pages dynamically.
For more information, please refer to introduction to CGI in Wikipedia.

Overview of the modules

The SDK integrates several widely adopted protocol implementations to reduce the development effort and enable device communication over Internet Protocol.
The APIs are implemented by the active open source community with widely available online resources and forum support.
Detailed information of all modules is provided in the Open Source User Guide. MediaTek does not modify the original open source APIs. Instead, MediaTek defines or extends the open source API implementations. Only MediaTek defined and extended APIs are listed in this API reference, including the modules below:

  • DHCPD. A DHCP server (daemon) running in software AP mode to provide network configurations to attached Wi-Fi station nodes.
  • HTTP client. An implementation of HTTP/1.1 client protocol to GET or POST data to the remote HTTP server, optionally over TLS connections.
  • HTTP server. HTTP server enables developers to host web services with MediaTek IoT solutions to provide information for clients or perform actions with CGI by invoking the associated programs.
    Note that the HTTP server currently does not support connections over TLS.
  • MQTT client. Enables running an MQTT client application on the MediaTek platform to subscribe and/or publish messages on the servers. It also supports communication with server over TLS connection with the underlying mbed TLS library.

Examples of Internet Middleware

Examples are provided to demonstrate the flow of calling the APIs in various applications. The examples are located at:

  • DHCPD. This module runs in software AP mode. There is no standalone example to demonstrate its use. Developers can find the actual module execution invoking the DHCPD APIs at <sdk_root>/project/mt7687_hdk/apps/iot_sdk_demo/src/lwip_network.c.
  • HTTP client. There are two reference examples demonstrating the use of high-level and low-level APIs under <sdk_root>/project/mt7687_hdk/apps/http_client folder. The high level API is used to send GET or POST requests to the server. For more advanced control of the HTTP messages, developers can use low-level API to customize the transmitted content.
  • HTTP server. A reference example demonstrating how to initialize, start and stop the web service can be found under <sdk_root>/project/mt7687_hdk/apps/httpd folder.

License

(C) 2005-2016 MediaTek Inc. All rights reserved.

This software/firmware and related documentation ("MediaTek Software") are protected under relevant copyright laws. The information contained herein is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors. Without the prior written permission of MediaTek and/or its licensors, any reproduction, modification, use or disclosure of MediaTek Software, and information contained herein, in whole or in part, shall be strictly prohibited. You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software if you have agreed to and been bound by the applicable license agreement with MediaTek ("License Agreement") and been granted explicit permission to do so within the License Agreement ("Permitted User"). If you are not a Permitted User, please cease any access or use of MediaTek Software immediately. BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.