Skip to content

Commit 9906ac8

Browse files
update include path and includes
1 parent 142966f commit 9906ac8

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

.github/workflows/threadx.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,15 @@ jobs:
120120
/* threadx_netx_test.c
121121
* Minimal ThreadX/NetX test app using NetConnect logic from mqttnet.c
122122
*/
123-
123+
124124
#include <stdio.h>
125125
#include "tx_api.h"
126126
#include "nx_api.h"
127127
#include "nxd_dns.h"
128+
#include "wolfmqtt/mqtt_client.h"
128129
#include "examples/mqttnet.h"
129130
#include "examples/mqttexample.h"
130-
131+
131132
#define DEMO_STACK_SIZE 2048
132133
#define DEMO_IP_ADDRESS IP_ADDRESS(192,168,1,100)
133134
#define DEMO_NET_MASK 0xFFFFFF00
@@ -136,25 +137,25 @@ jobs:
136137
#define DEMO_HOSTNAME "test.mosquitto.org"
137138
#define DEMO_PORT 1883
138139
#define DEMO_TIMEOUT_MS 5000
139-
140+
140141
/* ThreadX/NetX objects */
141142
TX_THREAD demo_thread;
142143
ULONG demo_thread_stack[DEMO_STACK_SIZE / sizeof(ULONG)];
143144
NX_PACKET_POOL pool_0;
144145
NX_IP ip_0;
145146
NX_DNS dns_0;
146-
147+
147148
/* Forward declaration */
148149
void demo_thread_entry(ULONG thread_input);
149-
150+
150151
void tx_application_define(void *first_unused_memory)
151152
{
152153
/* Create the main demo thread. */
153154
tx_thread_create(&demo_thread, "Demo Thread", demo_thread_entry, 0,
154155
demo_thread_stack, DEMO_STACK_SIZE,
155156
1, 1, TX_NO_TIME_SLICE, TX_AUTO_START);
156157
}
157-
158+
158159
void demo_thread_entry(ULONG thread_input)
159160
{
160161
UINT status;
@@ -163,18 +164,18 @@ jobs:
163164
MqttNet net;
164165
SocketContext *sockCtx;
165166
int rc;
166-
167+
167168
/* Initialize NetX system */
168169
nx_system_initialize();
169-
170+
170171
/* Create a packet pool. */
171172
status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool",
172173
1536, (UCHAR*)first_unused_memory, 16*1536);
173174
if (status != NX_SUCCESS) {
174175
printf("Packet pool create failed: %u\n", status);
175176
return;
176177
}
177-
178+
178179
/* Create an IP instance. */
179180
status = nx_ip_create(&ip_0, "NetX IP Instance",
180181
DEMO_IP_ADDRESS, DEMO_NET_MASK,
@@ -184,13 +185,13 @@ jobs:
184185
printf("IP create failed: %u\n", status);
185186
return;
186187
}
187-
188+
188189
/* Enable ARP, ICMP, TCP, UDP */
189190
nx_arp_enable(&ip_0, (UCHAR*)first_unused_memory + 16*1536 + 2048, 1024);
190191
nx_icmp_enable(&ip_0);
191192
nx_tcp_enable(&ip_0);
192193
nx_udp_enable(&ip_0);
193-
194+
194195
/* Create DNS instance */
195196
status = nxd_dns_create(&dns_0, (UCHAR*)"DNS Client", &ip_0, (UCHAR*)first_unused_memory + 16*1536 + 2048 + 1024, 2048);
196197
if (status != NX_SUCCESS) {
@@ -200,14 +201,14 @@ jobs:
200201
dns_server.nxd_ip_version = NX_IP_VERSION_V4;
201202
dns_server.nxd_ip_address.v4 = DEMO_DNS_SERVER;
202203
nxd_dns_server_add(&dns_0, &dns_server);
203-
204+
204205
/* Initialize MQTT context and network */
205206
mqtt_init_ctx(&mqttCtx);
206207
MqttClientNet_Init(&net, &mqttCtx);
207208
sockCtx = (SocketContext*)net.context;
208209
sockCtx->ipPtr = &ip_0;
209210
sockCtx->dnsPtr = &dns_0;
210-
211+
211212
/* Use NetConnect to connect to the MQTT broker */
212213
rc = net.connect(sockCtx, DEMO_HOSTNAME, DEMO_PORT, DEMO_TIMEOUT_MS);
213214
if (rc == 0) {
@@ -216,15 +217,15 @@ jobs:
216217
} else {
217218
printf("NetConnect failed: %d\n", rc);
218219
}
219-
220+
220221
/* Cleanup (not strictly necessary in a demo) */
221222
nxd_dns_delete(&dns_0);
222223
nx_ip_delete(&ip_0);
223224
nx_packet_pool_delete(&pool_0);
224225
/* Thread exits */
225226
tx_thread_terminate(&demo_thread);
226227
}
227-
228+
228229
/* Placeholder driver for demo purposes */
229230
void nx_driver_placeholder(NX_IP_DRIVER *driver_req)
230231
{
@@ -235,12 +236,7 @@ jobs:
235236
- name: Compile ThreadX NetX test app
236237
working-directory: ./wolfmqtt
237238
run: |
238-
gcc -o threadx_netx_test examples/threadx_netx_test.c -I${{ github.workspace }}/netxduo_src/common/inc -I${{ github.workspace }}/netxduo_src/ports/linux/gnu/inc -I${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/inc -I${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/threadx -L${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/default_build_coverage/netxduo -L${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/threadx -lnetxduo -lthreadx -lwolfssl -lwolfmqtt
239-
240-
- name: Run ThreadX NetX test app
241-
working-directory: ./wolfmqtt
242-
run: |
243-
./threadx_netx_test
239+
gcc -o threadx_netx_test examples/threadx_netx_test.c examples/mqttnet.c examples/mqttexample.c -I. -I${{ github.workspace }}/netxduo_src/common/inc -I${{ github.workspace }}/netxduo_src/ports/linux/gnu/inc -I${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/inc -I${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/threadx -L${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/default_build_coverage/netxduo -L${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/threadx -lnetxduo -lthreadx -lwolfssl -lwolfmqtt
244240
245241
# capture logs on failure
246242
- name: Show logs on failure

0 commit comments

Comments
 (0)