Azure / azure-sdk-for-c

This repository is for active development of the Azure SDK for Embedded C. For consumers of the SDK we recommend visiting our versioned developer docs at https://azure.github.io/azure-sdk-for-c.
MIT License
224 stars 120 forks source link

Azure_IoT_Hub_RealtekAmebaD the example build error. #2597

Closed felaray closed 1 year ago

felaray commented 1 year ago

Describe the bug Azure_IoT_Hub_RealtekAmebaD the example build error.

Exception or Stack Trace


Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "AMB82-MINI, Disable, Disable, Disable, 2000000"

In file included from C:\Users\vivat\Documents\Arduino\libraries\Azure_SDK_for_C\examples\Azure_IoT_Hub_RealtekAmebaD\Azure_IoT_Hub_RealtekAmebaD.ino:10:

C:\Users\vivat\Documents\Arduino\libraries\NTPClient/NTPClient.h:13:5: error: 'UDP' does not name a type

   13 |     UDP*          _udp;

      |     ^~~

C:\Users\vivat\Documents\Arduino\libraries\NTPClient/NTPClient.h:17:5: error: 'IPAddress' does not name a type; did you mean 'IPAddress_h'?

   17 |     IPAddress     _poolServerIP;

      |     ^~~~~~~~~

      |     IPAddress_h

C:\Users\vivat\Documents\Arduino\libraries\NTPClient/NTPClient.h:31:18: error: expected ')' before '&' token

   31 |     NTPClient(UDP& udp);

      |              ~   ^

      |                  )

C:\Users\vivat\Documents\Arduino\libraries\NTPClient/NTPClient.h:32:18: error: expected ')' before '&' token

   32 |     NTPClient(UDP& udp, long timeOffset);

      |              ~   ^

      |                  )

C:\Users\vivat\Documents\Arduino\libraries\NTPClient/NTPClient.h:33:18: error: expected ')' before '&' token

   33 |     NTPClient(UDP& udp, const char* poolServerName);

      |              ~   ^

      |                  )

C:\Users\vivat\Documents\Arduino\libraries\NTPClient/NTPClient.h:34:18: error: expected ')' before '&' token

   34 |     NTPClient(UDP& udp, const char* poolServerName, long timeOffset);

      |              ~   ^

      |                  )

C:\Users\vivat\Documents\Arduino\libraries\NTPClient/NTPClient.h:35:18: error: expected ')' before '&' token

   35 |     NTPClient(UDP& udp, const char* poolServerName, long timeOffset, unsigned long updateInterval);

      |              ~   ^

      |                  )

C:\Users\vivat\Documents\Arduino\libraries\NTPClient/NTPClient.h:36:18: error: expected ')' before '&' token

   36 |     NTPClient(UDP& udp, IPAddress poolServerIP);

      |              ~   ^

      |                  )

C:\Users\vivat\Documents\Arduino\libraries\NTPClient/NTPClient.h:37:18: error: expected ')' before '&' token

   37 |     NTPClient(UDP& udp, IPAddress poolServerIP, long timeOffset);

      |              ~   ^

      |                  )

C:\Users\vivat\Documents\Arduino\libraries\NTPClient/NTPClient.h:38:18: error: expected ')' before '&' token

   38 |     NTPClient(UDP& udp, IPAddress poolServerIP, long timeOffset, unsigned long updateInterval);

      |              ~   ^

      |                  )

C:\Users\vivat\Documents\Arduino\libraries\Azure_SDK_for_C\examples\Azure_IoT_Hub_RealtekAmebaD\Azure_IoT_Hub_RealtekAmebaD.ino: In function 'int64_t iot_sample_get_epoch_expiration_time_from_minutes(uint32_t)':

Azure_IoT_Hub_RealtekAmebaD:160:21: error: cannot convert 'long int*' to 'long long int*'

  160 |   sntp_get_lasttime(&ts, &tus, &ttk);

      |                     ^~~

      |                     |

      |                     long int*

In file included from C:\Users\vivat\Documents\Arduino\libraries\Azure_SDK_for_C\examples\Azure_IoT_Hub_RealtekAmebaD\Azure_IoT_Hub_RealtekAmebaD.ino:15:

C:\Users\vivat\Documents\ArduinoData\packages\realtek\hardware\AmebaPro2\4.0.3\system/component/network/sntp/sntp.h:19:35: note:   initializing argument 1 of 'void sntp_get_lasttime(long long int*, long long int*, unsigned int*)'

   19 | void sntp_get_lasttime(long long *sec, long long *usec, unsigned int *tick);

      |                        ~~~~~~~~~~~^~~

Azure_IoT_Hub_RealtekAmebaD:165:23: error: cannot convert 'long int*' to 'long long int*'

  165 |     sntp_get_lasttime(&ts, &tus, &ttk);

      |                       ^~~

      |                       |

      |                       long int*

In file included from C:\Users\vivat\Documents\Arduino\libraries\Azure_SDK_for_C\examples\Azure_IoT_Hub_RealtekAmebaD\Azure_IoT_Hub_RealtekAmebaD.ino:15:

C:\Users\vivat\Documents\ArduinoData\packages\realtek\hardware\AmebaPro2\4.0.3\system/component/network/sntp/sntp.h:19:35: note:   initializing argument 1 of 'void sntp_get_lasttime(long long int*, long long int*, unsigned int*)'

   19 | void sntp_get_lasttime(long long *sec, long long *usec, unsigned int *tick);

      |                        ~~~~~~~~~~~^~~

C:\Users\vivat\Documents\Arduino\libraries\Azure_SDK_for_C\examples\Azure_IoT_Hub_RealtekAmebaD\Azure_IoT_Hub_RealtekAmebaD.ino: In function 'void generate_sas_key()':

C:\Users\vivat\Documents\Arduino\libraries\Azure_SDK_for_C\examples\Azure_IoT_Hub_RealtekAmebaD\Azure_IoT_Hub_RealtekAmebaD.ino:286:10: warning: unused variable 'mqtt_password_length' [-Wunused-variable]

  286 |   size_t mqtt_password_length;

      |          ^~~~~~~~~~~~~~~~~~~~

C:\Users\vivat\Documents\Arduino\libraries\Azure_SDK_for_C\examples\Azure_IoT_Hub_RealtekAmebaD\Azure_IoT_Hub_RealtekAmebaD.ino: In function 'char* get_telemetry_payload()':

C:\Users\vivat\Documents\Arduino\libraries\Azure_SDK_for_C\examples\Azure_IoT_Hub_RealtekAmebaD\Azure_IoT_Hub_RealtekAmebaD.ino:368:23: warning: ignoring return value of 'az_result az_span_u32toa(az_span, uint32_t, az_span*)' declared with attribute 'warn_unused_result' [-Wunused-result]

  368 |   (void)az_span_u32toa(temp_span, telemetry_send_count++, &temp_span);

      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Multiple libraries were found for "WiFi.h"

 Used: C:\Users\vivat\Documents\ArduinoData\packages\realtek\hardware\AmebaPro2\4.0.3\libraries\WiFi

 Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\libraries\WiFi

exit status 1

cannot convert 'long int*' to 'long long int*'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

To Reproduce Steps to reproduce the behavior:

  1. Select example image
  2. Click Verify then get error.

Code Snippet

`// Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT

// C99 libraries

include

include

include

// Libraries for NTP, MQTT client, WiFi connection and SAS-token generation.

include //Line 10

include

include

include <mbedtls/base64.h>

include <mbedtls/sha256.h>

include <sntp/sntp.h>`

Expected behavior Build success.

Screenshots image image image

Setup (please complete the following information):

Additional context N/A

Information Checklist Please make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

felaray commented 1 year ago

it's not work on AMB82-MINI, But worked on AMB23