18 #region Interfaces and such
23 public bool isEncrypted;
24 public bool allowsFullDuplex;
29 void onEngineStarted(
string eventExtraJson);
30 void onEngineStopped(
string eventExtraJson);
31 void onEngineAudioDevicesRefreshed(
string eventExtraJson);
32 void onEngineGroupByGroupPcmPowerLevels(
string eventExtraJson);
33 void onEngineAudioDevicesEvent(
string eventExtraJson);
38 void onLicenseChanged(
string eventExtraJson);
39 void onLicenseExpired(
string eventExtraJson);
40 void onLicenseExpiring(
double secondsLeft,
string eventExtraJson);
45 void onEngageLogMessage(
int level,
string tag,
string message);
50 void onRallypointPausingConnectionAttempt(
string id,
string eventExtraJson);
51 void onRallypointConnecting(
string id,
string eventExtraJson);
52 void onRallypointConnected(
string id,
string eventExtraJson);
53 void onRallypointDisconnected(
string id,
string eventExtraJson);
54 void onRallypointRoundtripReport(
string id,
int rtMs,
int rtRating,
string eventExtraJson);
59 void onGroupCreated(
string id,
string eventExtraJson);
60 void onGroupCreateFailed(
string id,
string eventExtraJson);
61 void onGroupDeleted(
string id,
string eventExtraJson);
62 void onGroupConnected(
string id,
string eventExtraJson);
63 void onGroupConnectFailed(
string id,
string eventExtraJson);
64 void onGroupDisconnected(
string id,
string eventExtraJson);
65 void onGroupJoined(
string id,
string eventExtraJson);
66 void onGroupJoinFailed(
string id,
string eventExtraJson);
67 void onGroupLeft(
string id,
string eventExtraJson);
68 void onGroupMemberCountChanged(
string id,
int newCount,
string eventExtraJson);
69 void onGroupRxStarted(
string id,
string eventExtraJson);
70 void onGroupRxEnded(
string id,
string eventExtraJson);
71 void onGroupRxMuted(
string id,
string eventExtraJson);
72 void onGroupRxUnmuted(
string id,
string eventExtraJson);
73 void onGroupTxMuted(
string id,
string eventExtraJson);
74 void onGroupTxUnmuted(
string id,
string eventExtraJson);
75 void onGroupRxSpeakersChanged(
string id,
string groupTalkerJson,
string eventExtraJson);
76 void onGroupTxStarted(
string id,
string eventExtraJson);
77 void onGroupTxEnded(
string id,
string eventExtraJson);
78 void onGroupTxFailed(
string id,
string eventExtraJson);
79 void onGroupTxUsurpedByPriority(
string id,
string eventExtraJson);
80 void onGroupMaxTxTimeExceeded(
string id,
string eventExtraJson);
81 void onGroupNodeDiscovered(
string id,
string nodeJson,
string eventExtraJson);
82 void onGroupNodeRediscovered(
string id,
string nodeJson,
string eventExtraJson);
83 void onGroupNodeUndiscovered(
string id,
string nodeJson,
string eventExtraJson);
84 void onGroupAssetDiscovered(
string id,
string nodeJson,
string eventExtraJson);
85 void onGroupAssetRediscovered(
string id,
string nodeJson,
string eventExtraJson);
86 void onGroupAssetUndiscovered(
string id,
string nodeJson,
string eventExtraJson);
87 void onGroupBlobSent(
string id,
string eventExtraJson);
88 void onGroupBlobSendFailed(
string id,
string eventExtraJson);
89 void onGroupBlobReceived(
string id,
string blobInfoJson,
byte[] blob,
int blobSize,
string eventExtraJson);
90 void onGroupRtpSent(
string id,
string eventExtraJson);
91 void onGroupRtpSendFailed(
string id,
string eventExtraJson);
92 void onGroupRtpReceived(
string id,
string rtpInfoJson,
byte[] payload,
int payloadSize,
string eventExtraJson);
93 void onGroupRawSent(
string id,
string eventExtraJson);
94 void onGroupRawSendFailed(
string id,
string eventExtraJson);
95 void onGroupRawReceived(
string id,
byte[] raw,
int rawSize,
string eventExtraJson);
97 void onGroupTimelineEventStarted(
string id,
string eventJson,
string eventExtraJson);
98 void onGroupTimelineEventUpdated(
string id,
string eventJson,
string eventExtraJson);
99 void onGroupTimelineEventEnded(
string id,
string eventJson,
string eventExtraJson);
100 void onGroupTimelineReport(
string id,
string reportJson,
string eventExtraJson);
101 void onGroupTimelineReportFailed(
string id,
string eventExtraJson);
102 void onGroupTimelineGroomed(
string id,
string eventListJson,
string eventExtraJson);
104 void onGroupHealthReport(
string id,
string healthReportJson,
string eventExtraJson);
105 void onGroupHealthReportFailed(
string id,
string eventExtraJson);
107 void onGroupStatsReport(
string id,
string statsReportJson,
string eventExtraJson);
108 void onGroupStatsReportFailed(
string id,
string eventExtraJson);
110 void onGroupRxVolumeChanged(
string id,
int leftLevelPerc,
int rightLevelPerc,
string eventExtraJson);
111 void onGroupRxDtmf(
string id,
string dtmfJson,
string eventExtraJson);
113 void onGroupReconfigured(
string id,
string eventExtraJson);
114 void onGroupReconfigurationFailed(
string id,
string eventExtraJson);
116 void onGroupAudioRecordingStarted(
string id,
string eventExtraJson);
117 void onGroupAudioRecordingFailed(
string id,
string eventExtraJson);
118 void onGroupAudioRecordingEnded(
string id,
string eventExtraJson);
123 void onHumanBiometricsReceived(
string groupId,
string nodeId,
string hbmJson,
string eventExtraJson);
128 void onBridgeCreated(
string id,
string eventExtraJson);
129 void onBridgeCreateFailed(
string id,
string eventExtraJson);
130 void onBridgeDeleted(
string id,
string eventExtraJson);
135 void onAudioRecordingStarted(
string id,
string eventExtraJson);
136 void onAudioRecordingFailed(
string id,
string eventExtraJson);
137 void onAudioRecordingEnded(
string id,
string eventExtraJson);
143 private const string ENGAGE_DLL =
"engage-shared.dll";
146 public const int ENGAGE_MAX_GROUP_ID_SZ = 64;
147 public const int ENGAGE_MAX_GROUP_NAME_SZ = 128;
150 public const int ENGAGE_RESULT_OK = 0;
151 public const int ENGAGE_RESULT_INVALID_PARAMETERS = -1;
152 public const int ENGAGE_RESULT_NOT_INITIALIZED = -2;
153 public const int ENGAGE_RESULT_ALREADY_INITIALIZED = -3;
154 public const int ENGAGE_RESULT_GENERAL_FAILURE = -4;
155 public const int ENGAGE_RESULT_NOT_STARTED = -5;
156 public const int ENGAGE_RESULT_ALREADY_STARTED = -6;
157 public const int ENGAGE_RESULT_INSUFFICIENT_DESTINATION_SPACE = -7;
158 public const int ENGAGE_RESULT_CRYPTO_MODULE_INITIALIZATION_FAILURE = -8;
159 public const int ENGAGE_RESULT_HIGH_RES_TIMER_ALREADY_EXISTS = -9;
162 public enum JitterBufferLatency :
int
169 public enum ConnectionType :
int
177 public enum TxStatus :
int
182 ERR_NOT_AN_AUDIO_GROUP = -1,
184 ERR_NOT_CONNECTED = -3,
185 ERR_ALREADY_TRANSMITTING = -4,
186 ERR_INVALID_PARAMS = -5,
187 ERR_PRIORITY_TOO_LOW = -6,
188 ERR_RX_ACTIVE_ON_NON_FDX = -7,
189 ERR_CANNOT_SUBSCRIBE_TO_MIC = -8,
191 ERR_TX_ENDED_WITH_FAILURE = -10,
192 ERR_OTHERS_ACTIVE = -11
196 public enum LicensingStatusCode :
int
199 ERR_NULL_ENTITLEMENT_KEY = -1,
200 ERR_NULL_LICENSE_KEY = -2,
201 ERR_INVALID_LICENSE_KEY_LEN = -3,
202 ERR_LICENSE_KEY_VERIFICATION_FAILURE = -4,
203 ERR_ACTIVATION_CODE_VERIFICATION_FAILURE = -5,
204 ERR_INVALID_EXPIRATION_DATE = -6,
205 ERR_GENERAL_FAILURE = -7,
206 ERR_NOT_INITIALIZED = -8,
207 ERR_REQUIRES_ACTIVATION = -9,
208 ERR_LICENSE_NOT_SUITED_FOR_ACTIVATION = -10
212 public enum LoggingLevel :
int
222 public const byte ENGAGE_BLOB_PT_UNDEFINED = 0;
223 public const byte ENGAGE_BLOB_PT_APP_TEXT_UTF8 = 1;
224 public const byte ENGAGE_BLOB_PT_JSON_TEXT_UTF8 = 2;
225 public const byte ENGAGE_BLOB_PT_APP_BINARY = 3;
226 public const byte ENGAGE_BLOB_PT_ENGAGE_BINARY_HUMAN_BIOMETRICS = 4;
229 public const byte ENGAGE_HBM_HEART_RATE = 1;
230 public const byte ENGAGE_HBM_SKIN_TEMP = 2;
231 public const byte ENGAGE_HBM_CORE_TEMP = 3;
232 public const byte ENGAGE_HBM_HYDRATION = 4;
233 public const byte ENGAGE_HBM_BLOOD_OXYGENATION = 5;
234 public const byte ENGAGE_HBM_FATIGUE_LEVEL = 6;
235 public const byte ENGAGE_HBM_TASK_EFFECTIVENESS = 7;
238 public const String GROUP_SOURCE_ENGAGE_INTERNAL =
"com.rallytac.engage.internal";
239 public const String GROUP_SOURCE_ENGAGE_MAGELLAN_CORE =
"com.rallytac.magellan.core";
240 public const String GROUP_SOURCE_ENGAGE_MAGELLAN_CISTECH =
"com.rallytac.engage.magellan.cistech";
241 public const String GROUP_SOURCE_ENGAGE_MAGELLAN_TRELLISWARE =
"com.rallytac.engage.magellan.trellisware";
242 public const String GROUP_SOURCE_ENGAGE_MAGELLAN_SILVUS =
"com.rallytac.engage.magellan.silvus";
243 public const String GROUP_SOURCE_ENGAGE_MAGELLAN_PERSISTENT =
"com.rallytac.engage.magellan.persistent";
244 public const String GROUP_SOURCE_ENGAGE_MAGELLAN_DOMO =
"com.rallytac.engage.magellan.domo";
245 public const String GROUP_SOURCE_ENGAGE_MAGELLAN_KENWOOD =
"com.rallytac.engage.magellan.kenwood";
246 public const String GROUP_SOURCE_ENGAGE_MAGELLAN_TAIT =
"com.rallytac.engage.magellan.tait";
247 public const String GROUP_SOURCE_ENGAGE_MAGELLAN_VOCALITY=
"com.rallytac.engage.magellan.vocality";
250 public const String GROUP_DISCONNECTED_REASON_NO_REAON =
"NoReason";
251 public const String GROUP_DISCONNECTED_REASON_NO_LINK =
"NoLink";
252 public const String GROUP_DISCONNECTED_REASON_UNREGISTERED =
"Unregistered";
253 public const String GROUP_DISCONNECTED_REASON_NOT_ALLOWED =
"NotAllowed";
254 public const String GROUP_DISCONNECTED_REASON_GENERAL_DENIAL =
"GeneralDenial";
257 public const int ENGAGE_PDGI_FLAG_JOINED = 0x0001;
258 public const int ENGAGE_PDGI_FLAG_CONNECTED = 0x0002;
259 public const int ENGAGE_PDGI_FLAG_RX_MUTED = 0x0004;
260 public const int ENGAGE_PDGI_FLAG_TX_MUTED = 0x0008;
263 public enum NetworkTxPriority :
int
275 public static String objectName =
"fipsCrypto";
276 public static String enabled =
"enabled";
277 public static String path =
"path";
282 public static String objectName =
"tls";
283 public static String verifyPeers =
"verifyPeers";
284 public static String allowSelfSignedCertificates =
"allowSelfSignedCertificates";
285 public static String caCertificates =
"caCertificates";
286 public static String subjectRestrictions =
"subjectRestrictions";
287 public static String issuerRestrictions =
"issuerRestrictions";
292 public static String objectName =
"watchdog";
293 public static String enabled =
"enabled";
294 public static String intervalMs =
"intervalMs";
295 public static String hangDetectionMs =
"hangDetectionMs";
296 public static String abortOnHang =
"abortOnHang";
297 public static String slowExecutionThresholdMs =
"slowExecutionThresholdMs";
302 public static String objectName =
"groupCreationDetail";
303 public static String
id =
"id";
304 public static String status =
"status";
309 public static String objectName =
"groupTxDetail";
310 public static String
id =
"id";
311 public static String status =
"status";
312 public static String localPriority =
"localPriority";
313 public static String remotePriority =
"remotePriority";
314 public static String nonFdxMsHangRemaining =
"nonFdxMsHangRemaining";
319 public static String objectName =
"rallypointConnectionDetail";
320 public static String internalId =
"internalId";
321 public static String host =
"host";
322 public static String port =
"port";
323 public static String msToNextConnectionAttempt =
"msToNextConnectionAttempt";
328 public static String objectName =
"groupConnectionDetail";
329 public static String
id =
"id";
330 public static String connectionType =
"connectionType";
331 public static String peer =
"peer";
332 public static String asFailover =
"asFailover";
333 public static String reason =
"reason";
338 public static String objectName =
"certStoreCertificateElement";
339 public static String arrayName =
"certificates";
340 public static String
id =
"id";
341 public static String hasPrivateKey =
"hasPrivateKey";
342 public static String tags =
"tags";
347 public static String objectName =
"certStoreDescriptor";
348 public static String
id =
"id";
349 public static String fileName =
"fileName";
350 public static String version =
"version";
351 public static String flags =
"flags";
352 public static String certificates =
"certificates";
357 public static String objectName =
"list";
362 public static String objectName =
"audioDevice";
363 public static String deviceId =
"deviceId";
364 public static String samplingRate =
"samplingRate";
365 public static String msPerBuffer =
"msPerBuffer";
366 public static String bufferCount =
"bufferCount";
367 public static String channels =
"channels";
368 public static String direction =
"direction";
369 public static String boostPercentage =
"boostPercentage";
370 public static String isAdad =
"isAdad";
371 public static String name =
"name";
372 public static String manufacturer =
"manufacturer";
373 public static String model =
"model";
374 public static String hardwareId =
"hardwareId";
375 public static String serialNumber =
"serialNumber";
376 public static String isDefault =
"isDefault";
377 public static String extra =
"extra";
378 public static String type =
"type";
379 public static String isPresent =
"isPresent";
384 public static String objectName =
"list";
389 public static String objectName =
"networkInterfaceDevice";
390 public static String name =
"name";
391 public static String friendlyName =
"friendlyName";
392 public static String description =
"description";
393 public static String family =
"family";
394 public static String address =
"address";
395 public static String available =
"available";
396 public static String isLoopback =
"isLoopback";
397 public static String supportsMulticast =
"supportsMulticast";
398 public static String hardwareAddress =
"hardwareAddress";
403 public static String objectName =
"advancedTxParams";
404 public static String flags =
"flags";
405 public static String priority =
"priority";
406 public static String subchannelTag =
"subchannelTag";
407 public static String includeNodeId =
"includeNodeId";
408 public static String alias =
"alias";
409 public static String muted =
"muted";
410 public static String txId =
"txId";
411 public static String aliasSpecializer =
"aliasSpecializer";
412 public static String receiverRxMuteForAliasSpecializer =
"receiverRxMuteForAliasSpecializer";
416 public static String objectName =
"audioUri";
417 public static String uri =
"uri";
418 public static String repeatCount =
"repeatCount";
424 public static String objectName =
"license";
425 public static String entitlement =
"entitlement";
426 public static String key =
"key";
427 public static String activationCode =
"activationCode";
428 public static String deviceId =
"deviceId";
429 public static String type =
"type";
430 public static String expires =
"expires";
431 public static String expiresFormatted =
"expiresFormatted";
432 public static String manufacturerId =
"manufacturerId";
437 public static String objectName =
"talkerInformation";
438 public static String alias =
"alias";
439 public static String nodeId =
"nodeId";
440 public static String rxFlags =
"rxFlags";
441 public static String txPriority =
"txPriority";
442 public static String txId =
"txId";
443 public static String aliasSpecializer =
"aliasSpecializer";
444 public static String rxMuted =
"rxMuted";
449 public static String objectName =
"GroupTalkers";
450 public static String list =
"list";
457 public static String objectName =
"database";
458 public static String enabled =
"enabled";
459 public static String type =
"type";
460 public static String fixedFileName =
"fixedFileName";
465 public static String objectName =
"internals";
466 public static String housekeeperIntervalMs =
"housekeeperIntervalMs";
467 public static String logTaskQueueStatsIntervalMs =
"logTaskQueueStatsIntervalMs";
468 public static String maxTxSecs =
"maxTxSecs";
469 public static String maxRxSecs =
"maxRxSecs";
470 public static String enableLazySpeakerClosure =
"enableLazySpeakerClosure";
471 public static String rtpExpirationCheckIntervalMs =
"rtpExpirationCheckIntervalMs";
472 public static String delayedMicrophoneClosureSecs =
"delayedMicrophoneClosureSecs";
477 public static String objectName =
"timelines";
478 public static String enabled =
"enabled";
479 public static String maxEventAgeSecs =
"maxEventAgeSecs";
480 public static String storageRoot =
"storageRoot";
481 public static String maxStorageMb =
"maxStorageMb";
482 public static String maxMemMb =
"maxMemMb";
483 public static String maxAudioEventMemMb =
"maxAudioEventMemMb";
484 public static String maxDiskMb =
"maxDiskMb";
485 public static String maxEvents =
"maxEvents";
486 public static String groomingIntervalSecs =
"groomingIntervalSecs";
487 public static String autosaveIntervalSecs =
"autosaveIntervalSecs";
488 public static String disableSigningAndVerification =
"disableSigningAndVerification";
489 public static String ephemeral =
"ephemeral";
494 public static String objectName =
"security";
499 public static String objectName =
"certificate";
500 public static String certificate =
"certificate";
501 public static String key =
"key";
506 public static String objectName =
"licensing";
507 public static String entitlement =
"entitlement";
508 public static String key =
"key";
509 public static String activationCode =
"activationCode";
510 public static String manufacturerId =
"manufacturerId";
515 public static String objectName =
"networking";
516 public static String defaultNic =
"defaultNic";
517 public static String maxOutputQueuePackets =
"maxOutputQueuePackets";
518 public static String rtpJitterMinMs =
"rtpJitterMinMs";
519 public static String rtpJitterMaxFactor =
"rtpJitterMaxFactor";
520 public static String rtpJitterMaxMs =
"rtpJitterMaxMs";
521 public static String rtpLatePacketSequenceRange =
"rtpLatePacketSequenceRange";
522 public static String rtpJitterTrimPercentage =
"rtpJitterTrimPercentage";
523 public static String rtpJitterUnderrunReductionThresholdMs =
"rtpJitterUnderrunReductionThresholdMs";
524 public static String rtpJitterUnderrunReductionAger =
"rtpJitterUnderrunReductionAger";
525 public static String rtpJitterForceTrimAtMs =
"rtpJitterForceTrimAtMs";
526 public static String rtpLatePacketTimestampRangeMs =
"rtpLatePacketTimestampRangeMs";
527 public static String rtpInboundProcessorInactivityMs =
"rtpInboundProcessorInactivityMs";
528 public static String multicastRejoinSecs =
"multicastRejoinSecs";
529 public static String rpLeafConnectTimeoutSecs =
"rpLeafConnectTimeoutSecs";
530 public static String maxReconnectPauseMs =
"maxReconnectPauseMs";
531 public static String reconnectFailurePauseIncrementMs =
"reconnectFailurePauseIncrementMs";
532 public static String sendFailurePauseMs =
"sendFailurePauseMs";
533 public static String rallypointRtTestIntervalMs =
"rallypointRtTestIntervalMs";
534 public static String logRtpJitterBufferStats =
"logRtpJitterBufferStats";
535 public static String preventMulticastFailover =
"preventMulticastFailover";
536 public static String rtcpPresenceTimeoutMs =
"rtcpPresenceTimeoutMs";
537 public static String rtpJtterLatencyMode =
"rtpJtterLatencyMode";
538 public static String rtpJitterMaxExceededClipPerc =
"rtpJitterMaxExceededClipPerc";
539 public static String rtpJitterMaxExceededClipHangMs =
"rtpJitterMaxExceededClipHangMs";
540 public static String rtpZombieLifetimeMs =
"rtpZombieLifetimeMs";
541 public static String rtpMaxTrimMs =
"rtpMaxTrimMs";
546 public static String objectName =
"audio";
547 public static String enabled =
"enabled";
548 public static String internalRate =
"internalRate";
549 public static String internalChannels =
"internalChannels";
550 public static String allowOutputOnTransmit =
"allowOutputOnTransmit";
551 public static String muteTxOnTx =
"muteTxOnTx";
552 public static String denoiseInput =
"denoiseInput";
553 public static String denoiseOutput =
"denoiseOutput";
554 public static String saveInputPcm =
"saveInputPcm";
555 public static String saveOutputPcm =
"saveOutputPcm";
559 public static String objectName =
"aec";
560 public static String enabled =
"enabled";
561 public static String mode =
"mode";
562 public static String speakerTailMs =
"speakerTailMs";
563 public static String cng =
"cng";
568 public static String objectName =
"vad";
569 public static String enabled =
"enabled";
570 public static String mode =
"mode";
575 public static String objectName =
"android";
576 public static String api =
"api";
581 public static String objectName =
"inputAgc";
582 public static String enabled =
"enabled";
583 public static String minLevel =
"minLevel";
584 public static String maxLevel =
"maxLevel";
585 public static String compressionGainDb =
"compressionGainDb";
586 public static String enableLimiter =
"enableLimiter";
587 public static String targetLevelDb =
"targetLevelDb";
592 public static String objectName =
"outputAgc";
593 public static String enabled =
"enabled";
594 public static String minLevel =
"minLevel";
595 public static String maxLevel =
"maxLevel";
596 public static String compressionGainDb =
"compressionGainDb";
597 public static String enableLimiter =
"enableLimiter";
598 public static String targetLevelDb =
"targetLevelDb";
604 public static String objectName =
"discovery";
608 public static String objectName =
"magellan";
609 public static String enabled =
"enabled";
614 public static String objectName =
"ssdp";
615 public static String enabled =
"enabled";
616 public static String ageTimeoutMs =
"ageTimeoutMs";
617 public static String address =
"address";
622 public static String objectName =
"cistech";
623 public static String enabled =
"enabled";
624 public static String ageTimeoutMs =
"ageTimeoutMs";
625 public static String address =
"address";
630 public static String objectName =
"trellisware";
631 public static String enabled =
"enabled";
635 public static String dataDirectory =
"dataDirectory";
640 public static String
id =
"id";
641 public static String name =
"name";
642 public static String description =
"description";
643 public static String modPin =
"modPin";
644 public static String certStoreId =
"certStoreId";
645 public static String multicastFailoverPolicy =
"multicastFailoverPolicy";
650 public static String objectName =
"rallypoint";
651 public static String arrayName =
"rallypoints";
655 public static String objectName =
"host";
656 public static String address =
"address";
657 public static String port =
"port";
660 public static String certificate =
"certificate";
661 public static String certificateKey =
"certificateKey";
662 public static String verifyPeer =
"verifyPeer";
663 public static String allowSelfSignedCertificate =
"allowSelfSignedCertificate";
664 public static String transactionTimeoutMs =
"transactionTimeoutMs";
665 public static String connectionTimeoutSecs =
"connectionTimeoutSecs";
666 public static String disableMessageSigning =
"disableMessageSigning";
667 public static String use =
"use";
672 public static String objectName =
"address";
673 public static String address =
"address";
674 public static String port =
"port";
679 public static String objectName =
"rx";
680 public static String address =
"address";
681 public static String port =
"port";
686 public static String objectName =
"tx";
687 public static String address =
"address";
688 public static String port =
"port";
693 public static String objectName =
"rangerPackets";
694 public static String hangTimerSecs =
"hangTimerSecs";
695 public static String count =
"count";
700 public static String objectName =
"rtpProfile";
701 public static String mode =
"mode";
702 public static String jitterMaxMs =
"jitterMaxMs";
703 public static String jitterMinMs =
"jitterMinMs";
704 public static String jitterMaxFactor =
"jitterMaxFactor";
705 public static String latePacketSequenceRange =
"latePacketSequenceRange";
706 public static String latePacketTimestampRangeMs =
"latePacketTimestampRangeMs";
707 public static String jitterTrimPercentage =
"jitterTrimPercentage";
708 public static String jitterUnderrunReductionThresholdMs =
"jitterUnderrunReductionThresholdMs";
709 public static String jitterUnderrunReductionAger =
"jitterUnderrunReductionAger";
710 public static String jitterForceTrimAtMs =
"jitterForceTrimAtMs";
711 public static String jitterMaxTrimMs =
"jitterMaxTrimMs";
712 public static String jitterMaxExceededClipPerc =
"jitterMaxExceededClipPerc";
713 public static String jitterMaxExceededClipHangMs =
"jitterMaxExceededClipHangMs";
714 public static String inboundProcessorInactivityMs =
"inboundProcessorInactivityMs";
715 public static String rtcpPresenceTimeoutMs =
"rtcpPresenceTimeoutMs";
716 public static String zombieLifetimeMs =
"zombieLifetimeMs";
717 public static String signalledInboundProcessorInactivityMs =
"signalledInboundProcessorInactivityMs";
722 public static String objectName =
"group";
723 public static String arrayName =
"groups";
724 public static String
id =
"id";
725 public static String name =
"name";
726 public static String spokenName =
"spokenName";
727 public static String type =
"type";
728 public static String source =
"source";
729 public static String cryptoPassword =
"cryptoPassword";
730 public static String alias =
"alias";
731 public static String maxRxSecs =
"maxRxSecs";
732 public static String enableMulticastFailover =
"enableMulticastFailover";
733 public static String multicastFailoverSecs =
"multicastFailoverSecs";
734 public static String interfaceName =
"interfaceName";
735 public static String anonymousAlias =
"anonymousAlias";
736 public static String lbCrypto =
"lbCrypto";
737 public static String rtpProfile =
"rtpProfile";
738 public static String specializerAffinities =
"specializerAffinities";
739 public static String languageCode =
"languageCode";
743 public static String objectName =
"timeline";
744 public static String enabled =
"enabled";
749 public static String objectName =
"audio";
750 public static String inputId =
"inputId";
751 public static String outputId =
"outputId";
756 public static String objectName =
"priorityTranslation";
757 public static String priority =
"priority";
758 public static String rx =
"rx";
759 public static String tx =
"tx";
765 public static String objectName =
"txAudio";
766 public static String fdx =
"fdx";
767 public static String encoder =
"encoder";
768 public static String framingMs =
"framingMs";
769 public static String maxTxSecs =
"maxTxSecs";
770 public static String noHdrExt =
"noHdrExt";
771 public static String customRtpPayloadType =
"customRtpPayloadType";
772 public static String encoderName =
"encoderName";
773 public static String extensionSendInterval =
"extensionSendInterval";
774 public static String initialHeaderBurst =
"initialHeaderBurst";
775 public static String trailingHeaderBurst =
"initialHeaderBurst";
776 public static String enableSmoothing =
"enableSmoothing";
777 public static String dtx =
"dtx";
778 public static String smoothedHangTimeMs =
"smoothedHangTimeMs";
779 public static String resetRtpOnTx =
"resetRtpOnTx";
780 public static String startTxNotifications =
"startTxNotifications";
785 public static String objectName =
"txOptions";
786 public static String priority =
"priority";
787 public static String ttl =
"ttl";
792 public static String objectName =
"presence";
793 public static String format =
"format";
794 public static String intervalSecs =
"intervalSecs";
795 public static String listenOnly =
"listenOnly";
796 public static String minIntervalSecs =
"minIntervalSecs";
801 public static String objectName =
"presence";
802 public static String
self =
"self";
803 public static String comment =
"comment";
804 public static String custom =
"custom";
808 public static String arrayName =
"groupAliases";
809 public static String
id =
"groupId";
810 public static String alias =
"alias";
811 public static String status =
"status";
817 public static String objectName =
"identity";
818 public static String nodeId =
"nodeId";
819 public static String userId =
"userId";
820 public static String displayName =
"displayName";
821 public static String type =
"type";
822 public static String format =
"format";
823 public static String avatar =
"avatar";
828 public static String objectName =
"location";
829 public static String longitude =
"longitude";
830 public static String latitude =
"latitude";
831 public static String altitude =
"altitude";
832 public static String direction =
"direction";
833 public static String speed =
"speed";
838 public static String objectName =
"connectivity";
839 public static String type =
"type";
840 public static String strength =
"strength";
841 public static String rating =
"rating";
846 public static String objectName =
"power";
847 public static String source =
"source";
848 public static String state =
"state";
849 public static String level =
"level";
854 public static String objectName =
"rtpHeader";
855 public static String pt =
"pt";
856 public static String marker =
"marker";
857 public static String seq =
"seq";
858 public static String ssrc =
"ssrc";
859 public static String ts =
"ts";
864 public static String objectName =
"blobHeader";
865 public static String source =
"source";
866 public static String target =
"target";
867 public static String payloadType =
"payloadType";
868 public static String blobSize =
"size";
869 public static String rtpHeader =
"rtpHeader";
874 public static String objectName =
"descriptor";
875 public static String file =
"file";
876 public static String verified =
"verified";
877 public static String channels =
"channels";
878 public static String sampleCount =
"sampleCount";
879 public static String meta =
"meta";
880 public static String certificate =
"certificate";
881 public static String signature =
"signature";
888 public static String objectName =
"audio";
889 public static String ms =
"ms";
890 public static String samples =
"samples";
893 public static String objectName =
"event";
894 public static String alias =
"alias";
895 public static String direction =
"direction";
896 public static String ended =
"ended";
897 public static String groupId =
"groupId";
898 public static String
id =
"id";
899 public static String inProgress =
"inProgress";
900 public static String nodeId =
"nodeId";
901 public static String started =
"started";
902 public static String thisNodeId =
"thisNodeId";
903 public static String type =
"type";
904 public static String uri =
"uri";
905 public static String jsonAttachment =
"jsonAttachment";
906 public static String blobAttachment =
"blobAttachment";
911 public static String maxCount =
"maxCount";
912 public static String mostRecentFirst =
"mostRecentFirst";
913 public static String startedOnOrAfter =
"startedOnOrAfter";
914 public static String endedOnOrBefore =
"endedOnOrBefore";
915 public static String onlyDirection =
"onlyDirection";
916 public static String onlyType =
"onlyType";
917 public static String onlyCommitted =
"onlyCommitted";
918 public static String onlyAlias =
"onlyAlias";
919 public static String onlyNodeId =
"onlyNodeId";
920 public static String onlyTxId =
"onlyTxId";
921 public static String sql =
"sql";
926 public static String success =
"success";
927 public static String errorMessage =
"errorMessage";
928 public static String started =
"started";
929 public static String ended =
"ended";
930 public static String execMs =
"execMs";
931 public static String records =
"records";
932 public static String events =
"events";
933 public static String count =
"count";
937 #region Callback delegate types
938 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
939 private delegate
void EngageVoidCallback(
string eventExtraJson);
941 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
942 private delegate
void EngageStringCallback(
string s,
string eventExtraJson);
944 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
945 private delegate
void EngageString2Callback(
string s1,
string s2,
string eventExtraJson);
947 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
948 private delegate
void EngageStringAndIntCallback(
string s,
int i,
string eventExtraJson);
950 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
951 private delegate
void EngageString2AndInt2Callback(
string s,
int i1,
int i2,
string eventExtraJson);
953 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
954 private delegate
void EngageStringAndArgvCallback(
string s, IntPtr ptr,
string eventExtraJson);
956 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
957 private delegate
void EngageStringAndBlobCallback(
string s, IntPtr ptr,
int i,
string eventExtraJson);
959 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
960 private delegate
void EngageString2AndBlobCallback(
string s,
string j, IntPtr ptr,
int i,
string eventExtraJson);
962 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
963 private delegate
void EngageStringAndTwoIntCallback(
string s,
int i1,
int i2,
string eventExtraJson);
965 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
966 private delegate
void EngageLoggingCallback(
int level,
string tag,
string message);
970 [StructLayout(LayoutKind.Sequential, Pack = 1)]
973 [MarshalAs(UnmanagedType.ByValArray, SizeConst = ENGAGE_MAX_GROUP_ID_SZ)]
976 [MarshalAs(UnmanagedType.ByValArray, SizeConst = ENGAGE_MAX_GROUP_NAME_SZ)]
979 [MarshalAs(UnmanagedType.U1)]
980 public Boolean isEncrypted;
982 [MarshalAs(UnmanagedType.U1)]
983 public Boolean allowsFullDuplex;
986 [StructLayout(LayoutKind.Sequential, Pack = 1)]
989 public EngageVoidCallback PFN_ENGAGE_ENGINE_STARTED;
990 public EngageVoidCallback PFN_ENGAGE_ENGINE_STOPPED;
992 public EngageStringCallback PFN_ENGAGE_RP_PAUSING_CONNECTION_ATTEMPT;
993 public EngageStringCallback PFN_ENGAGE_RP_CONNECTING;
994 public EngageStringCallback PFN_ENGAGE_RP_CONNECTED;
995 public EngageStringCallback PFN_ENGAGE_RP_DISCONNECTED;
996 public EngageStringAndTwoIntCallback PFN_ENGAGE_RP_ROUNDTRIP_REPORT;
998 public EngageStringCallback PFN_ENGAGE_GROUP_CREATED;
999 public EngageStringCallback PFN_ENGAGE_GROUP_CREATE_FAILED;
1000 public EngageStringCallback PFN_ENGAGE_GROUP_DELETED;
1002 public EngageStringCallback PFN_ENGAGE_GROUP_CONNECTED;
1003 public EngageStringCallback PFN_ENGAGE_GROUP_CONNECT_FAILED;
1004 public EngageStringCallback PFN_ENGAGE_GROUP_DISCONNECTED;
1006 public EngageStringCallback PFN_ENGAGE_GROUP_JOINED;
1007 public EngageStringCallback PFN_ENGAGE_GROUP_JOIN_FAILED;
1008 public EngageStringCallback PFN_ENGAGE_GROUP_LEFT;
1010 public EngageStringAndIntCallback PFN_ENGAGE_GROUP_MEMBER_COUNT_CHANGED;
1012 public EngageString2Callback PFN_ENGAGE_GROUP_NODE_DISCOVERED;
1013 public EngageString2Callback PFN_ENGAGE_GROUP_NODE_REDISCOVERED;
1014 public EngageString2Callback PFN_ENGAGE_GROUP_NODE_UNDISCOVERED;
1016 public EngageStringCallback PFN_ENGAGE_GROUP_RX_STARTED;
1017 public EngageStringCallback PFN_ENGAGE_GROUP_RX_ENDED;
1018 public EngageString2Callback PFN_ENGAGE_GROUP_RX_SPEAKERS_CHANGED;
1019 public EngageStringCallback PFN_ENGAGE_GROUP_RX_MUTED;
1020 public EngageStringCallback PFN_ENGAGE_GROUP_RX_UNMUTED;
1022 public EngageStringCallback PFN_ENGAGE_GROUP_TX_STARTED;
1023 public EngageStringCallback PFN_ENGAGE_GROUP_TX_ENDED;
1024 public EngageStringCallback PFN_ENGAGE_GROUP_TX_FAILED;
1025 public EngageStringCallback PFN_ENGAGE_GROUP_TX_USURPED_BY_PRIORITY;
1026 public EngageStringCallback PFN_ENGAGE_GROUP_MAX_TX_TIME_EXCEEDED;
1027 public EngageStringCallback PFN_ENGAGE_GROUP_TX_MUTED;
1028 public EngageStringCallback PFN_ENGAGE_GROUP_TX_UNMUTED;
1030 public EngageString2Callback PFN_ENGAGE_GROUP_ASSET_DISCOVERED;
1031 public EngageString2Callback PFN_ENGAGE_GROUP_ASSET_REDISCOVERED;
1032 public EngageString2Callback PFN_ENGAGE_GROUP_ASSET_UNDISCOVERED;
1034 public EngageVoidCallback PFN_ENGAGE_LICENSE_CHANGED;
1035 public EngageVoidCallback PFN_ENGAGE_LICENSE_EXPIRED;
1036 public EngageStringCallback PFN_ENGAGE_LICENSE_EXPIRING;
1038 public EngageStringCallback PFN_ENGAGE_GROUP_BLOB_SENT;
1039 public EngageStringCallback PFN_ENGAGE_GROUP_BLOB_SEND_FAILED;
1040 public EngageString2AndBlobCallback PFN_ENGAGE_GROUP_BLOB_RECEIVED;
1042 public EngageStringCallback PFN_ENGAGE_GROUP_RTP_SENT;
1043 public EngageStringCallback PFN_ENGAGE_GROUP_RTP_SEND_FAILED;
1044 public EngageString2AndBlobCallback PFN_ENGAGE_GROUP_RTP_RECEIVED;
1046 public EngageStringCallback PFN_ENGAGE_GROUP_RAW_SENT;
1047 public EngageStringCallback PFN_ENGAGE_GROUP_RAW_SEND_FAILED;
1048 public EngageStringAndBlobCallback PFN_ENGAGE_GROUP_RAW_RECEIVED;
1050 public EngageString2Callback PFN_ENGAGE_GROUP_TIMELINE_EVENT_STARTED;
1051 public EngageString2Callback PFN_ENGAGE_GROUP_TIMELINE_EVENT_UPDATED;
1052 public EngageString2Callback PFN_ENGAGE_GROUP_TIMELINE_EVENT_ENDED;
1053 public EngageString2Callback PFN_ENGAGE_GROUP_TIMELINE_REPORT;
1054 public EngageStringCallback PFN_ENGAGE_GROUP_TIMELINE_REPORT_FAILED;
1055 public EngageString2Callback PFN_ENGAGE_GROUP_TIMELINE_GROOMED;
1057 public EngageString2Callback PFN_ENGAGE_GROUP_HEALTH_REPORT;
1058 public EngageStringCallback PFN_ENGAGE_GROUP_HEALTH_REPORT_FAILED;
1060 public EngageStringCallback PFN_ENGAGE_BRIDGE_CREATED;
1061 public EngageStringCallback PFN_ENGAGE_BRIDGE_CREATE_FAILED;
1062 public EngageStringCallback PFN_ENGAGE_BRIDGE_DELETED;
1064 public EngageString2Callback PFN_ENGAGE_GROUP_STATS_REPORT;
1065 public EngageStringCallback PFN_ENGAGE_GROUP_STATS_REPORT_FAILED;
1067 public EngageString2AndInt2Callback PFN_ENGAGE_GROUP_RX_VOLUME_CHANGED;
1068 public EngageString2Callback PFN_ENGAGE_GROUP_RX_DTMF;
1070 public EngageVoidCallback PFN_ENGAGE_ENGINE_AUDIO_DEVICES_REFRESHED;
1071 public EngageVoidCallback PFN_ENGAGE_ENGINE_GROUP_BY_GROUP_PCM_POWER_LEVEL_REPORT;
1072 public EngageVoidCallback PFN_ENGAGE_ENGINE_AUDIO_DEVICE_EVENT;
1074 public EngageStringCallback PFN_ENGAGE_GROUP_RECONFIGURED;
1075 public EngageStringCallback PFN_ENGAGE_GROUP_RECONFIGURATION_FAILED;
1077 public EngageStringCallback PFN_ENGAGE_AUDIO_RECORDING_STARTED;
1078 public EngageStringCallback PFN_ENGAGE_AUDIO_RECORDING_FAILED;
1079 public EngageStringCallback PFN_ENGAGE_AUDIO_RECORDING_ENDED;
1082 [StructLayout(LayoutKind.Sequential, Pack = 1)]
1085 [MarshalAs(UnmanagedType.U1)]
1088 [MarshalAs(UnmanagedType.U4)]
1091 [MarshalAs(UnmanagedType.U1)]
1094 [MarshalAs(UnmanagedType.U1)]
1097 [MarshalAs(UnmanagedType.U1)]
1100 [MarshalAs(UnmanagedType.U1)]
1104 [StructLayout(LayoutKind.Sequential, Pack = 1)]
1107 [MarshalAs(UnmanagedType.U1)]
1110 [MarshalAs(UnmanagedType.U1)]
1114 [StructLayout(LayoutKind.Sequential, Pack = 1)]
1117 [MarshalAs(UnmanagedType.U1)]
1120 [MarshalAs(UnmanagedType.U2)]
1124 [StructLayout(LayoutKind.Sequential, Pack = 1)]
1127 [MarshalAs(UnmanagedType.U1)]
1130 [MarshalAs(UnmanagedType.U4)]
1134 [StructLayout(LayoutKind.Sequential, Pack = 1)]
1137 [MarshalAs(UnmanagedType.U1)]
1140 [MarshalAs(UnmanagedType.U8)]
1145 #region Library functions
1146 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1147 private static extern void engageWin32LibraryInit();
1149 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1150 private static extern void engageWin32LibraryDeinit();
1152 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1153 private static extern int engageRegisterEventCallbacks(ref
EngageEvents_t callbacks);
1155 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1156 private static extern int engageEnableNotifications(
int enable);
1158 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1159 private static extern int engageInitialize(
string enginePolicyConfiguration,
string userIdentity,
string tempStoragePath);
1161 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1162 private static extern int engageShutdown();
1164 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1165 private static extern int engageStart();
1167 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1168 private static extern int engageStop();
1170 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1171 private static extern int engageCreateGroup(
string jsonConfiguration);
1173 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1174 private static extern int engageDeleteGroup(
string id);
1176 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1177 private static extern int engageJoinGroup(
string id);
1179 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1180 private static extern int engageLeaveGroup(
string id);
1182 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1183 private static extern int engageSetGroupRules(
string id,
string jsonParams);
1185 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1186 private static extern int engageBeginGroupTx(
string id,
int txPriority,
int txFlags);
1188 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1189 private static extern int engageBeginGroupTxAdvanced(
string id,
string jsonParams);
1191 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1192 private static extern int engageEndGroupTx(
string id);
1194 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1195 private static extern int engageSetGroupRxTag(
string id,
int tag);
1197 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1198 private static extern int engageMuteGroupRx(
string id);
1200 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1201 private static extern int engageUnmuteGroupRx(
string id);
1203 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1204 private static extern int engageMuteGroupTx(
string id);
1206 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1207 private static extern int engageUnmuteGroupTx(
string id);
1209 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1210 private static extern int engageSetGroupRxVolume(
string id,
int left,
int right);
1212 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1213 private static extern IntPtr engageGetVersion();
1215 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1216 private static extern IntPtr engageGetHardwareReport();
1218 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1219 private static extern IntPtr engageGetActiveLicenseDescriptor();
1221 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1222 private static extern IntPtr engageGetLicenseDescriptor(
string entitlement,
string key,
string activationCode,
string manufacturerId);
1224 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1225 private static extern int engageUpdateLicense(
string entitlement,
string key,
string activationCode,
string manufacturerId);
1227 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1228 private static extern int engageUpdatePresenceDescriptor(
string id,
string jsonDescriptor,
int forceBeacon);
1230 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1231 private static extern int engageSendGroupBlob(
string id, IntPtr blob,
int blobSize,
string jsonBlobParams);
1233 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1234 private static extern int engageSendGroupRtp(
string id, IntPtr payload,
int payloadSize,
string jsonRtpHeader);
1236 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1237 private static extern int engageSendGroupRaw(
string id, IntPtr raw,
int rawSize,
string jsonRtpHeader);
1239 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1240 private static extern int engageQueryGroupTimeline(
string id,
string jsonParams);
1242 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1243 private static extern int engageSetLogLevel(
int level);
1245 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1246 private static extern int engageSetLogTagExtension(
string tagExtension);
1248 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1249 private static extern int engageSetLoggingOutputOverride(EngageLoggingCallback hookFn);
1251 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1252 private static extern int engageEnableSyslog(
int enable);
1254 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1255 private static extern int engageWatchdog(
int enable);
1257 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1258 private static extern int engageLogMsg(
int level,
string tag,
string msg);
1260 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1261 private static extern IntPtr engageGetNetworkInterfaceDevices();
1263 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1264 private static extern IntPtr engageGetAudioDevices();
1266 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1267 private static extern IntPtr engageGenerateMission(
string keyPhrase,
int audioGroupCount,
string rallypointHost,
string missionName);
1269 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1270 private static extern IntPtr engageGenerateMissionUsingCertStore(
string keyPhrase,
int audioGroupCount,
string rallypointHost,
string missionName,
string certStoreFn,
string certStorePasswordHexByteString,
string certStoreElement);
1272 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1273 private static extern int engageSetMissionId(
string missionId);
1275 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1276 private static extern int engageOpenCertStore(
string fileName,
string passwordHexByteString);
1278 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1279 private static extern IntPtr engageGetCertStoreDescriptor();
1281 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1282 private static extern int engageCloseCertStore();
1284 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1285 private static extern int engageSetCertStoreCertificatePem(
string id,
string certificatePem,
string privateKeyPem,
string tags);
1287 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1288 private static extern int engageSetCertStoreCertificateP12(
string id,IntPtr data,
int size,
string password,
string tags);
1290 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1291 private static extern int engageDeleteCertStoreCertificate(
string id);
1293 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1294 private static extern IntPtr engageGetCertStoreCertificatePem(
string id);
1296 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1297 private static extern IntPtr engageGetCertificateDescriptorFromPem(
string pem);
1299 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1300 private static extern IntPtr engageGetArrayOfCertificateDescriptorsFromPem(
string pem);
1302 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1303 private static extern int engageImportCertStoreElementFromCertStore(
string id,
string srcId,
string srcFileName,
string srcPasswordHexByteString,
string tags);
1305 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1306 private static extern IntPtr engageQueryCertStoreContents(
string fileName,
string passwordHexByteString);
1308 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1309 private static extern int engageQueryGroupHealth(
string id);
1311 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1312 private static extern int engageQueryGroupStats(
string id);
1314 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1315 private static extern int engageCreateBridge(
string jsonConfiguration);
1317 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1318 private static extern int engageDeleteBridge(
string id);
1320 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1321 private static extern int engageEncrypt(IntPtr src,
int size, IntPtr dst,
string passwordHexByteString);
1323 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1324 private static extern int engageDecrypt(IntPtr src,
int size, IntPtr dst,
string passwordHexByteString);
1326 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1327 private static extern int engagePlatformNotifyChanges(
string jsonChangesArray);
1329 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1330 private static extern IntPtr engageBeginFileRecording(
string jsonParams);
1332 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1333 private static extern IntPtr engageEndFileRecording(
string id);
1341 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1342 private static extern int engageSetFipsCrypto(
string jsonParams);
1344 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1345 private static extern int engageIsCryptoFipsValidated();
1347 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1348 private static extern IntPtr engageGetDeviceId();
1350 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1351 private static extern int engageSetCertStore(IntPtr buff,
int size,
string passwordHexByteString);
1353 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1354 private static extern int engageVerifyRiff(
string fn);
1356 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1357 private static extern IntPtr engageGetRiffDescriptor(
string fn);
1359 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1360 private static extern int engageBeginGroupPcmPowerTracking(
string id);
1362 [DllImport(ENGAGE_DLL, CallingConvention = CallingConvention.Cdecl)]
1363 private static extern int engageEndGroupPcmPowerTracking(
string id);
1367 #region Internal functions
1368 private static string[] stringArrayFromArgvStrPtrArray(IntPtr ptr)
1379 strPtr = Marshal.ReadIntPtr(arrayPtr);
1380 if (strPtr == (IntPtr)0)
1386 arrayPtr += Marshal.SizeOf(arrayPtr);
1392 rc =
new string[count];
1398 strPtr = Marshal.ReadIntPtr(arrayPtr);
1399 if (strPtr == (IntPtr)0)
1404 rc[idx] = Marshal.PtrToStringAnsi(strPtr);
1406 arrayPtr += Marshal.SizeOf(arrayPtr);
1414 private int registerEventCallbacks()
1418 cb.PFN_ENGAGE_ENGINE_STARTED = on_ENGAGE_ENGINE_STARTED;
1419 cb.PFN_ENGAGE_ENGINE_STOPPED = on_ENGAGE_ENGINE_STOPPED;
1420 cb.PFN_ENGAGE_ENGINE_AUDIO_DEVICES_REFRESHED = on_ENGAGE_ENGINE_AUDIO_DEVICES_REFRESHED;
1421 cb.PFN_ENGAGE_ENGINE_GROUP_BY_GROUP_PCM_POWER_LEVEL_REPORT = on_ENGAGE_ENGINE_GROUP_BY_GROUP_PCM_POWER_LEVEL_REPORT;
1422 cb.PFN_ENGAGE_ENGINE_AUDIO_DEVICE_EVENT = on_ENGAGE_ENGINE_AUDIO_DEVICE_EVENT;
1424 cb.PFN_ENGAGE_RP_PAUSING_CONNECTION_ATTEMPT = on_ENGAGE_RP_PAUSING_CONNECTION_ATTEMPT;
1425 cb.PFN_ENGAGE_RP_CONNECTING = on_ENGAGE_RP_CONNECTING;
1426 cb.PFN_ENGAGE_RP_CONNECTED = on_ENGAGE_RP_CONNECTED;
1427 cb.PFN_ENGAGE_RP_DISCONNECTED = on_ENGAGE_RP_DISCONNECTED;
1428 cb.PFN_ENGAGE_RP_ROUNDTRIP_REPORT = on_ENGAGE_RP_ROUNDTRIP_REPORT;
1430 cb.PFN_ENGAGE_GROUP_CREATED = on_ENGAGE_GROUP_CREATED;
1431 cb.PFN_ENGAGE_GROUP_CREATE_FAILED = on_ENGAGE_GROUP_CREATE_FAILED;
1432 cb.PFN_ENGAGE_GROUP_DELETED = on_ENGAGE_GROUP_DELETED;
1434 cb.PFN_ENGAGE_GROUP_CONNECTED = on_ENGAGE_GROUP_CONNECTED;
1435 cb.PFN_ENGAGE_GROUP_CONNECT_FAILED = on_ENGAGE_GROUP_CONNECT_FAILED;
1436 cb.PFN_ENGAGE_GROUP_DISCONNECTED = on_ENGAGE_GROUP_DISCONNECTED;
1438 cb.PFN_ENGAGE_GROUP_JOINED = on_ENGAGE_GROUP_JOINED;
1439 cb.PFN_ENGAGE_GROUP_JOIN_FAILED = on_ENGAGE_GROUP_JOIN_FAILED;
1440 cb.PFN_ENGAGE_GROUP_LEFT = on_ENGAGE_GROUP_LEFT;
1443 cb.PFN_ENGAGE_GROUP_MEMBER_COUNT_CHANGED =
null;
1446 cb.PFN_ENGAGE_GROUP_RX_STARTED = on_ENGAGE_GROUP_RX_STARTED;
1447 cb.PFN_ENGAGE_GROUP_RX_ENDED = on_ENGAGE_GROUP_RX_ENDED;
1449 cb.PFN_ENGAGE_GROUP_RX_MUTED = on_ENGAGE_GROUP_RX_MUTED;
1450 cb.PFN_ENGAGE_GROUP_RX_UNMUTED = on_ENGAGE_GROUP_RX_UNMUTED;
1452 cb.PFN_ENGAGE_GROUP_TX_MUTED = on_ENGAGE_GROUP_TX_MUTED;
1453 cb.PFN_ENGAGE_GROUP_TX_UNMUTED = on_ENGAGE_GROUP_TX_UNMUTED;
1455 cb.PFN_ENGAGE_GROUP_RX_SPEAKERS_CHANGED = on_ENGAGE_GROUP_RX_SPEAKERS_CHANGED;
1457 cb.PFN_ENGAGE_GROUP_TX_STARTED = on_ENGAGE_GROUP_TX_STARTED;
1458 cb.PFN_ENGAGE_GROUP_TX_ENDED = on_ENGAGE_GROUP_TX_ENDED;
1459 cb.PFN_ENGAGE_GROUP_TX_FAILED = on_ENGAGE_GROUP_TX_FAILED;
1460 cb.PFN_ENGAGE_GROUP_TX_USURPED_BY_PRIORITY = on_ENGAGE_GROUP_TX_USURPED_BY_PRIORITY;
1461 cb.PFN_ENGAGE_GROUP_MAX_TX_TIME_EXCEEDED = on_ENGAGE_GROUP_MAX_TX_TIME_EXCEEDED;
1463 cb.PFN_ENGAGE_GROUP_NODE_DISCOVERED = on_ENGAGE_GROUP_NODE_DISCOVERED;
1464 cb.PFN_ENGAGE_GROUP_NODE_REDISCOVERED = on_ENGAGE_GROUP_NODE_REDISCOVERED;
1465 cb.PFN_ENGAGE_GROUP_NODE_UNDISCOVERED = on_ENGAGE_GROUP_NODE_UNDISCOVERED;
1467 cb.PFN_ENGAGE_GROUP_ASSET_DISCOVERED = on_ENGAGE_GROUP_ASSET_DISCOVERED;
1468 cb.PFN_ENGAGE_GROUP_ASSET_REDISCOVERED = on_ENGAGE_GROUP_ASSET_REDISCOVERED;
1469 cb.PFN_ENGAGE_GROUP_ASSET_UNDISCOVERED = on_ENGAGE_GROUP_ASSET_UNDISCOVERED;
1471 cb.PFN_ENGAGE_LICENSE_CHANGED = on_ENGAGE_LICENSE_CHANGED;
1472 cb.PFN_ENGAGE_LICENSE_EXPIRED = on_ENGAGE_LICENSE_EXPIRED;
1473 cb.PFN_ENGAGE_LICENSE_EXPIRING = on_ENGAGE_LICENSE_EXPIRING;
1475 cb.PFN_ENGAGE_GROUP_BLOB_SENT = on_ENGAGE_GROUP_BLOB_SENT;
1476 cb.PFN_ENGAGE_GROUP_BLOB_SEND_FAILED = on_ENGAGE_GROUP_BLOB_SEND_FAILED;
1477 cb.PFN_ENGAGE_GROUP_BLOB_RECEIVED = on_ENGAGE_GROUP_BLOB_RECEIVED;
1479 cb.PFN_ENGAGE_GROUP_RTP_SENT = on_ENGAGE_GROUP_RTP_SENT;
1480 cb.PFN_ENGAGE_GROUP_RTP_SEND_FAILED = on_ENGAGE_GROUP_RTP_SEND_FAILED;
1481 cb.PFN_ENGAGE_GROUP_RTP_RECEIVED = on_ENGAGE_GROUP_RTP_RECEIVED;
1483 cb.PFN_ENGAGE_GROUP_RAW_SENT = on_ENGAGE_GROUP_RAW_SENT;
1484 cb.PFN_ENGAGE_GROUP_RAW_SEND_FAILED = on_ENGAGE_GROUP_RAW_SEND_FAILED;
1485 cb.PFN_ENGAGE_GROUP_RAW_RECEIVED = on_ENGAGE_GROUP_RAW_RECEIVED;
1487 cb.PFN_ENGAGE_GROUP_TIMELINE_EVENT_STARTED = on_ENGAGE_GROUP_TIMELINE_EVENT_STARTED;
1488 cb.PFN_ENGAGE_GROUP_TIMELINE_EVENT_UPDATED = on_ENGAGE_GROUP_TIMELINE_EVENT_UPDATED;
1489 cb.PFN_ENGAGE_GROUP_TIMELINE_EVENT_ENDED = on_ENGAGE_GROUP_TIMELINE_EVENT_ENDED;
1491 cb.PFN_ENGAGE_GROUP_TIMELINE_REPORT = on_ENGAGE_GROUP_TIMELINE_REPORT;
1492 cb.PFN_ENGAGE_GROUP_TIMELINE_REPORT_FAILED = on_ENGAGE_GROUP_TIMELINE_REPORT_FAILED;
1493 cb.PFN_ENGAGE_GROUP_TIMELINE_GROOMED = on_ENGAGE_GROUP_TIMELINE_GROOMED;
1495 cb.PFN_ENGAGE_GROUP_HEALTH_REPORT = on_ENGAGE_GROUP_HEALTH_REPORT;
1496 cb.PFN_ENGAGE_GROUP_HEALTH_REPORT_FAILED = on_ENGAGE_GROUP_HEALTH_REPORT_FAILED;
1498 cb.PFN_ENGAGE_BRIDGE_CREATED = on_ENGAGE_BRIDGE_CREATED;
1499 cb.PFN_ENGAGE_BRIDGE_CREATE_FAILED = on_ENGAGE_BRIDGE_CREATE_FAILED;
1500 cb.PFN_ENGAGE_BRIDGE_DELETED = on_ENGAGE_BRIDGE_DELETED;
1502 cb.PFN_ENGAGE_GROUP_RX_VOLUME_CHANGED = on_ENGAGE_GROUP_RX_VOLUME_CHANGED;
1503 cb.PFN_ENGAGE_GROUP_RX_DTMF = on_ENGAGE_GROUP_RX_DTMF;
1505 cb.PFN_ENGAGE_GROUP_RECONFIGURED = on_ENGAGE_GROUP_RECONFIGURED;
1506 cb.PFN_ENGAGE_GROUP_RECONFIGURATION_FAILED = on_ENGAGE_GROUP_RECONFIGURATION_FAILED;
1508 cb.PFN_ENGAGE_AUDIO_RECORDING_STARTED = on_ENGAGE_AUDIO_RECORDING_STARTED;
1509 cb.PFN_ENGAGE_AUDIO_RECORDING_FAILED = on_ENGAGE_AUDIO_RECORDING_FAILED;
1510 cb.PFN_ENGAGE_AUDIO_RECORDING_ENDED = on_ENGAGE_AUDIO_RECORDING_ENDED;
1512 return engageRegisterEventCallbacks(ref cb);
1515 private string makeUserJsonConfiguration(
string alias,
string displayName,
int txPriority)
1517 StringBuilder sb =
new StringBuilder();
1522 string myAlias = alias;
1523 string myDisplayName = displayName;
1524 int myTransmitPirority = txPriority;
1526 if (myAlias ==
null || myAlias.Length == 0)
1528 myAlias = String.Format(
"C#{0:X14}",
new Random().Next());
1531 if (myDisplayName ==
null || myDisplayName.Length == 0)
1533 myDisplayName =
"C# User " + myAlias;
1536 if(myTransmitPirority < 0)
1538 myTransmitPirority = 0;
1542 sb.Append(
"\"alias\":");
1543 sb.Append(
"\"" + myAlias +
"\"");
1545 sb.Append(
",\"displayName\":");
1546 sb.Append(
"\"" + myDisplayName +
"\"");
1548 sb.Append(
",\"txPriority\":");
1549 sb.Append(myTransmitPirority);
1552 return sb.ToString();
1556 #region Member variables
1557 private static List<IEngineNotifications> _engineNotificationSubscribers =
new List<IEngineNotifications>();
1558 private static List<IRallypointNotifications> _rallypointNotificationSubscribers =
new List<IRallypointNotifications>();
1559 private static List<IGroupNotifications> _groupNotificationSubscribers =
new List<IGroupNotifications>();
1560 private static List<ILicenseNotifications> _licenseNotificationSubscribers =
new List<ILicenseNotifications>();
1561 private static List<IHumanBiometricsNotifications> _humanBiometricsNotifications =
new List<IHumanBiometricsNotifications>();
1562 private static List<IBridgeNotifications> _bridgeNotificationSubscribers =
new List<IBridgeNotifications>();
1563 private static List<ILoggingNotifications> _loggingNotificationSubscribers =
new List<ILoggingNotifications>();
1564 private static List<IAudioRecordingNotifications> _audioRecordingNotificationSubscribers =
new List<IAudioRecordingNotifications>();
1567 #region Callback delegates
1568 private EngageVoidCallback on_ENGAGE_ENGINE_STARTED = (
string eventExtraJson) =>
1570 lock (_engineNotificationSubscribers)
1572 foreach (IEngineNotifications n
in _engineNotificationSubscribers)
1574 n.onEngineStarted(eventExtraJson);
1579 private EngageVoidCallback on_ENGAGE_ENGINE_STOPPED = (
string eventExtraJson) =>
1581 lock (_engineNotificationSubscribers)
1583 foreach (IEngineNotifications n
in _engineNotificationSubscribers)
1585 n.onEngineStopped(eventExtraJson);
1590 private EngageVoidCallback on_ENGAGE_ENGINE_AUDIO_DEVICES_REFRESHED = (
string eventExtraJson) =>
1592 lock (_engineNotificationSubscribers)
1594 foreach (IEngineNotifications n
in _engineNotificationSubscribers)
1596 n.onEngineAudioDevicesRefreshed(eventExtraJson);
1601 private EngageVoidCallback on_ENGAGE_ENGINE_GROUP_BY_GROUP_PCM_POWER_LEVEL_REPORT = (
string eventExtraJson) =>
1603 lock (_engineNotificationSubscribers)
1605 foreach (IEngineNotifications n
in _engineNotificationSubscribers)
1607 n.onEngineGroupByGroupPcmPowerLevels(eventExtraJson);
1612 private EngageVoidCallback on_ENGAGE_ENGINE_AUDIO_DEVICE_EVENT = (
string eventExtraJson) =>
1614 lock (_engineNotificationSubscribers)
1616 foreach (IEngineNotifications n
in _engineNotificationSubscribers)
1618 n.onEngineAudioDevicesEvent(eventExtraJson);
1623 private EngageStringCallback on_ENGAGE_RP_PAUSING_CONNECTION_ATTEMPT = (
string id,
string eventExtraJson) =>
1625 lock (_rallypointNotificationSubscribers)
1627 foreach (IRallypointNotifications n
in _rallypointNotificationSubscribers)
1629 n.onRallypointPausingConnectionAttempt(
id, eventExtraJson);
1634 private EngageStringCallback on_ENGAGE_RP_CONNECTING = (
string id,
string eventExtraJson) =>
1636 lock (_rallypointNotificationSubscribers)
1638 foreach (IRallypointNotifications n
in _rallypointNotificationSubscribers)
1640 n.onRallypointConnecting(
id, eventExtraJson);
1645 private EngageStringCallback on_ENGAGE_RP_CONNECTED = (
string id,
string eventExtraJson) =>
1647 lock (_rallypointNotificationSubscribers)
1649 foreach (IRallypointNotifications n
in _rallypointNotificationSubscribers)
1651 n.onRallypointConnected(
id, eventExtraJson);
1656 private EngageStringCallback on_ENGAGE_RP_DISCONNECTED = (
string id,
string eventExtraJson) =>
1658 lock (_rallypointNotificationSubscribers)
1660 foreach (IRallypointNotifications n
in _rallypointNotificationSubscribers)
1662 n.onRallypointDisconnected(
id, eventExtraJson);
1667 private EngageStringAndTwoIntCallback on_ENGAGE_RP_ROUNDTRIP_REPORT = (
string id,
int rtMs,
int rtRating,
string eventExtraJson) =>
1669 lock (_rallypointNotificationSubscribers)
1671 foreach (IRallypointNotifications n
in _rallypointNotificationSubscribers)
1673 n.onRallypointRoundtripReport(
id, rtMs, rtRating, eventExtraJson);
1678 private EngageLoggingCallback on_ENGAGE_LOG_MESSAGE_HOOK_CALLBACK = (
int level,
string tag,
string message) =>
1680 lock (_loggingNotificationSubscribers)
1682 foreach (ILoggingNotifications n
in _loggingNotificationSubscribers)
1684 n.onEngageLogMessage(level, tag, message);
1690 private EngageStringCallback on_ENGAGE_GROUP_CREATED = (
string id,
string eventExtraJson) =>
1692 lock (_groupNotificationSubscribers)
1694 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1696 n.onGroupCreated(
id, eventExtraJson);
1701 private EngageStringCallback on_ENGAGE_GROUP_CREATE_FAILED = (
string id,
string eventExtraJson) =>
1703 lock (_groupNotificationSubscribers)
1705 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1707 n.onGroupCreateFailed(
id, eventExtraJson);
1712 private EngageStringCallback on_ENGAGE_GROUP_DELETED = (
string id,
string eventExtraJson) =>
1714 lock (_groupNotificationSubscribers)
1716 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1718 n.onGroupDeleted(
id, eventExtraJson);
1723 private EngageStringCallback on_ENGAGE_GROUP_CONNECTED = (
string id,
string eventExtraJson) =>
1725 lock (_groupNotificationSubscribers)
1727 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1729 n.onGroupConnected(
id, eventExtraJson);
1734 private EngageStringCallback on_ENGAGE_GROUP_CONNECT_FAILED = (
string id,
string eventExtraJson) =>
1736 lock (_groupNotificationSubscribers)
1738 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1740 n.onGroupConnectFailed(
id, eventExtraJson);
1745 private EngageStringCallback on_ENGAGE_GROUP_DISCONNECTED = (
string id,
string eventExtraJson) =>
1747 lock (_groupNotificationSubscribers)
1749 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1751 n.onGroupDisconnected(
id, eventExtraJson);
1756 private EngageStringCallback on_ENGAGE_GROUP_JOINED = (
string id,
string eventExtraJson) =>
1758 lock (_groupNotificationSubscribers)
1760 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1762 n.onGroupJoined(
id, eventExtraJson);
1767 private EngageStringCallback on_ENGAGE_GROUP_JOIN_FAILED = (
string id,
string eventExtraJson) =>
1769 lock (_groupNotificationSubscribers)
1771 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1773 n.onGroupJoinFailed(
id, eventExtraJson);
1778 private EngageStringCallback on_ENGAGE_GROUP_LEFT = (
string id,
string eventExtraJson) =>
1780 lock (_groupNotificationSubscribers)
1782 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1784 n.onGroupLeft(
id, eventExtraJson);
1789 private EngageStringAndIntCallback on_ENGAGE_GROUP_MEMBER_COUNT_CHANGED = (
string id,
int newCount,
string eventExtraJson) =>
1791 lock (_groupNotificationSubscribers)
1793 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1795 n.onGroupMemberCountChanged(
id, newCount, eventExtraJson);
1800 private EngageStringCallback on_ENGAGE_GROUP_RX_STARTED = (
string id,
string eventExtraJson) =>
1802 lock (_groupNotificationSubscribers)
1804 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1806 n.onGroupRxStarted(
id, eventExtraJson);
1811 private EngageStringCallback on_ENGAGE_GROUP_RX_ENDED = (
string id,
string eventExtraJson) =>
1813 lock (_groupNotificationSubscribers)
1815 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1817 n.onGroupRxEnded(
id, eventExtraJson);
1822 private EngageStringCallback on_ENGAGE_GROUP_RX_MUTED = (
string id,
string eventExtraJson) =>
1824 lock (_groupNotificationSubscribers)
1826 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1828 n.onGroupRxMuted(
id, eventExtraJson);
1833 private EngageStringCallback on_ENGAGE_GROUP_RX_UNMUTED = (
string id,
string eventExtraJson) =>
1835 lock (_groupNotificationSubscribers)
1837 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1839 n.onGroupRxUnmuted(
id, eventExtraJson);
1844 private EngageStringCallback on_ENGAGE_GROUP_TX_MUTED = (
string id,
string eventExtraJson) =>
1846 lock (_groupNotificationSubscribers)
1848 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1850 n.onGroupTxMuted(
id, eventExtraJson);
1855 private EngageStringCallback on_ENGAGE_GROUP_TX_UNMUTED = (
string id,
string eventExtraJson) =>
1857 lock (_groupNotificationSubscribers)
1859 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1861 n.onGroupTxUnmuted(
id, eventExtraJson);
1866 private EngageString2Callback on_ENGAGE_GROUP_RX_SPEAKERS_CHANGED = (
string id,
string speakerjson,
string eventExtraJson) =>
1868 lock (_groupNotificationSubscribers)
1870 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1872 n.onGroupRxSpeakersChanged(
id, speakerjson, eventExtraJson);
1877 private EngageStringCallback on_ENGAGE_GROUP_TX_STARTED = (
string id,
string eventExtraJson) =>
1879 lock (_groupNotificationSubscribers)
1881 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1883 n.onGroupTxStarted(
id, eventExtraJson);
1888 private EngageStringCallback on_ENGAGE_GROUP_TX_ENDED = (
string id,
string eventExtraJson) =>
1890 lock (_groupNotificationSubscribers)
1892 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1894 n.onGroupTxEnded(
id, eventExtraJson);
1899 private EngageStringCallback on_ENGAGE_GROUP_TX_FAILED = (
string id,
string eventExtraJson) =>
1901 lock (_groupNotificationSubscribers)
1903 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1905 n.onGroupTxFailed(
id, eventExtraJson);
1910 private EngageStringCallback on_ENGAGE_GROUP_TX_USURPED_BY_PRIORITY = (
string id,
string eventExtraJson) =>
1912 lock (_groupNotificationSubscribers)
1914 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1916 n.onGroupTxUsurpedByPriority(
id, eventExtraJson);
1921 private EngageStringCallback on_ENGAGE_GROUP_MAX_TX_TIME_EXCEEDED = (
string id,
string eventExtraJson) =>
1923 lock (_groupNotificationSubscribers)
1925 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1927 n.onGroupMaxTxTimeExceeded(
id, eventExtraJson);
1932 private EngageString2Callback on_ENGAGE_GROUP_NODE_DISCOVERED = (
string id,
string nodeJson,
string eventExtraJson) =>
1934 lock (_groupNotificationSubscribers)
1936 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1938 n.onGroupNodeDiscovered(
id, nodeJson, eventExtraJson);
1943 private EngageString2Callback on_ENGAGE_GROUP_NODE_REDISCOVERED = (
string id,
string nodeJson,
string eventExtraJson) =>
1945 lock (_groupNotificationSubscribers)
1947 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1949 n.onGroupNodeRediscovered(
id, nodeJson, eventExtraJson);
1954 private EngageString2Callback on_ENGAGE_GROUP_NODE_UNDISCOVERED = (
string id,
string nodeJson,
string eventExtraJson) =>
1956 lock (_groupNotificationSubscribers)
1958 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1960 n.onGroupNodeUndiscovered(
id, nodeJson, eventExtraJson);
1965 private EngageString2Callback on_ENGAGE_GROUP_ASSET_DISCOVERED = (
string id,
string nodeJson,
string eventExtraJson) =>
1967 lock (_groupNotificationSubscribers)
1969 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1971 n.onGroupAssetDiscovered(
id, nodeJson, eventExtraJson);
1976 private EngageString2Callback on_ENGAGE_GROUP_ASSET_REDISCOVERED = (
string id,
string nodeJson,
string eventExtraJson) =>
1978 lock (_groupNotificationSubscribers)
1980 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1982 n.onGroupAssetRediscovered(
id, nodeJson, eventExtraJson);
1987 private EngageString2Callback on_ENGAGE_GROUP_ASSET_UNDISCOVERED = (
string id,
string nodeJson,
string eventExtraJson) =>
1989 lock (_groupNotificationSubscribers)
1991 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
1993 n.onGroupAssetUndiscovered(
id, nodeJson, eventExtraJson);
1998 private EngageVoidCallback on_ENGAGE_LICENSE_CHANGED = (
string eventExtraJson) =>
2000 lock (_licenseNotificationSubscribers)
2002 foreach (ILicenseNotifications n
in _licenseNotificationSubscribers)
2004 n.onLicenseChanged(eventExtraJson);
2009 private EngageVoidCallback on_ENGAGE_LICENSE_EXPIRED = (
string eventExtraJson) =>
2011 lock (_licenseNotificationSubscribers)
2013 foreach (ILicenseNotifications n
in _licenseNotificationSubscribers)
2015 n.onLicenseExpired(eventExtraJson);
2020 private EngageStringCallback on_ENGAGE_LICENSE_EXPIRING = (
string secondsLeft,
string eventExtraJson) =>
2022 lock (_licenseNotificationSubscribers)
2024 foreach (ILicenseNotifications n
in _licenseNotificationSubscribers)
2026 n.onLicenseExpiring(Double.Parse(secondsLeft), eventExtraJson);
2031 private EngageStringCallback on_ENGAGE_GROUP_BLOB_SENT = (
string id,
string eventExtraJson) =>
2033 lock (_groupNotificationSubscribers)
2035 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2037 n.onGroupBlobSent(
id, eventExtraJson);
2042 private EngageStringCallback on_ENGAGE_GROUP_BLOB_SEND_FAILED = (
string id,
string eventExtraJson) =>
2044 lock (_groupNotificationSubscribers)
2046 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2048 n.onGroupBlobSendFailed(
id, eventExtraJson);
2053 private EngageString2AndBlobCallback on_ENGAGE_GROUP_BLOB_RECEIVED = (
string id,
string blobInfoJson, IntPtr blob,
int blobSize,
string eventExtraJson) =>
2055 byte[] csBlob =
new byte[blobSize];
2056 Marshal.Copy(blob, csBlob, 0, blobSize);
2058 lock (_groupNotificationSubscribers)
2060 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2062 n.onGroupBlobReceived(
id, blobInfoJson, csBlob, blobSize, eventExtraJson);
2067 JObject blobInfo = JObject.Parse(blobInfoJson);
2068 if(blobInfo !=
null)
2070 int payloadType = (int)blobInfo[
"payloadType"];
2071 string nodeId = (string)blobInfo[
"source"];
2074 if (payloadType ==
Engage.ENGAGE_BLOB_PT_ENGAGE_BINARY_HUMAN_BIOMETRICS)
2076 lock (_humanBiometricsNotifications)
2078 if (_humanBiometricsNotifications.Count > 0)
2081 string hbmJson = humanBiometricsFromBlob(csBlob);
2083 if (hbmJson !=
null)
2085 foreach (IHumanBiometricsNotifications n
in _humanBiometricsNotifications)
2087 n.onHumanBiometricsReceived(
id, nodeId, hbmJson, eventExtraJson);
2096 private EngageStringCallback on_ENGAGE_GROUP_RTP_SENT = (
string id,
string eventExtraJson) =>
2098 lock (_groupNotificationSubscribers)
2100 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2102 n.onGroupRtpSent(
id, eventExtraJson);
2107 private EngageStringCallback on_ENGAGE_GROUP_RTP_SEND_FAILED = (
string id,
string eventExtraJson) =>
2109 lock (_groupNotificationSubscribers)
2111 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2113 n.onGroupRtpSendFailed(
id, eventExtraJson);
2118 private EngageString2AndBlobCallback on_ENGAGE_GROUP_RTP_RECEIVED = (
string id,
string rtpHeaderJson, IntPtr payload,
int payloadSize,
string eventExtraJson) =>
2120 lock (_groupNotificationSubscribers)
2122 byte[] csPayload =
new byte[payloadSize];
2123 Marshal.Copy(payload, csPayload, 0, payloadSize);
2125 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2127 n.onGroupRtpReceived(
id, rtpHeaderJson, csPayload, payloadSize, eventExtraJson);
2132 private EngageStringCallback on_ENGAGE_GROUP_RAW_SENT = (
string id,
string eventExtraJson) =>
2134 lock (_groupNotificationSubscribers)
2136 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2138 n.onGroupRawSent(
id, eventExtraJson);
2143 private EngageStringCallback on_ENGAGE_GROUP_RAW_SEND_FAILED = (
string id,
string eventExtraJson) =>
2145 lock (_groupNotificationSubscribers)
2147 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2149 n.onGroupRawSendFailed(
id, eventExtraJson);
2154 private EngageStringAndBlobCallback on_ENGAGE_GROUP_RAW_RECEIVED = (
string id, IntPtr raw,
int rawSize,
string eventExtraJson) =>
2156 lock (_groupNotificationSubscribers)
2158 byte[] csRaw =
new byte[rawSize];
2159 Marshal.Copy(raw, csRaw, 0, rawSize);
2161 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2163 n.onGroupRawReceived(
id, csRaw, rawSize, eventExtraJson);
2168 private EngageString2Callback on_ENGAGE_GROUP_TIMELINE_EVENT_STARTED = (
string id,
string eventJson,
string eventExtraJson) =>
2170 lock (_groupNotificationSubscribers)
2172 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2174 n.onGroupTimelineEventStarted(
id, eventJson, eventExtraJson);
2179 private EngageString2Callback on_ENGAGE_GROUP_TIMELINE_EVENT_UPDATED = (
string id,
string eventJson,
string eventExtraJson) =>
2181 lock (_groupNotificationSubscribers)
2183 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2185 n.onGroupTimelineEventUpdated(
id, eventJson, eventExtraJson);
2190 private EngageString2Callback on_ENGAGE_GROUP_TIMELINE_EVENT_ENDED = (
string id,
string eventJson,
string eventExtraJson) =>
2192 lock (_groupNotificationSubscribers)
2194 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2196 n.onGroupTimelineEventEnded(
id, eventJson, eventExtraJson);
2201 private EngageString2Callback on_ENGAGE_GROUP_TIMELINE_REPORT = (
string id,
string reportJson,
string eventExtraJson) =>
2203 lock (_groupNotificationSubscribers)
2205 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2207 n.onGroupTimelineReport(
id, reportJson, eventExtraJson);
2212 private EngageStringCallback on_ENGAGE_GROUP_TIMELINE_REPORT_FAILED = (
string id,
string eventExtraJson) =>
2214 lock (_groupNotificationSubscribers)
2216 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2218 n.onGroupTimelineReportFailed(
id, eventExtraJson);
2223 private EngageString2Callback on_ENGAGE_GROUP_TIMELINE_GROOMED = (
string id,
string eventListJson,
string eventExtraJson) =>
2225 lock (_groupNotificationSubscribers)
2227 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2229 n.onGroupTimelineGroomed(
id, eventListJson, eventExtraJson);
2234 private EngageString2Callback on_ENGAGE_GROUP_HEALTH_REPORT = (
string id,
string healthReportJson,
string eventExtraJson) =>
2236 lock (_groupNotificationSubscribers)
2238 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2240 n.onGroupHealthReport(
id, healthReportJson, eventExtraJson);
2245 private EngageStringCallback on_ENGAGE_GROUP_HEALTH_REPORT_FAILED = (
string id,
string eventExtraJson) =>
2247 lock (_groupNotificationSubscribers)
2249 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2251 n.onGroupHealthReportFailed(
id, eventExtraJson);
2256 private EngageString2Callback on_ENGAGE_GROUP_STATS_REPORT = (
string id,
string statsReportJson,
string eventExtraJson) =>
2258 lock (_groupNotificationSubscribers)
2260 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2262 n.onGroupStatsReport(
id, statsReportJson, eventExtraJson);
2267 private EngageStringCallback on_ENGAGE_GROUP_STATS_REPORT_FAILED = (
string id,
string eventExtraJson) =>
2269 lock (_groupNotificationSubscribers)
2271 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2273 n.onGroupStatsReportFailed(
id, eventExtraJson);
2278 private EngageStringCallback on_ENGAGE_BRIDGE_CREATED = (
string id,
string eventExtraJson) =>
2280 lock (_bridgeNotificationSubscribers)
2282 foreach (IBridgeNotifications n
in _bridgeNotificationSubscribers)
2284 n.onBridgeCreated(
id, eventExtraJson);
2289 private EngageStringCallback on_ENGAGE_BRIDGE_CREATE_FAILED = (
string id,
string eventExtraJson) =>
2291 lock (_bridgeNotificationSubscribers)
2293 foreach (IBridgeNotifications n
in _bridgeNotificationSubscribers)
2295 n.onBridgeCreateFailed(
id, eventExtraJson);
2300 private EngageStringCallback on_ENGAGE_BRIDGE_DELETED = (
string id,
string eventExtraJson) =>
2302 lock (_bridgeNotificationSubscribers)
2304 foreach (IBridgeNotifications n
in _bridgeNotificationSubscribers)
2306 n.onBridgeDeleted(
id, eventExtraJson);
2311 private EngageString2AndInt2Callback on_ENGAGE_GROUP_RX_VOLUME_CHANGED = (
string id,
int leftLevelPerc,
int rightLevelPerc,
string eventExtraJson) =>
2313 lock (_groupNotificationSubscribers)
2315 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2317 n.onGroupRxVolumeChanged(
id, leftLevelPerc, rightLevelPerc, eventExtraJson);
2322 private EngageString2Callback on_ENGAGE_GROUP_RX_DTMF = (
string id,
string dtmfJson,
string eventExtraJson) =>
2324 lock (_groupNotificationSubscribers)
2326 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2328 n.onGroupRxDtmf(
id, dtmfJson, eventExtraJson);
2333 private EngageStringCallback on_ENGAGE_GROUP_RECONFIGURED = (
string id,
string eventExtraJson) =>
2335 lock (_groupNotificationSubscribers)
2337 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2339 n.onGroupReconfigured(
id, eventExtraJson);
2344 private EngageStringCallback on_ENGAGE_GROUP_RECONFIGURATION_FAILED = (
string id,
string eventExtraJson) =>
2346 lock (_groupNotificationSubscribers)
2348 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2350 n.onGroupReconfigurationFailed(
id, eventExtraJson);
2355 private EngageStringCallback on_ENGAGE_AUDIO_RECORDING_STARTED = (
string id,
string eventExtraJson) =>
2357 lock (_groupNotificationSubscribers)
2359 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2361 n.onGroupAudioRecordingStarted(
id, eventExtraJson);
2366 private EngageStringCallback on_ENGAGE_AUDIO_RECORDING_FAILED = (
string id,
string eventExtraJson) =>
2368 lock (_groupNotificationSubscribers)
2370 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2372 n.onGroupAudioRecordingFailed(
id, eventExtraJson);
2377 private EngageStringCallback on_ENGAGE_AUDIO_RECORDING_ENDED = (
string id,
string eventExtraJson) =>
2379 lock (_groupNotificationSubscribers)
2381 foreach (IGroupNotifications n
in _groupNotificationSubscribers)
2383 n.onGroupAudioRecordingEnded(
id, eventExtraJson);
2390 #region Public functions
2393 engageEnableNotifications(0);
2394 engageWin32LibraryInit();
2395 engageEnableNotifications(1);
2400 engageEnableNotifications(0);
2402 engageWin32LibraryDeinit();
2405 public void subscribe(IEngineNotifications n)
2407 lock(_engineNotificationSubscribers)
2409 _engineNotificationSubscribers.Add(n);
2413 public void unsubscribe(IEngineNotifications n)
2415 lock (_engineNotificationSubscribers)
2417 _engineNotificationSubscribers.Remove(n);
2421 public void subscribe(IRallypointNotifications n)
2423 lock (_rallypointNotificationSubscribers)
2425 _rallypointNotificationSubscribers.Add(n);
2429 public void unsubscribe(IRallypointNotifications n)
2431 lock (_rallypointNotificationSubscribers)
2433 _rallypointNotificationSubscribers.Remove(n);
2437 public void subscribe(IGroupNotifications n)
2439 lock (_groupNotificationSubscribers)
2441 _groupNotificationSubscribers.Add(n);
2445 public void unsubscribe(IGroupNotifications n)
2447 lock (_groupNotificationSubscribers)
2449 _groupNotificationSubscribers.Remove(n);
2453 public void subscribe(ILicenseNotifications n)
2455 lock (_licenseNotificationSubscribers)
2457 _licenseNotificationSubscribers.Add(n);
2461 public void unsubscribe(ILicenseNotifications n)
2463 lock (_licenseNotificationSubscribers)
2465 _licenseNotificationSubscribers.Remove(n);
2469 public void subscribe(IHumanBiometricsNotifications n)
2471 lock (_humanBiometricsNotifications)
2473 _humanBiometricsNotifications.Add(n);
2477 public void unsubscribe(IHumanBiometricsNotifications n)
2479 lock (_humanBiometricsNotifications)
2481 _humanBiometricsNotifications.Remove(n);
2485 public void subscribe(IBridgeNotifications n)
2487 lock (_bridgeNotificationSubscribers)
2489 _bridgeNotificationSubscribers.Add(n);
2493 public void unsubscribe(IBridgeNotifications n)
2495 lock (_bridgeNotificationSubscribers)
2497 _bridgeNotificationSubscribers.Remove(n);
2501 public void subscribe(ILoggingNotifications n)
2503 lock (_loggingNotificationSubscribers)
2505 _loggingNotificationSubscribers.Add(n);
2507 if(_loggingNotificationSubscribers.Count() == 1)
2509 engageSetLoggingOutputOverride(on_ENGAGE_LOG_MESSAGE_HOOK_CALLBACK);
2514 public void unsubscribe(ILoggingNotifications n)
2516 lock (_loggingNotificationSubscribers)
2518 _loggingNotificationSubscribers.Remove(n);
2520 if(_loggingNotificationSubscribers.Count() == 0)
2522 engageSetLoggingOutputOverride(
null);
2527 public void subscribe(IAudioRecordingNotifications n)
2529 lock (_audioRecordingNotificationSubscribers)
2531 _audioRecordingNotificationSubscribers.Add(n);
2535 public void unsubscribe(IAudioRecordingNotifications n)
2537 lock (_audioRecordingNotificationSubscribers)
2539 _audioRecordingNotificationSubscribers.Remove(n);
2543 public void win32Init()
2545 engageWin32LibraryInit();
2548 public void win32DeInit()
2550 engageWin32LibraryDeinit();
2553 public int initialize(
string enginePolicyConfiguration,
string userIdentity,
string tempStoragePath)
2557 rc = registerEventCallbacks();
2558 if(rc != ENGAGE_RESULT_OK)
2563 return engageInitialize(enginePolicyConfiguration, userIdentity, tempStoragePath);
2566 public int shutdown()
2575 return engageStart();
2580 return engageStop();
2583 public int createGroup(
string jsonConfiguration)
2585 return engageCreateGroup(jsonConfiguration);
2588 public int deleteGroup(
string id)
2590 return engageDeleteGroup(
id);
2593 public int joinGroup(
string id)
2595 return engageJoinGroup(
id);
2598 public int leaveGroup(
string id)
2600 return engageLeaveGroup(
id);
2603 public int setGroupRules(
string id,
string jsonParams)
2605 return engageSetGroupRules(
id, jsonParams);
2608 public int beginGroupTx(
string id,
int txPriority,
int txFlags)
2610 return engageBeginGroupTx(
id, txPriority, txFlags);
2613 public int beginGroupTxAdvanced(
string id,
string jsonParams)
2615 return engageBeginGroupTxAdvanced(
id, jsonParams);
2618 public int endGroupTx(
string id)
2620 return engageEndGroupTx(
id);
2623 public int setGroupRxTag(
string id,
int tag)
2625 return engageSetGroupRxTag(
id, tag);
2628 public int muteGroupRx(
string id)
2630 return engageMuteGroupRx(
id);
2633 public int unmuteGroupRx(
string id)
2635 return engageUnmuteGroupRx(
id);
2638 public int muteGroupTx(
string id)
2640 return engageMuteGroupTx(
id);
2643 public int unmuteGroupTx(
string id)
2645 return engageUnmuteGroupTx(
id);
2648 public int setGroupRxVolume(
string id,
int left,
int right)
2650 return engageSetGroupRxVolume(
id, left, right);
2653 public int queryGroupTimeline(
string id,
string jsonParams)
2655 return engageQueryGroupTimeline(
id, jsonParams);
2658 public int queryGroupHealth(
string id)
2660 return engageQueryGroupHealth(
id);
2663 public int queryGroupStats(
string id)
2665 return engageQueryGroupStats(
id);
2668 public int logMsg(
int level,
string tag,
string msg)
2670 return engageLogMsg(level, tag, msg);
2673 public int setLogLevel(
int level)
2675 return engageSetLogLevel(level);
2678 public int setLogTagExtensionLevel(
string tagExtension)
2680 return engageSetLogTagExtension(tagExtension);
2683 public int enableSyslog(
bool enable)
2685 return engageEnableSyslog(enable ? 1 : 0);
2688 public int enableWatchdog(
bool enable)
2690 return engageWatchdog(enable ? 1 : 0);
2693 public String getVersion()
2695 IntPtr ptr = engageGetVersion();
2697 if (ptr == IntPtr.Zero)
2703 return Marshal.PtrToStringAnsi(ptr);
2707 public String getHardwareReport()
2709 IntPtr ptr = engageGetHardwareReport();
2711 if (ptr == IntPtr.Zero)
2717 return Marshal.PtrToStringAnsi(ptr);
2721 public String getActiveLicenseDescriptor()
2723 IntPtr ptr = engageGetActiveLicenseDescriptor();
2725 if (ptr == IntPtr.Zero)
2731 return Marshal.PtrToStringAnsi(ptr);
2735 public String getLicenseDescriptor(
string entitlement,
string key,
string activationCode,
string manufacturerId)
2737 IntPtr ptr = engageGetLicenseDescriptor(entitlement, key, activationCode, manufacturerId);
2739 if (ptr == IntPtr.Zero)
2745 return Marshal.PtrToStringAnsi(ptr);
2749 public int updateLicense(
string entitlement,
string key,
string activationCode,
string manufacturerId)
2751 return engageUpdateLicense(entitlement, key, activationCode, manufacturerId);
2754 public String getNetworkInterfaceDevices()
2756 IntPtr ptr = engageGetNetworkInterfaceDevices();
2758 if (ptr == IntPtr.Zero)
2764 return Marshal.PtrToStringAnsi(ptr);
2768 public String getAudioDevices()
2770 IntPtr ptr = engageGetAudioDevices();
2772 if (ptr == IntPtr.Zero)
2778 return Marshal.PtrToStringAnsi(ptr);
2782 public int setMissionId(
string missionId)
2784 return engageSetMissionId(missionId);
2787 public int openCertStore(
string fileName,
string passwordHexByteString)
2789 return engageOpenCertStore(fileName, passwordHexByteString);
2792 public String getCertStoreDescriptor()
2794 IntPtr ptr = engageGetCertStoreDescriptor();
2796 if (ptr == IntPtr.Zero)
2802 return Marshal.PtrToStringAnsi(ptr);
2806 public int closeCertStore()
2808 return engageCloseCertStore();
2811 public int setCertStoreCertificatePem(
string id,
string certificatePem,
string privateKeyPem,
string tags)
2813 return engageSetCertStoreCertificatePem(
id, certificatePem, privateKeyPem, tags);
2816 public int setCertStoreCertificateP12(
string id,
byte[] data,
int size,
string password,
string tags)
2818 IntPtr pinned_data = Marshal.AllocHGlobal(size);
2819 Marshal.Copy(data, 0, pinned_data, size);
2820 int rc = engageSetCertStoreCertificateP12(
id, pinned_data, size, password, tags);
2821 Marshal.FreeHGlobal(pinned_data);
2826 public int deleteCertStoreCertificate(
string id)
2828 return engageDeleteCertStoreCertificate(
id);
2831 public String getCertStoreCertificatePem(
string id)
2833 IntPtr ptr = engageGetCertStoreCertificatePem(
id);
2835 if (ptr == IntPtr.Zero)
2841 return Marshal.PtrToStringAnsi(ptr);
2845 public String getArrayOfCertificateDescriptorsFromPem(
string pem)
2847 IntPtr ptr = engageGetArrayOfCertificateDescriptorsFromPem(pem);
2849 if (ptr == IntPtr.Zero)
2855 return Marshal.PtrToStringAnsi(ptr);
2859 public String getCertificateDescriptorFromPem(
string pem)
2861 IntPtr ptr = engageGetCertificateDescriptorFromPem(pem);
2863 if (ptr == IntPtr.Zero)
2869 return Marshal.PtrToStringAnsi(ptr);
2873 public int importCertStoreElementFromCertStore(
string id,
string srcId,
string srcFileName,
string srcPasswordHexByteString,
string tags)
2875 return engageImportCertStoreElementFromCertStore(
id, srcId, srcFileName, srcPasswordHexByteString, tags);
2878 public String queryCertStoreContents(
string fileName,
string passwordHexByteString)
2880 IntPtr ptr = engageQueryCertStoreContents(fileName, passwordHexByteString);
2882 if (ptr == IntPtr.Zero)
2888 return Marshal.PtrToStringAnsi(ptr);
2892 public int encrypt(
byte[] src,
int size, out
byte[] dst,
string passwordHexByteString)
2895 IntPtr pinned_src = Marshal.AllocHGlobal(size);
2896 Marshal.Copy(src, 0, pinned_src, size);
2899 IntPtr pinned_dst = Marshal.AllocHGlobal(size + 16 + 16);
2901 int bytesEncrypted = engageEncrypt(pinned_src, size, pinned_dst, passwordHexByteString);
2903 if(bytesEncrypted > 0)
2905 dst =
new byte[bytesEncrypted];
2906 Marshal.Copy(pinned_dst, dst, 0, bytesEncrypted);
2914 Marshal.FreeHGlobal(pinned_src);
2915 Marshal.FreeHGlobal(pinned_dst);
2917 return bytesEncrypted;
2920 public int decrypt(
byte[] src,
int size, out
byte[] dst,
string passwordHexByteString)
2923 IntPtr pinned_src = Marshal.AllocHGlobal(size);
2924 Marshal.Copy(src, 0, pinned_src, size);
2927 IntPtr pinned_dst = Marshal.AllocHGlobal(size + 16);
2929 int bytesDecrypted = engageDecrypt(pinned_src, size, pinned_dst, passwordHexByteString);
2931 if (bytesDecrypted > 0)
2933 dst =
new byte[bytesDecrypted];
2934 Marshal.Copy(pinned_dst, dst, 0, bytesDecrypted);
2942 Marshal.FreeHGlobal(pinned_src);
2943 Marshal.FreeHGlobal(pinned_dst);
2945 return bytesDecrypted;
3048 public String generateMission(
string keyPhrase,
int audioGroupCount,
string rallypointHost,
string missionName)
3050 IntPtr ptr = engageGenerateMission(keyPhrase, audioGroupCount, rallypointHost, missionName);
3052 if (ptr == IntPtr.Zero)
3058 return Marshal.PtrToStringAnsi(ptr);
3062 public String generateMissionUsingCertStore(
string keyPhrase,
int audioGroupCount,
string rallypointHost,
string missionName,
string certStoreFn,
string certStorePasswordHexByteString,
string certStoreElement)
3064 IntPtr ptr = engageGenerateMissionUsingCertStore(keyPhrase, audioGroupCount, rallypointHost, missionName, certStoreFn, certStorePasswordHexByteString, certStoreElement);
3066 if (ptr == IntPtr.Zero)
3072 return Marshal.PtrToStringAnsi(ptr);
3076 public int updatePresenceDescriptor(
string id,
string jsonDescriptor,
bool forceBeacon)
3078 return engageUpdatePresenceDescriptor(
id, jsonDescriptor, (forceBeacon ? 1 : 0));
3081 public int setFipsCrypto(
string jsonParams)
3083 return engageSetFipsCrypto(jsonParams);
3086 public bool isCryptoFipsValidated()
3088 return (engageIsCryptoFipsValidated() == 1 ?
true : false);
3091 public int beginGroupPcmPowerTracking(
string id)
3093 return engageBeginGroupPcmPowerTracking(
id);
3096 public int endGroupPcmPowerTracking(
string id)
3098 return engageEndGroupPcmPowerTracking(
id);
3105 public static uint swapEndianness(uint x)
3107 return ((x & 0x000000ff) << 24) +
3108 ((x & 0x0000ff00) << 8) +
3109 ((x & 0x00ff0000) >> 8) +
3110 ((x & 0xff000000) >> 24);
3113 public static string humanBiometricsFromBlob(
byte[] blob)
3115 JArray dataSeriesArray;
3120 dataSeriesArray =
new JArray();
3123 int bytesLeftInTheBlob = blob.Length;
3126 GCHandle pinnedBlob = GCHandle.Alloc(blob, GCHandleType.Pinned);
3129 IntPtr ptr = pinnedBlob.AddrOfPinnedObject();
3132 while(bytesLeftInTheBlob > 0)
3135 DataSeriesHeader hdr = (DataSeriesHeader)Marshal.PtrToStructure(ptr, typeof(DataSeriesHeader));
3138 if (BitConverter.IsLittleEndian)
3140 hdr.ts = swapEndianness(hdr.ts);
3144 JObject se =
new JObject();
3147 se[
"t"] = (int)hdr.t;
3149 se[
"it"] = (int)hdr.it;
3150 se[
"im"] = (int)hdr.im;
3151 se[
"vt"] = (int)hdr.vt;
3154 ptr = IntPtr.Add(ptr, 9);
3155 bytesLeftInTheBlob -= 9;
3160 JArray s =
new JArray();
3164 for (
byte x = 0; x < hdr.ss; x++)
3166 DataElementUint8 de = (DataElementUint8)Marshal.PtrToStructure(ptr, typeof(DataElementUint8));
3171 ptr = IntPtr.Add(ptr, 2);
3172 bytesLeftInTheBlob -= 2;
3175 else if (hdr.vt == 2)
3179 else if (hdr.vt == 3)
3183 else if (hdr.vt == 4)
3193 dataSeriesArray.Add(se);
3200 dataSeriesArray =
null;
3201 Trace.WriteLine(e.StackTrace);
3206 if(dataSeriesArray !=
null)
3208 JObject hbmData =
new JObject();
3209 hbmData[
"data"] = dataSeriesArray;
3210 rc = hbmData.ToString();
3216 public int platformNotifyChanges(
string jsonChangesArray)
3218 return engagePlatformNotifyChanges(jsonChangesArray);
3221 public String getDeviceId()
3223 IntPtr ptr = engageGetDeviceId();
3225 if (ptr == IntPtr.Zero)
3231 return Marshal.PtrToStringAnsi(ptr);
3235 public int verifyRiff(
string fn)
3237 return engageVerifyRiff(fn);
3240 public String getRiffDescriptor(
string fn)
3242 IntPtr ptr = engageGetRiffDescriptor(fn);
3244 if (ptr == IntPtr.Zero)
3250 return Marshal.PtrToStringAnsi(ptr);