forked from Azure/iot-edge-v1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
31 lines (28 loc) · 863 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include <stdio.h>
#include "gateway.h"
int main(int argc, char** argv)
{
GATEWAY_HANDLE gateway;
if (argc != 2)
{
printf("usage: hello_world_sample configFile\n");
printf("where configFile is the name of the file that contains the Gateway configuration\n");
}
else
{
if ((gateway = Gateway_CreateFromJson(argv[1])) == NULL)
{
printf("failed to create the gateway from JSON\n");
}
else
{
printf("gateway successfully created from JSON\n");
printf("gateway shall run until ENTER is pressed\n");
(void)getchar();
Gateway_Destroy(gateway);
}
}
return 0;
}