last update: 2024/05
Demo Sample Application Folder:
Application
└ _Exclude
├ IOT ..... HTTPクライアント、JSONパーサー機能のデモサンプル| Sample | 説明 |
|---|---|
| IOT_HTTP_GetRequest | HTTPクライアントのGETコマンドを実行して内容をコンソールに表示します |
| IOT_HTTP_RedirectRequest | HTTPクライアントのGETコマンドを実行して、リダイレクトリクエストを処理します |
| IOT_HTTP_SecureGet | HTTPクライアントのセキュアGETコマンドを実行して内容をコンソールに表示します |
| Sample | 説明 |
|---|---|
| IOT_JSON_IncrementalParse | サンプル JSON オブジェクトを文字ごとに解析して結果をコンソールに表示します |
| IOT_JSON_MakeTree | サンプル JSON オブジェクトを解析して結果をツリー形式で表示します |
| IOT_JSON_PlainTrace | サンプル JSON オブジェクトを解析して結果をコンソールに表示します |
| IOT_JSON_PrettyTrace | サンプル JSON オブジェクトを解析して結果をツリー形式で表示します |
Config |- IOT_Conf.h ............. コンフィグレーション設定ファイル | |- IO | |- IOT_ConfigIO.c ..... デバッグコンソールIOインターフェース設定ファイル | |- SYS ................... SYS インターフェース設定(ソース・ヘッダ)
プロジェクト設定では「\Application\_Exclude\IOT」フォルダはビルド対象外に設定しています。
「\_Exclude\IOT」フォルダ下の動作確認を行うテストサンプルファイルをビルド対象設定の「\Application」フォルダ下にコピーします。
各テストアプリケーションの動作確認方法はテストサンプルアプリケーションのヘッダのコメント情報を参照ください。プロジェクトを再ビルドし、評価ボードに接続してデバッグセッションを開始します。
デバッガのIOコンソールのログ画面から結果を確認します。
評価ボードのLANポートをテスト用パソコンに接続して、TCP/IPネットワーク通信が正常にできることを確認してください。

ネットワーク環境に合わせて評価ボード側のemNetスタックのコンフィグレーション設定を編集してください。
File: BSP\Setup\IP_Config_RX72N_ETH.c
#define USE_DHCP 1 // Use DHCP client or static IP configuration. // // The following parameters are only used when the DHCP client is not active. // #define IP_ADDR IP_BYTES2ADDR(192, 168, 11, 8) #define SUBNET_MASK IP_BYTES2ADDR(255, 255, 255, 0) #define GW_ADDR IP_BYTES2ADDR(192, 168, 11, 1) #define DNS_ADDR IP_BYTES2ADDR(192, 168, 11, 1)
File: IOT_HTTP_GetRequest.c (HOST設定)
void MainTask(void) {
....
IOT_HTTP_AddHost (&HTTP, "www.embitek.co.jp");
....Debug IO Console:
4:025 DHCPc: Sending Request. 4:031 DHCPc: IFace 0: Using IP: 192.168.0.4, Mask: 255.255.255.0, GW: 192.168.0.1. Returned status code: 302 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>Found</h1> <p>The document has moved <a href="https://www.embitek.co.jp/">here</a>.</p> </body></html> STOP.
Debug IO Console:
3:025 DHCPc: Sending Request. 3:031 DHCPc: IFace 0: Using IP: 192.168.0.4, Mask: 255.255.255.0, GW: 192.168.0.1. Returned status code: 301 Redirect to https://www.segger.com/ Cannot handle scheme https! STOP.
Read HTTP contents from www.segger.com/emssl-testpage.php
Debug IO Console:
3:025 DHCPc: Sending Request.
3:031 DHCPc: IFace 0: Using IP: 192.168.0.4, Mask: 255.255.255.0, GW: 192.168.0.1.
Sample Setup HOST = www.segger.com
PATH = /emssl-testpage.php
-----------------------------
Returned status code: 301
Redirect to https://www.segger.com/emssl-testpage.php
Returned status code: 200
Welcome to www.segger.com/emssl-testpage.php!..
Successfully connected via SSL..
Current date is 2024-05-03..
Current time is 14:26:32..
STOP.Debug IO Console:
SEGGER Software Evaluation Sample Eval Board: RX72N Envision Kit Base: Renesas RI600V4 RTOS ------------------------------------------------ Begin object Key = "name" String = "My TV" Key = "resolutions" Begin array Begin object Key = "width" Number = "1280" Key = "height" Number = "720" End object Begin object Key = "width" Number = "1920" Key = "height" Number = "1080" End object Begin object Key = "width" Number = "3840" Key = "height" Number = "2160" End object End array End object Parse OK
Debug IO Console:
SEGGER Software Evaluation Sample
Eval Board: RX72N Envision Kit
Base: Renesas RI600V4 RTOS
------------------------------------------------
Begin object
Key = "name"
String = "My TV"
Key = "resolutions"
Begin array
Begin object
Key = "width"
Number = "1280"
Key = "height"
Number = "720"
End object
Begin object
Key = "width"
Number = "1920"
Key = "height"
Number = "1080"
End object
Begin object
Key = "width"
Number = "3840"
Key = "height"
Number = "2160"
End object
End array
End object
Parse OKTCP/IPネットワーク通信