ps3000aGetStreamingLatestValues
(
int16_t handle,
ps3000aStreamingReady lpPs3000AReady,
void * pParameter
)
lpPs3000AReady, a pointer to yourps3000aStreamingReadycallback functionpParameter, avoidpointer that will be passed to theps3000aStreamingReadycallback. The callback may optionally use this pointer to return information to the application.
And here is the ps3000aStreamingReady callback function:
typedef void (CALLBACK *ps3000aStreamingReady)
(
int16_t handle,
int32_t noOfSamples,
uint32_t startIndex,
int16_t overflow,
uint32_t triggerAt,
int16_t triggered,
int16_t autoStop,
void * pParameter
)
My question is how I can declare pParameter in my main function? pParameter use as a communicator between those two functions and it's a void pointer because it might have to pass any kinds of data.Somehow I have to allocate memory before pass this void pointer as a arguments on those function. But how can do that?
void*parameter to contain?void* userDatais the C-way to capture extra data, C++ way withstd::functionallow capturing lambda and even custom functor.void*. And you can add an explicit cast (in the function call) if you really want to.pParameterso that you can calllpPs3000AReady?