mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-24 16:16:10 +08:00
emscripten : add rx duration frames api getter (#100)
* Add rxDurationFrames api getter * Fixed comment --------- Co-authored-by: Vittorio Palmisano <vittorio.palmisano@ringcentral.com>
This commit is contained in:
committed by
GitHub
parent
c2716d8cff
commit
bac95c8113
@@ -75,7 +75,7 @@ EMSCRIPTEN_BINDINGS(ggwave) {
|
||||
|
||||
int nActual = ggwave_encode(instance, data.data(), data.size(), protocolId, volume, result.data(), 0);
|
||||
|
||||
printf("n = %d, nActual = %d\n", n, nActual);
|
||||
// printf("n = %d, nActual = %d\n", n, nActual);
|
||||
return emscripten::val(emscripten::typed_memory_view(nActual, result.data()));
|
||||
}));
|
||||
|
||||
@@ -128,4 +128,9 @@ EMSCRIPTEN_BINDINGS(ggwave) {
|
||||
int freqStart) {
|
||||
ggwave_txProtocolSetFreqStart(protocolId, freqStart);
|
||||
}));
|
||||
|
||||
emscripten::function("rxDurationFrames", emscripten::optional_override(
|
||||
[](ggwave_Instance instance) {
|
||||
return ggwave_rxDurationFrames(instance);
|
||||
}));
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -340,6 +340,10 @@ extern "C" {
|
||||
ggwave_ProtocolId protocolId,
|
||||
int freqStart);
|
||||
|
||||
// Return recvDuration_frames value for a rx protocol
|
||||
GGWAVE_API int ggwave_rxDurationFrames(
|
||||
ggwave_Instance instance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -736,6 +740,7 @@ public:
|
||||
int rxFramesLeftToRecord() const;
|
||||
int rxFramesToAnalyze() const;
|
||||
int rxFramesLeftToAnalyze() const;
|
||||
int rxDurationFrames() const;
|
||||
|
||||
bool rxStopReceiving();
|
||||
|
||||
|
||||
@@ -218,6 +218,12 @@ void ggwave_txProtocolSetFreqStart(
|
||||
GGWave::Protocols::tx()[protocolId].freqStart = freqStart;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
int ggwave_rxDurationFrames(ggwave_Instance id) {
|
||||
GGWave * ggWave = (GGWave *) g_instances[id];
|
||||
return ggWave->rxDurationFrames();
|
||||
}
|
||||
|
||||
//
|
||||
// C++ implementation
|
||||
//
|
||||
@@ -1255,6 +1261,7 @@ int GGWave::rxFramesToRecord() const { return m_rx.framesToRecord; }
|
||||
int GGWave::rxFramesLeftToRecord() const { return m_rx.framesLeftToRecord; }
|
||||
int GGWave::rxFramesToAnalyze() const { return m_rx.framesToAnalyze; }
|
||||
int GGWave::rxFramesLeftToAnalyze() const { return m_rx.framesLeftToAnalyze; }
|
||||
int GGWave::rxDurationFrames() const { return m_rx.recvDuration_frames; }
|
||||
|
||||
bool GGWave::rxStopReceiving() {
|
||||
if (m_rx.receiving == false) {
|
||||
|
||||
Reference in New Issue
Block a user