Skip to content

Commit 4781c40

Browse files
authored
SocketWrapper: add macAddress() getter (#749)
1 parent d9fc415 commit 4781c40

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Diff for: libraries/SocketWrapper/src/SocketHelpers.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ uint8_t* arduino::MbedSocketClass::macAddress(uint8_t* mac) {
1111
return mac;
1212
}
1313

14+
String arduino::MbedSocketClass::macAddress() {
15+
return String(getNetwork()->get_mac_address());
16+
}
17+
1418
int arduino::MbedSocketClass::hostByName(const char* aHostname, IPAddress& aResult) {
1519
SocketAddress socketAddress = SocketAddress();
1620
nsapi_error_t returnCode = getNetwork()->gethostbyname(aHostname, &socketAddress);

Diff for: libraries/SocketWrapper/src/SocketHelpers.h

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ class MbedSocketClass {
113113
int hostByName(const char* aHostname, IPAddress& aResult);
114114

115115
uint8_t* macAddress(uint8_t* mac);
116+
String macAddress();
116117

117118
void setFeedWatchdogFunc(voidFuncPtr func);
118119
void feedWatchdog();

0 commit comments

Comments
 (0)