1/*
2 Usage
3 This example demonstrates how to use the SAMD SSU library to update a 
4 sketch on any Arduino MKR board via the storage on the SARA U-201 GSM module.
5 This sketch prints out the date and time the sketch was compiled.
6 Steps to update sketch:
7 1) Upload this sketch or another sketch that includes the SSU library
8    via #include <SSU.h>
9 2) Update the sketch as desired. For this example the sketch prints out
10    the compiled date and time so no updates are needed.
11 3) In the IDE select: Sketch -> Export compiled Binary
12 4) Open the location of the sketch and convert the .bin file to a C byte array.
13      cat SKETCH.bin | xxd --include > Binary.h
14 5) Copy Binary.h file from the sketch's folder to the SSU_LoadBinary sketch
15    and load it to the U-201 via SSU_LoadBinary sketch.
16*/
17
18/*
19 Include the SSU library
20 
21 This will add some code to the sketch before setup() is called
22 to check if UPDATE.BIN and UPDATE.OK are present on the storage of
23 the U-201 module. If this theck is positive UPDATE.BIN is used to update
24 the sketch running on the board.
25 After this UPDATE.BIN and UPDATE.OK are deleted from the flash.
26*/
27
28
29#include <SSU.h>
30
31void setup()
32{
33  Serial.begin(9600);
34  while (!Serial) { }
35  // wait a bit
36  delay(1000);
37  String message;
38  message += "Sketch compile date and time: ";
39  message += __DATE__;
40  message += " ";
41  message += __TIME__;
42  // print out the sketch compile date and time on the serial port
43  Serial.println(message);
44}
45
46void loop()
47{
48  // add you own code here
49}