22 | #define NOSTACKTRACE 1
23 |
24 | #if defined(NOSTACKTRACE)
25 | #define FUNC_ENTRY
26 | #define FUNC_ENTRY_NOLOG
27 | #define FUNC_ENTRY_MED
28 | #define FUNC_ENTRY_MAX
29 | #define FUNC_EXIT
30 | #define FUNC_EXIT_NOLOG
31 | #define FUNC_EXIT_MED
32 | #define FUNC_EXIT_MAX
33 | #define FUNC_EXIT_RC(x)
34 | #define FUNC_EXIT_MED_RC(x)
35 | #define FUNC_EXIT_MAX_RC(x)
36 |
37 | #else
38 |
39 | #if defined(WIN32)
40 | #define inline __inline
41 | #define FUNC_ENTRY StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MINIMUM)
42 | #define FUNC_ENTRY_NOLOG StackTrace_entry(__FUNCTION__, __LINE__, -1)
43 | #define FUNC_ENTRY_MED StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MEDIUM)
44 | #define FUNC_ENTRY_MAX StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MAXIMUM)
45 | #define FUNC_EXIT StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MINIMUM)
46 | #define FUNC_EXIT_NOLOG StackTrace_exit(__FUNCTION__, __LINE__, -1)
47 | #define FUNC_EXIT_MED StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MEDIUM)
48 | #define FUNC_EXIT_MAX StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MAXIMUM)
49 | #define FUNC_EXIT_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MINIMUM)
50 | #define FUNC_EXIT_MED_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MEDIUM)
51 | #define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MAXIMUM)
52 | #else
53 | #define FUNC_ENTRY StackTrace_entry(__func__, __LINE__, TRACE_MINIMUM)
54 | #define FUNC_ENTRY_NOLOG StackTrace_entry(__func__, __LINE__, -1)
55 | #define FUNC_ENTRY_MED StackTrace_entry(__func__, __LINE__, TRACE_MEDIUM)
56 | #define FUNC_ENTRY_MAX StackTrace_entry(__func__, __LINE__, TRACE_MAXIMUM)
57 | #define FUNC_EXIT StackTrace_exit(__func__, __LINE__, NULL, TRACE_MINIMUM)
58 | #define FUNC_EXIT_NOLOG StackTrace_exit(__func__, __LINE__, NULL, -1)
59 | #define FUNC_EXIT_MED StackTrace_exit(__func__, __LINE__, NULL, TRACE_MEDIUM)
60 | #define FUNC_EXIT_MAX StackTrace_exit(__func__, __LINE__, NULL, TRACE_MAXIMUM)
61 | #define FUNC_EXIT_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MINIMUM)
62 | #define FUNC_EXIT_MED_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MEDIUM)
63 | #define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MAXIMUM)
64 |
65 | void StackTrace_entry(const char* name, int line, int trace);
66 | void StackTrace_exit(const char* name, int line, void* return_value, int trace);
67 |
68 | void StackTrace_printStack(FILE* dest);
69 | char* StackTrace_get(unsigned long);
70 |
71 | #endif
72 |
73 | #endif
74 |
75 |
76 |
77 |
78 | #endif /* STACKTRACE_H_ */
79 |
--------------------------------------------------------------------------------
/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/README.md:
--------------------------------------------------------------------------------
1 | # Eclipse Paho MQTT C/C++ client for Embedded platforms
2 |
3 | This repository contains the source code for the [Eclipse Paho](http://eclipse.org/paho) MQTT C/C++ client library for Embedded platorms.
4 |
5 | It is dual licensed under the EPL and EDL (see about.html and notice.html for more details). You can choose which of these licenses you want to use the code under. The EDL allows you to embed the code into your application, and distribute your application in binary or source form without contributing any of your code, or any changes you make back to Paho. See the EDL for the exact conditions.
6 |
7 | The MQTTPacket directory contains the lowest level C library with the smallest requirements. This supplies simple serialization
8 | and deserialization routines. It is mainly up to you to write and read to and from the network.
9 |
10 | The MQTTClient directory contains the next level C++ library. This still avoids most networking code so that you can plugin the
11 | network of your choice.
12 |
13 | ## Build requirements / compilation
14 |
15 | There are helper scripts (build...) in various directories. The client library is a set of building blocks which you pick and choose from, so that the smallest MQTT application can be built.
16 |
17 | ## Usage and API
18 |
19 | See the samples directory for examples of intended use.
20 |
21 |
22 | ## Runtime tracing
23 |
24 | As yet, there is no tracing. For the smallest client, should we have tracing?
25 |
26 |
27 | ## Reporting bugs
28 |
29 | This project uses GitHub Issues here: [github.com/eclipse/paho.mqtt.embedded-c/issues](https://github.com/eclipse/paho.mqtt.embedded-c/issues) to track ongoing development and issues.
30 |
31 | ## More information
32 |
33 | Discussion of the Paho clients takes place on the [Eclipse paho-dev mailing list](https://dev.eclipse.org/mailman/listinfo/paho-dev).
34 |
35 | General questions about the MQTT protocol are discussed in the [MQTT Google Group](https://groups.google.com/forum/?hl=en-US&fromgroups#!forum/mqtt).
36 |
37 | There is much more information available via the [MQTT community site](http://mqtt.org).
38 |
--------------------------------------------------------------------------------
/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/about.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | About
5 |
6 |
7 | About This Content
8 |
9 | December 9, 2013
10 | License
11 |
12 | The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
13 | indicated below, the Content is provided to you under the terms and conditions of the
14 | Eclipse Public License Version 1.0 ("EPL") and Eclipse Distribution License Version 1.0 ("EDL").
15 | A copy of the EPL is available at
16 | http://www.eclipse.org/legal/epl-v10.html
17 | and a copy of the EDL is available at
18 | http://www.eclipse.org/org/documents/edl-v10.php.
19 | For purposes of the EPL, "Program" will mean the Content.
20 |
21 | If you did not receive this Content directly from the Eclipse Foundation, the Content is
22 | being redistributed by another party ("Redistributor") and different terms and conditions may
23 | apply to your use of any object code in the Content. Check the Redistributor's license that was
24 | provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
25 | indicated below, the terms and conditions of the EPL still apply to any source code in the Content
26 | and such source code may be obtained at http://www.eclipse.org.
27 |
28 |
29 |
--------------------------------------------------------------------------------
/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/edl-v10:
--------------------------------------------------------------------------------
1 |
2 | Eclipse Distribution License - v 1.0
3 |
4 | Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors.
5 |
6 | All rights reserved.
7 |
8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
9 |
10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
11 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
12 | Neither the name of the Eclipse Foundation, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 |
16 |
--------------------------------------------------------------------------------
/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/platform/network_interface.c:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * \file
4 | *
5 | * \brief Platform network interface
6 | *
7 | * Copyright (c) 2014-2016 Atmel Corporation. All rights reserved.
8 | *
9 | * \asf_license_start
10 | *
11 | * \page License
12 | *
13 | * Redistribution and use in source and binary forms, with or without
14 | * modification, are permitted provided that the following conditions are met:
15 | *
16 | * 1. Redistributions of source code must retain the above copyright notice,
17 | * this list of conditions and the following disclaimer.
18 | *
19 | * 2. Redistributions in binary form must reproduce the above copyright notice,
20 | * this list of conditions and the following disclaimer in the documentation
21 | * and/or other materials provided with the distribution.
22 | *
23 | * 3. The name of Atmel may not be used to endorse or promote products derived
24 | * from this software without specific prior written permission.
25 | *
26 | * 4. This software may only be redistributed and used in connection with an
27 | * Atmel microcontroller product.
28 | *
29 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
30 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
32 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
33 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 | * POSSIBILITY OF SUCH DAMAGE.
40 | *
41 | * \asf_license_stop
42 | *
43 | */
44 |
45 | #include "asf.h"
46 | #include "aws_wifi_task.h"
47 | #include "MQTTReturnCodes.h"
48 | #include "network_interface.h"
49 |
50 | /**
51 | * \brief Reads data from the WINC1500 module.
52 | *
53 | * \param network[in] The Eclipse Paho MQTT network information
54 | * \param read_buffer[in] The buffer
55 | * \param length[in] The buffer length
56 | * \param timeout_ms[in] The timeout
57 | *
58 | * \return The MQTT status
59 | */
60 | int mqtt_packet_read(Network *network, unsigned char *read_buffer, int length, int timeout_ms)
61 | {
62 | return aws_wifi_read_data(read_buffer, length, timeout_ms);
63 | }
64 |
65 | /**
66 | * \brief Writes data to the WINC1500 module.
67 | *
68 | * \param network[in] The Eclipse Paho MQTT network information
69 | * \param send_buffer[in] The buffer
70 | * \param length[in] The buffer length
71 | * \param timeout_ms[in] The timeout
72 | *
73 | * \return The MQTT status
74 | */
75 | int mqtt_packet_write(Network *network, unsigned char *send_buffer, int length, int timeout_ms)
76 | {
77 | return aws_wifi_send_data(send_buffer, length, timeout_ms);
78 | }
79 |
--------------------------------------------------------------------------------
/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/platform/network_interface.h:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * \file
4 | *
5 | * \brief Platform network interface
6 | *
7 | * Copyright (c) 2014-2016 Atmel Corporation. All rights reserved.
8 | *
9 | * \asf_license_start
10 | *
11 | * \page License
12 | *
13 | * Redistribution and use in source and binary forms, with or without
14 | * modification, are permitted provided that the following conditions are met:
15 | *
16 | * 1. Redistributions of source code must retain the above copyright notice,
17 | * this list of conditions and the following disclaimer.
18 | *
19 | * 2. Redistributions in binary form must reproduce the above copyright notice,
20 | * this list of conditions and the following disclaimer in the documentation
21 | * and/or other materials provided with the distribution.
22 | *
23 | * 3. The name of Atmel may not be used to endorse or promote products derived
24 | * from this software without specific prior written permission.
25 | *
26 | * 4. This software may only be redistributed and used in connection with an
27 | * Atmel microcontroller product.
28 | *
29 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
30 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
32 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
33 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 | * POSSIBILITY OF SUCH DAMAGE.
40 | *
41 | * \asf_license_stop
42 | *
43 | */
44 |
45 | #ifndef MQTT_NETWORK_INTERFACE_H
46 | #define MQTT_NETWORK_INTERFACE_H
47 |
48 | #include
49 |
50 | typedef struct mqtt_network {
51 | int (*mqttread)(struct mqtt_network *network, unsigned char *read_buffer, int length, int timeout_ms);
52 | int (*mqttwrite)(struct mqtt_network *network, unsigned char *send_buffer, int length, int timeout_ms);
53 | } Network;
54 |
55 | int mqtt_packet_read(Network *network, unsigned char *read_buffer, int length, int timeout_ms);
56 | int mqtt_packet_write(Network *network, unsigned char *send_buffer, int length, int timeout_ms);
57 |
58 | #endif // MQTT_NETWORK_INTERFACE_H
--------------------------------------------------------------------------------
/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/parson_json/Parson JSON License.txt:
--------------------------------------------------------------------------------
1 | Parson ( http://kgabis.github.com/parson/ )
2 | Copyright (c) 2012 - 2015 Krzysztof Gabis
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in
12 | all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/usb_hid.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | * \brief USB HID functions
4 | *
5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries.
6 | *
7 | * \page License
8 | *
9 | * Subject to your compliance with these terms, you may use Microchip software
10 | * and any derivatives exclusively with Microchip products. It is your
11 | * responsibility to comply with third party license terms applicable to your
12 | * use of third party software (including open source software) that may
13 | * accompany Microchip software.
14 | *
15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT,
19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE
20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR
25 | * THIS SOFTWARE.
26 | */
27 |
28 | #ifndef USB_HID_H
29 | #define USB_HID_H
30 |
31 | #include
32 | #include
33 |
34 | #include "kit_protocol_api.h"
35 |
36 | extern uint8_t g_usb_message_buffer[KIT_MESSAGE_SIZE_MAX]; //! The USB message buffer
37 | extern uint16_t g_usb_message_buffer_length; //! The USB message buffer length
38 | extern bool g_usb_message_received; //! Whether the USB message was received
39 |
40 |
41 | void usb_hid_init(void);
42 |
43 | bool usb_send_response_message(uint8_t *response, uint16_t response_length);
44 |
45 | bool usb_hid_enable_callback(void);
46 | void usb_hid_disable_callback(void);
47 |
48 | void usb_hid_wakeup_callback(void);
49 |
50 | void usb_hid_report_out_callback(uint8_t *report);
51 | void usb_hid_set_feature_callback(uint8_t *report);
52 |
53 | #endif // USB_HID_H
--------------------------------------------------------------------------------
/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/utilities/hex_dump.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | * \brief Print hex dump utility function
4 | *
5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries.
6 | *
7 | * \page License
8 | *
9 | * Subject to your compliance with these terms, you may use Microchip software
10 | * and any derivatives exclusively with Microchip products. It is your
11 | * responsibility to comply with third party license terms applicable to your
12 | * use of third party software (including open source software) that may
13 | * accompany Microchip software.
14 | *
15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT,
19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE
20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR
25 | * THIS SOFTWARE.
26 | */
27 |
28 | #ifndef HEX_DUMP_H
29 | #define HEX_DUMP_H
30 |
31 | #include
32 | #include
33 |
34 | void print_hex_dump(const void *buffer, size_t length, bool display_address,
35 | bool display_ascii, size_t bytes_line);
36 |
37 | #endif // HEX_DUMP_H
--------------------------------------------------------------------------------
/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/version.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | * \brief AWS IoT Zero Touch Demo Version Information
4 | *
5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries.
6 | *
7 | * \page License
8 | *
9 | * Subject to your compliance with these terms, you may use Microchip software
10 | * and any derivatives exclusively with Microchip products. It is your
11 | * responsibility to comply with third party license terms applicable to your
12 | * use of third party software (including open source software) that may
13 | * accompany Microchip software.
14 | *
15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT,
19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE
20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR
25 | * THIS SOFTWARE.
26 | */
27 |
28 | #ifndef VERSION_H
29 | #define VERSION_H
30 |
31 | #define MAJOR_VERSION 2 //! AWS IoT Zero Touch major version number
32 | #define API_VERSION 2 //! AWS IoT Zero Touch API version number
33 | #define PATCH_VERSION 5 //! AWS IoT Zero Touch patch version number
34 |
35 | #define STRING2(x) #x
36 | #define STRING(x) STRING2(x)
37 |
38 | //! AWS IoT Zero Touch version string (Example: "1.0.0")
39 | #define VERSION_STRING STRING(MAJOR_VERSION) "." \
40 | STRING(API_VERSION) "." \
41 | STRING(PATCH_VERSION)
42 |
43 | //! AWS IoT Zero Touch long version string (Example: "AWS IoT Zero Touch Demo v1.0.0")
44 | #define VERSION_STRING_LONG "AWS IoT Zero Touch Demo v" VERSION_STRING
45 |
46 | #endif // VERSION_H
--------------------------------------------------------------------------------
/kit_reset.py:
--------------------------------------------------------------------------------
1 | from argparse import ArgumentParser
2 | import hid
3 | from mchp_aws_zt_kit import MchpAwsZTKitDevice
4 | from sim_hid_device import SimMchpAwsZTHidDevice
5 | from aws_kit_common import *
6 |
7 |
8 | def kit_reset(is_sim=False):
9 | print('\nOpening AWS Zero-touch Kit Device')
10 | if not is_sim:
11 | device = MchpAwsZTKitDevice(hid.device())
12 | else:
13 | device = MchpAwsZTKitDevice(SimMchpAwsZTHidDevice())
14 | device.open()
15 |
16 | print('\nInitializing Kit')
17 | resp = device.init()
18 | print(' ATECCx08A SN: %s' % resp['deviceSn'])
19 |
20 | print('\nResetting Device')
21 | device.reset_kit()
22 |
23 | print('\nDone')
24 |
25 |
26 | if __name__ == '__main__':
27 | # Create argument parser to document script use
28 | parser = ArgumentParser(description='Reset the board to an unprovisioned state')
29 | parser.add_argument(
30 | '--sim',
31 | help='Use a simulated device instead.',
32 | action='store_true'
33 | )
34 | args = parser.parse_args()
35 |
36 | try:
37 | kit_reset(is_sim=args.sim)
38 | except AWSZTKitError as e:
39 | # Print kit errors without a stack trace
40 | print(e)
41 |
--------------------------------------------------------------------------------
/kit_set_wifi.py:
--------------------------------------------------------------------------------
1 | from argparse import ArgumentParser
2 | import hid
3 | from mchp_aws_zt_kit import MchpAwsZTKitDevice
4 | from sim_hid_device import SimMchpAwsZTHidDevice
5 | from aws_kit_common import *
6 |
7 |
8 | def kit_set_wifi(ssid, password, is_sim=False):
9 | print('\nOpening AWS Zero-touch Kit Device')
10 | if not is_sim:
11 | device = MchpAwsZTKitDevice(hid.device())
12 | else:
13 | device = MchpAwsZTKitDevice(SimMchpAwsZTHidDevice())
14 | device.open()
15 |
16 | print('\nInitializing Kit')
17 | resp = device.init()
18 | print(' ATECCx08A SN: %s' % resp['deviceSn'])
19 |
20 | print('\nSetting WiFi Information')
21 | device.set_wifi(ssid=ssid, psk=password)
22 |
23 | kit_info = read_kit_info()
24 | kit_info['wifi_ssid'] = ssid
25 | kit_info['wifi_password'] = password
26 | save_kit_info(kit_info)
27 |
28 | print('\nDone')
29 |
30 |
31 | if __name__ == '__main__':
32 | # Create argument parser to document script use
33 | parser = ArgumentParser(description='Set the WiFi connection settings on the demo board.')
34 | parser.add_argument(
35 | '--ssid',
36 | dest='ssid',
37 | required=True,
38 | metavar='name',
39 | help='WiFi network name'
40 | )
41 | parser.add_argument(
42 | '--password',
43 | dest='password',
44 | default=None,
45 | metavar='pw',
46 | help='WiFi network password'
47 | )
48 | parser.add_argument(
49 | '--sim',
50 | help='Use a simulated device instead.',
51 | action='store_true'
52 | )
53 | args = parser.parse_args()
54 |
55 | try:
56 | kit_set_wifi(ssid=args.ssid, password=args.password, is_sim=args.sim)
57 | except AWSZTKitError as e:
58 | # Print kit errors without a stack trace
59 | print(e)
60 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | cryptography>=2.7
2 | boto3
3 | hidapi
4 | pyasn1_modules==0.1.5
5 | requests_aws4auth
--------------------------------------------------------------------------------