Skip to content

Commit f2a67a8

Browse files
committed
2 parents 2fa363d + 7f6dc8e commit f2a67a8

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun Apple Accessory Arduino Library
2-
version=3.0.7.0
2+
version=3.0.7.1
33
author=SparkFun Electronics <[email protected]>
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=An Arduino library for SparkFun Apple Accessories

src/SparkFun_Apple_Accessory.h

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,39 @@ class SparkFunAppleAccessoryDriver
4242
*
4343
* @param latestGPGST Pointer to the latest GNSS NMEA GPGST message (optional)
4444
*
45-
* @note The pointers will be set the nullptr once the NMEA data has been consumed
45+
* @param latestGPVTG Pointer to the latest GNSS NMEA GPVTG message (optional)
46+
*
47+
* @note Each pointer points to NULL when the NMEA data has been consumed.
48+
*/
49+
void setNMEApointers(char *latestGPGGA, char *latestGPRMC, char *latestGPGST = nullptr, char *latestGPVTG = nullptr);
50+
51+
/**
52+
* @brief Set the pointer to the latest EA Session blob.
53+
* E.g. NMEA GSA and GSV - from external GNSS.
54+
*
55+
* @param latestEASessionData Pointer to the latest EA Session blob.
56+
*
57+
* @note The latestEASessionData is passed to the EA Session as-is, (up to)
58+
* 1000 bytes at a time.
59+
* If must contain CRLF delimiters.
60+
* It must be NULL-terminated as strlen is used to calculate the length.
61+
* The pointer will point to NULL when the data has been consumed.
62+
* Call latestEASessionDataIsBlocking before adding new data to
63+
* latestEASessionData. Do not modify latestEASessionData if
64+
* latestEASessionDataIsBlocking is true.
65+
*/
66+
void setEASessionPointer(char *latestEASessionData);
67+
68+
/**
69+
* @brief Check if the latestEASessionData is in use (blocking)
70+
*
71+
* @return Returns `true` when the latestEASessionData is being written
72+
* to the device, `false` otherwise.
73+
*
74+
* @note This is a poor man's semaphore. Super code threads / tasks should not update
75+
* the latestEASessionData while latestEASessionDataIsBlocking is true.
4676
*/
47-
void setNMEApointers(char *latestGPGGA, char *latestGPRMC, char *latestGPGST = nullptr);
77+
bool latestEASessionDataIsBlocking();
4878

4979
/**
5080
* @brief Enable debug prints on the selected Print stream
Binary file not shown.

src/src/SparkFun_iAP2.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ class SparkFuniAP2Driver
3535
void iap2LinkUpdate();
3636
void iap2TrafficUpdate();
3737
void startHandshake(Stream *theStream);
38-
void setNMEApointers(char *latestGPGGA, char *latestGPRMC, char *latestGPGST = nullptr);
38+
void setNMEApointers(char *latestGPGGA, char *latestGPRMC, char *latestGPGST = nullptr, char *latestGPVTG = nullptr);
39+
void setEASessionPointer(char *latestEASessionData);
40+
bool latestEASessionDataIsBlocking();
3941
void setAuthPointers(uint8_t *authCert, size_t certSize, char *authCertSerial);
4042
void setAuthCoprocessorPointer(SparkFunAuth3CPArdI2C *authCoprocessor);
4143
void setAccessoryName(const char *accessoryName);
@@ -125,6 +127,9 @@ class SparkFuniAP2Driver
125127
char *_latestGPGGA = nullptr; // Pointer to the latest NMEA GGA, provided by an external GNSS
126128
char *_latestGPRMC = nullptr; // Pointer to the latest NMEA RMC, provided by an external GNSS
127129
char *_latestGPGST = nullptr; // Pointer to the latest NMEA GST, provided by an external GNSS
130+
char *_latestGPVTG = nullptr; // Pointer to the latest NMEA VTG, provided by an external GNSS
131+
char *_latestEASessionData = nullptr; // Pointer to the latest ES Session NMEA GSA / GSV blob, provided by an external GNSS
132+
bool _latestEASessionDataIsBlocking = false; // Flag to indicate when EA Session Data is being written to the device
128133

129134
uint8_t *_authCert = nullptr; // Storage for the authentication certificate
130135
size_t _certSize = 0; // The size of the authentication certificate

0 commit comments

Comments
 (0)