Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit 36d816e

Browse files
Merge pull request #11 from Azure/dawalton/bump
2 parents 14c7ba8 + 38443d8 commit 36d816e

File tree

7 files changed

+35
-3
lines changed

7 files changed

+35
-3
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=AzureIoTUtility
2-
version=1.5.0
2+
version=1.6.0
33
author=Microsoft
44
maintainer=Microsoft <[email protected]>
55
sentence=Azure C shared utility library for Arduino. For the Arduino MKR1000 or Zero and WiFi Shield 101, Adafruit Huzzah and Feather M0, or SparkFun Thing.

src/AzureIoTUtility.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
#include "azure_c_shared_utility/tlsio.h"
1313
#include "azure_c_shared_utility/xlogging.h"
1414

15-
#define AzureIoTUtilityVersion "1.5.0"
15+
#define AzureIoTUtilityVersion "1.6.0"
1616

1717
#endif //AZUREIOTUTILITY_H

src/adapters/sslClient_arduino.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ static BearSSL::X509List cert(certificates);
1515
#include "WiFi.h"
1616
#include "WiFiClientSecure.h"
1717
static WiFiClientSecure sslClient; // for ESP32
18+
#elif WIO_TERMINAL
19+
#include "WiFi.h"
20+
#include "WiFiClientSecure.h"
21+
static WiFiClientSecure sslClient; // for Wio Terminal variant of SAMD
1822
#else
1923
#include "WiFi101.h"
2024
#include "WiFiSSLClient.h"

src/samd/NTPClientAz.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ void NTPClientAz::prepareRequest()
5858
void NTPClientAz::sendRequest(const char* host, int port)
5959
{
6060
_udp.beginPacket(host, port);
61+
62+
#if WIO_TERMINAL
63+
_udp.write((const uint8_t*)_buffer, NTP_PACKET_SIZE);
64+
#else
6165
_udp.write(_buffer, NTP_PACKET_SIZE);
66+
#endif
67+
6268
_udp.endPacket();
6369
}
6470

src/samd/NTPClientAz.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
#ifndef NTPCLIENT_AZ_H
77
#define NTPCLIENT_AZ_H
88

9+
#if WIO_TERMINAL
10+
#include <WiFi.h>
11+
#else
912
#include <WiFi101.h>
13+
#endif
14+
1015
#include <WiFiUdp.h>
1116

1217
#define NTP_PACKET_SIZE 48

src/samd/sample_init.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@
99
#include <time.h>
1010
#include <sys/time.h>
1111
#include <SPI.h>
12+
13+
#if WIO_TERMINAL
14+
#include <WiFi.h>
15+
#include "WiFiClientSecure.h"
16+
static WiFiClientSecure sslClient; // for Wio Terminal variant of SAMD
17+
#else
1218
#include <WiFi101.h>
19+
static WiFiSSLClient sslClient;
20+
#endif
21+
1322
#include <WiFiUdp.h>
1423
#include "NTPClientAz.h"
1524

@@ -79,7 +88,15 @@ static void initTime() {
7988
delay(2000);
8089
} else {
8190
Serial.print("Fetched NTP epoch time is: ");
91+
92+
#if WIO_TERMINAL
93+
char buff[32];
94+
sprintf(buff, "%.f", difftime(epochTime, (time_t) 0));
95+
Serial.println(buff);
96+
#else
8297
Serial.println(epochTime);
98+
#endif
99+
83100
break;
84101
}
85102
}

src/samd/time.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
#if defined(ARDUINO_ARCH_SAMD)
4+
#if defined(ARDUINO_ARCH_SAMD) && !defined(WIO_TERMINAL)
55
#include <time.h>
66
#include <sys/time.h>
77

0 commit comments

Comments
 (0)