engage-engine 1.232.90720005 → 1.234.90740001

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,8 @@
11
11
  #ifndef EngageAudioDevice_h
12
12
  #define EngageAudioDevice_h
13
13
 
14
+ #include <stdint.h>
15
+
14
16
 
15
17
  #ifdef __cplusplus
16
18
  extern "C"
@@ -8,6 +8,69 @@
8
8
 
9
9
  #include <stdint.h>
10
10
 
11
+ #if 1
12
+ #include <cstddef>
13
+ #include <cstdint>
14
+
15
+ #ifdef WIN32
16
+ #include <winsock2.h>
17
+ #include <windows.h>
18
+ #include <ws2tcpip.h>
19
+ #else
20
+ #include <netinet/in.h>
21
+ #endif
22
+
23
+ static const int ENGAGE_INVALID_IP_ADDRESS_FAMILY = -1;
24
+
25
+ static const size_t ENGAGE_MAX_RTP_OUTPUT_QUEUE_PACKETS = 100;
26
+
27
+ static const size_t ENGAGE_MAX_IP_ADDR_SIZE = sizeof(struct sockaddr_in6);
28
+ static const size_t ENGAGE_MAX_ALIAS_SIZE = 16;
29
+ static const size_t ENGAGE_MAX_NODE_ID_SIZE = 16;
30
+
31
+ static const size_t ENGAGE_BLOB_PACKET_BUFFER_ALLOCATION_EXTRA_BYTES = 512;
32
+
33
+ static const int16_t ENGAGE_PCM_MIN_VALUE = -32768;
34
+ static const int16_t ENGAGE_PCM_MAX_VALUE = 32767;
35
+
36
+ static const uint16_t ENGAGE_SELECT_FUNCTION_TIMEOUT_SECS = 1;
37
+ static const uint16_t ENGAGE_MULTICAST_REJOIN_SECS = 8;
38
+
39
+ static const size_t ENGAGE_MAX_DATAGRAM_SIZE = 4096;
40
+ static const long ENGAGE_MAX_RECONNECT_PAUSE_MS = 30000;
41
+ static const long ENGAGE_RECONNECT_FAILURE_PAUSE_INCREMENT_MS = 1500;
42
+
43
+ static const size_t ENGAGE_BASE_RTP_HEADER_SIZE = 12;
44
+ static const uint16_t ENGAGE_ACCEPTED_RTP_VERSION = 2;
45
+ static const size_t ENGAGE_MAX_RTP_SAMPLES_THAT_CAN_BE_DECODED = (8000 * 5);
46
+
47
+ static const size_t ENGAGE_PCM_SAMPLE_COUNT_PER_MS = 8;
48
+ static const size_t ENGAGE_PCM_10_MS_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 10);
49
+
50
+ #if defined(__APPLE__)
51
+ static const size_t ENGAGE_PCM_MIN_PLATFORM_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 40);
52
+ #elif defined(__ANDROID__)
53
+ static const size_t ENGAGE_PCM_MIN_PLATFORM_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 250);
54
+ #elif defined(__linux__)
55
+ static const size_t ENGAGE_PCM_MIN_PLATFORM_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 250);
56
+ #elif defined(WIN32)
57
+ static const size_t ENGAGE_PCM_MIN_PLATFORM_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 250);
58
+ #elif defined(__EMSCRIPTEN__)
59
+ static const size_t ENGAGE_PCM_MIN_PLATFORM_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 250);
60
+ #endif
61
+
62
+ static const long ENGAGE_TLS_CONNECTION_KEY_MATERIAL_SIZE = 32;
63
+ static const uint64_t ENGAGE_RTP_RESET_AFTER_IDLE_MS = (1000 * 30);
64
+
65
+ #if defined(RTS_DEBUG_BUILD)
66
+ static const uint64_t ENGAGE_GROUP_HEALTH_ERROR_ERROR_NOTIFICATION_INTERVAL_MS = (1000 * 10);
67
+ #else
68
+ static const uint64_t ENGAGE_GROUP_HEALTH_ERROR_ERROR_NOTIFICATION_INTERVAL_MS = (1000 * 30);
69
+ #endif
70
+
71
+ static const size_t ENGAGE_MAX_GROUPS_PER_BRIDGE = 128;
72
+ #endif
73
+
11
74
  /** @addtogroup resultCodes Engage Engine Result Codes
12
75
  *
13
76
  * Result codes are returned by calls to the API functions and most often are related to
@@ -37,6 +100,8 @@ static const int ENGAGE_RESULT_ALREADY_STARTED = -6;
37
100
  static const int ENGAGE_RESULT_INSUFFICIENT_DESTINATION_SPACE = -7;
38
101
  /** @brief Initialization of the crypto module failed */
39
102
  static const int ENGAGE_RESULT_CRYPTO_MODULE_INITIALIZATION_FAILED = -8;
103
+ /** @brief An application high resolution timer is already defined */
104
+ static const int ENGAGE_RESULT_HIGH_RES_TIMER_ALREADY_EXISTS = -9;
40
105
  /** @} */
41
106
 
42
107
 
@@ -13,6 +13,11 @@
13
13
  #define EngageInterface_h
14
14
 
15
15
  #include <stdint.h>
16
+
17
+ #if defined(__EMSCRIPTEN__)
18
+ #include <emscripten.h>
19
+ #endif
20
+
16
21
  #include "EngageConstants.h"
17
22
 
18
23
  #ifdef __cplusplus
@@ -20,6 +25,10 @@ extern "C"
20
25
  {
21
26
  #endif
22
27
 
28
+ #if defined(ENGAGE_ALLOW_NATIVE)
29
+ #include "ILogger.h"
30
+ #endif
31
+
23
32
  #if !defined(ENGAGE_API)
24
33
  #if defined(WIN32)
25
34
  #ifdef ENGAGE_EXPORTS
@@ -29,7 +38,11 @@ extern "C"
29
38
  #define ENGAGE_API extern
30
39
  #endif
31
40
  #else
32
- #define ENGAGE_API __attribute__ ((visibility ("default")))
41
+ #if defined(__EMSCRIPTEN__)
42
+ #define ENGAGE_API EMSCRIPTEN_KEEPALIVE __attribute__ ((visibility ("default")))
43
+ #else
44
+ #define ENGAGE_API __attribute__ ((visibility ("default")))
45
+ #endif
33
46
  #endif
34
47
  #endif
35
48
 
@@ -41,6 +54,9 @@ extern "C"
41
54
  /** @brief Prototype for logging callbacks */
42
55
  typedef void (*PFN_ENGAGE_LOG_HOOK)(int level, const char * _Nonnull tag, const char * _Nonnull message);
43
56
 
57
+ /** @brief Prototype for the high-resolution timer callback */
58
+ typedef void (*PFN_ENGAGE_HIGH_RES_TIMER_TICK)(uint32_t tickType, uint64_t ticksSoFar);
59
+
44
60
  // Structures (all packed on 1-byte boundaries)
45
61
  #pragma pack(push, 1)
46
62
 
@@ -273,6 +289,9 @@ typedef struct _EngageEvents_t
273
289
 
274
290
  /** @brief Fired when an audio recording has ended */
275
291
  void (* _Nullable PFN_ENGAGE_AUDIO_RECORDING_ENDED)(const char * _Nonnull pId, const char * _Nullable eventExtraJson);
292
+
293
+ /** @brief Fired whenever the previously-registered high-resolution timer interval ticks. 'tickType' is 1, 2, or 3 for pre-tick, tick, and post-tick respectively */
294
+ // void (* _Nullable PFN_ENGAGE_ON_HIGH_RESOLUTION_TIMER_TICK)(uint32_t tickType, uint32_t ticksSoFarLow, uint32_t ticksSoFarHigh, const char * _Nullable eventExtraJson);
276
295
  } EngageEvents_t;
277
296
  /** @} */
278
297
 
@@ -1240,9 +1259,23 @@ ENGAGE_API int engageSetMissionId(const char * _Nullable missionId);
1240
1259
 
1241
1260
 
1242
1261
  /**
1243
- * @brief [SYNC] Opens/creates a certificate store
1262
+ * @brief [SYNC] Creates a certificate store
1263
+ *
1264
+ * This function creates a certificate store and makes it the active certificate store used for the Engine.
1265
+ *
1266
+ * No events are generated by this API call.
1244
1267
  *
1245
- * This function opens (or creates) a certificate store and makes it the active certificate store used for the Engine. The function fails
1268
+ * @param fileName The full path to the file
1269
+ * @param passwordHexByteString Password as a hex byte string (if the file is to be password protected with an additional application password)
1270
+ * @return ENGAGE_RESULT_OK if the store was opened
1271
+ */
1272
+ ENGAGE_API int engageCreateCertStore(const char * _Nonnull fileName, const char * _Nullable passwordHexByteString);
1273
+
1274
+
1275
+ /**
1276
+ * @brief [SYNC] Opens a certificate store
1277
+ *
1278
+ * This function opensa certificate store and makes it the active certificate store used for the Engine. The function fails
1246
1279
  * if the file already exists and it cannot be opened due to file corruption, password mismatch, or invalid content.
1247
1280
  *
1248
1281
  * No events are generated by this API call.
@@ -1593,6 +1626,34 @@ ENGAGE_API int engageIsCryptoFipsValidated(void);
1593
1626
  */
1594
1627
  ENGAGE_API int engageSetCertStore(const uint8_t * _Nonnull buffer, size_t size, const char * _Nullable passwordHexByteString);
1595
1628
 
1629
+ /**
1630
+ * @brief [SYNC] Verifies a recorded RIFF file.
1631
+ *
1632
+ * This function verifies a signed, recorded RIFF file. It returns ENGAGE_RESULT_OK (0) on success.
1633
+ *
1634
+ * No events are generated by this API call.
1635
+ *
1636
+ * @param fn The path to the file.
1637
+ * @return ENGAGE_RESULT_OK if operation was successful.
1638
+ */
1639
+ ENGAGE_API int engageVerifyRiff(const char * _Nonnull fn);
1640
+
1641
+ /**
1642
+ * @brief [SYNC] Returns a descriptor for a RIFF file
1643
+ *
1644
+ * Call this function to obtain a JSON descriptor of the RIFF file.
1645
+ *
1646
+ * No events are generated by this API call.
1647
+ *
1648
+ * @param fn The path to the file.
1649
+ * @return Zero-terminated string representing a JSON object describing the RIFF file
1650
+ * <P>
1651
+ * Example: @include[doc] examples/RiffDescriptor.json
1652
+ * </P>
1653
+ */
1654
+
1655
+ ENGAGE_API const char * _Nonnull engageGetRiffDescriptor(const char * _Nonnull fn);
1656
+
1596
1657
  // TODO: Engage compression/decompression functions not available at this time
1597
1658
  #if 0
1598
1659
  /**
@@ -1635,6 +1696,46 @@ ENGAGE_API int engageCompress(const uint8_t * _Nonnull src, size_t srcSize, uint
1635
1696
  ENGAGE_API int engageDecompress(const uint8_t * _Nonnull src, size_t srcSize, uint8_t * _Nonnull dst, size_t maxDstSize);
1636
1697
  #endif
1637
1698
 
1699
+
1700
+ #if defined(ENGAGE_ALLOW_NATIVE)
1701
+ /**
1702
+ * @brief [SYNC] Returns a pointer to the library's internbal logger as an ILogger interface
1703
+ *
1704
+ * No events are generated by this API call.
1705
+ *
1706
+ * @return ILogger*
1707
+ */
1708
+ ENGAGE_API ILogger * _Nullable engageGetLoggerNative();
1709
+
1710
+ /**
1711
+ * @brief [SYNC] Registers for a high resolution (millisecond-precision) timer via direct native callback
1712
+ *
1713
+ * Creates an ongoing timer at millisecond resolution. Only a single high resolution
1714
+ * timer can exist at any one time.
1715
+ *
1716
+ * No events are generated by this API call.
1717
+ *
1718
+ * @param durationMs Milliseconds between intervals
1719
+ * @param pfnDirectCallback Pointer to the application callback function
1720
+ * @return ENGAGE_RESULT_OK on success, other values on failure
1721
+ * @see engageUnregisterFromHighResolutionTimerNative()
1722
+ */
1723
+ ENGAGE_API int engageRegisterForHighResolutionTimerNative(uint32_t durationMs, PFN_ENGAGE_HIGH_RES_TIMER_TICK _Nullable pfnDirectCallback);
1724
+
1725
+
1726
+ /**
1727
+ * @brief [SYNC] Unregisters the previously-registered native high-resolution timer if any.
1728
+ *
1729
+ * Unregisters the previously registered timer. If none exists no error occurs.
1730
+ *
1731
+ * No events are generated by this API call.
1732
+ *
1733
+ * @return ENGAGE_RESULT_OK on success, other values on failure
1734
+ * @see engageRegisterForHighResolutionTimerNative()
1735
+ */
1736
+ ENGAGE_API int engageUnregisterFromHighResolutionTimerNative(void);
1737
+ #endif
1738
+
1638
1739
  #endif
1639
1740
 
1640
1741
  #ifdef __cplusplus
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "engage-engine",
3
- "version": "1.232.90720005",
3
+ "version": "1.234.90740001",
4
4
  "description": "Use Engage to communicate with everyone, everywhere, from any device",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -23,6 +23,6 @@
23
23
  "dependencies": {
24
24
  "bindings": "^1.5.0",
25
25
  "nan": "^2.14.0",
26
- "node-gyp": "^7.1.2"
26
+ "node-gyp": "^9.0.3"
27
27
  }
28
28
  }