Azure IoT common library
Fork of azure_c_shared_utility by
platform_mbed.cpp@34:651c23af382c, 2017-08-24 (annotated)
- Committer:
- wiggly
- Date:
- Thu Aug 24 14:14:15 2017 +0100
- Revision:
- 34:651c23af382c
- Parent:
- 33:5f2a48fc7e5b
Pass in network stack to platform initialisation
Remove NTP setup from azure platform code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Azure.IoT Build | 0:fa2de1b79154 | 1 | // Copyright (c) Microsoft. All rights reserved. |
Azure.IoT Build | 0:fa2de1b79154 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
Azure.IoT Build | 0:fa2de1b79154 | 3 | |
Azure.IoT Build | 0:fa2de1b79154 | 4 | #include "azure_c_shared_utility/platform.h" |
Azure.IoT Build | 0:fa2de1b79154 | 5 | #include "EthernetInterface.h" |
wiggly | 33:5f2a48fc7e5b | 6 | #include "NetworkInterface.h" |
wiggly | 34:651c23af382c | 7 | |
AzureIoTClient | 21:b92006c5b9ff | 8 | #include "azure_c_shared_utility/optimize_size.h" |
Azure.IoT Build | 0:fa2de1b79154 | 9 | #include "azure_c_shared_utility/xio.h" |
Azure.IoT Build | 0:fa2de1b79154 | 10 | #include "azure_c_shared_utility/tlsio_wolfssl.h" |
Azure.IoT Build | 0:fa2de1b79154 | 11 | |
wiggly | 34:651c23af382c | 12 | static NetworkInterface* _platform_mbed_network; |
Azure.IoT Build | 0:fa2de1b79154 | 13 | |
wiggly | 33:5f2a48fc7e5b | 14 | int platform_init(NetworkInterface* net) |
Azure.IoT Build | 0:fa2de1b79154 | 15 | { |
wiggly | 33:5f2a48fc7e5b | 16 | int result = 0; |
wiggly | 34:651c23af382c | 17 | _platform_mbed_network = net; |
Azure.IoT Build | 0:fa2de1b79154 | 18 | return result; |
Azure.IoT Build | 0:fa2de1b79154 | 19 | } |
Azure.IoT Build | 0:fa2de1b79154 | 20 | |
Azure.IoT Build | 0:fa2de1b79154 | 21 | const IO_INTERFACE_DESCRIPTION* platform_get_default_tlsio(void) |
Azure.IoT Build | 0:fa2de1b79154 | 22 | { |
Azure.IoT Build | 0:fa2de1b79154 | 23 | return tlsio_wolfssl_get_interface_description(); |
Azure.IoT Build | 0:fa2de1b79154 | 24 | } |
Azure.IoT Build | 0:fa2de1b79154 | 25 | |
AzureIoTClient | 25:8507bf644fdf | 26 | STRING_HANDLE platform_get_platform_info(void) |
AzureIoTClient | 25:8507bf644fdf | 27 | { |
AzureIoTClient | 25:8507bf644fdf | 28 | return STRING_construct("(mbed)"); |
AzureIoTClient | 25:8507bf644fdf | 29 | } |
AzureIoTClient | 25:8507bf644fdf | 30 | |
wiggly | 33:5f2a48fc7e5b | 31 | void platform_deinit(void) {} |
wiggly | 34:651c23af382c | 32 | |
wiggly | 34:651c23af382c | 33 | NetworkInterface* platform_get_network_stack() { |
wiggly | 34:651c23af382c | 34 | return _platform_mbed_network; |
wiggly | 34:651c23af382c | 35 | } |