an iCal processing library

Revision:
5:69577415c16e
Parent:
4:a1c25d936346
Child:
8:87549cc99d5e
--- a/iCal.h	Sun Jun 08 01:35:37 2014 +0000
+++ b/iCal.h	Sun Jun 22 20:52:26 2014 +0000
@@ -2,10 +2,12 @@
 #define ICAL_H
 #include "mbed.h"
 
-//#include "NTPClient.h"
-
 // This defines the total number of events that can be handled - kind of limiting
-// but maybe ok for now.
+// but maybe ok for now. This is a kind of trade-off, based on having to receive
+// the whole iCal file into a buffer, and that not leaving a lot left over for
+// events themselves. Instead, the receive process should do more "on the fly"
+// with a then smaller buffer, leaving room for many more events. Possibly too,
+// the events could be quickly rejected if not matching the criteria.
 #define EVENT_COUNT 10
 
 
@@ -40,6 +42,9 @@
 } RepeatDays_t;
 #endif
 
+typedef int32_t tz_sec_t;
+typedef int16_t tz_min_t;
+
 typedef struct {
     time_t Start;
     time_t End;
@@ -70,11 +75,11 @@
 /// @param[in] pStart is a pointer to the start of the stream.
 /// @param[in] gridStartTime is a time value representing the start of the time-window of interest.
 /// @param[in] gridEndTime is a time value representing the end of the time-window of interest.
-/// @param[in] tzoSec is the time-zone offset in seconds.
+/// @param[in] tzoMin is the time-zone offset in minutes.
 /// @param[in] showEvents when true causes it to print the events as parsed.
 /// @returns number of events in range.
 ///
-int ParseICalStream(char * pStart, time_t gridStartTime, time_t gridEndTime, int32_t tzoSec, bool showEvents = false);
+int ParseICalStream(char * pStart, time_t gridStartTime, time_t gridEndTime, tz_min_t tzoMin, bool showEvents = false);
 
 
 /// Get the number of events that have been cached.
@@ -177,7 +182,7 @@
 /// @param[in] tzoSec is the time-zone offset in seconds.
 /// @returns time_t value.
 ///
-time_t ParseDateStamp(char * string, int32_t tzoSec);
+time_t ParseDateStamp(char * string, tz_sec_t tzoSec);
 
 /// Parse a Time Zone ID value from the front-end of a Datestamp
 ///
@@ -189,7 +194,7 @@
 /// @param[in] string to be parsed.
 /// @returns time zone offset in seconds.
 ///
-int32_t ParseTZID(char * string);
+tz_sec_t ParseTZID(char * string);