main/duktape_event.c
void event_newCallbackRequestedEvent(
	uint32_t callbackType,
	uint32_t stashKey,
	esp32_duktape_callback_dataprovider dataProvider,
	void *contextData) {

	LOGD(">> event_newCallbackRequestedEvent stashKey=%d", stashKey);
	esp32_duktape_event_t event;
	event.type = ESP32_DUKTAPE_EVENT_CALLBACK_REQUESTED;
	if (callbackType != ESP32_DUKTAPE_CALLBACK_TYPE_FUNCTION &&
			callbackType != ESP32_DUKTAPE_CALLBACK_TYPE_ISR_FUNCTION) {
		LOGE("event_newCallbackRequestedEvent: Unknown callbackType: %d", callbackType);
		return;
	}
	event.callbackRequested.callbackType = callbackType;
	event.callbackRequested.stashKey     = stashKey;
	event.callbackRequested.dataProvider = dataProvider;
	event.callbackRequested.context      = contextData;
	if (callbackType == ESP32_DUKTAPE_CALLBACK_TYPE_ISR_FUNCTION) {
		postEvent(&event, true);
	} else {
		postEvent(&event, false);
	}
	LOGD("<< event_newCallbackRequestedEvent");
}
/**
 * Build and post a new CallbackRequestedEvent.  This kind of event is used to indicate
 * to the runtime that a C function outside the context of any JavaScript framework
 * wishes a function to be invoked.  The function will be found identified by the
 * stashKey parameter.
 * * callbackType - The type of callback.  Choices are:
 *   - ESP32_DUKTAPE_CALLBACK_TYPE_FUNCTION - General function callback.  This is a one time callback
 *      and the data associated with it will be deleted after being called.
 * * stashKey - A key to an array stash which holds the JS function to be called plus any
 *              parameters to that function.
 * * dataProvider - a function that will be called to add parameters to the eventual JS callback.
 *                  This can be NULL if no such function is desired.
 * * contextData - ??
 */
Build and post a new CallbackRequestedEvent.  This kind of event is used to indicate
to the runtime that a C function outside the context of any JavaScript framework
wishes a function to be invoked.  The function will be found identified by the
stashKey parameter.
callbackType - The type of callback.  Choices are:
- ESP32_DUKTAPE_CALLBACK_TYPE_FUNCTION - General function callback.  This is a one time callback
and the data associated with it will be deleted after being called.
stashKey - A key to an array stash which holds the JS function to be called plus any
parameters to that function.
dataProvider - a function that will be called to add parameters to the eventual JS callback.
This can be NULL if no such function is desired.
Build and post a new CallbackRequestedEvent . This kind of event is used to indicate to the runtime that a C function outside the context of any JavaScript framework wishes a function to be invoked . The function will be found identified by the stashKey parameter . callbackType - The type of callback . Choices are : - ESP32_DUKTAPE_CALLBACK_TYPE_FUNCTION - General function callback . This is a one time callback and the data associated with it will be deleted after being called . stashKey - A key to an array stash which holds the JS function to be called plus any parameters to that function . dataProvider - a function that will be called to add parameters to the eventual JS callback . This can be NULL if no such function is desired .
void event_newCallbackRequestedEvent(
	uint32_t callbackType,
	uint32_t stashKey,
	esp32_duktape_callback_dataprovider dataProvider,
	void *contextData) {
	LOGD(">> event_newCallbackRequestedEvent stashKey=%d", stashKey);
	esp32_duktape_event_t event;
	event.type = ESP32_DUKTAPE_EVENT_CALLBACK_REQUESTED;
	if (callbackType != ESP32_DUKTAPE_CALLBACK_TYPE_FUNCTION &&
			callbackType != ESP32_DUKTAPE_CALLBACK_TYPE_ISR_FUNCTION) {
		LOGE("event_newCallbackRequestedEvent: Unknown callbackType: %d", callbackType);
		return;
	}
	event.callbackRequested.callbackType = callbackType;
	event.callbackRequested.stashKey     = stashKey;
	event.callbackRequested.dataProvider = dataProvider;
	event.callbackRequested.context      = contextData;
	if (callbackType == ESP32_DUKTAPE_CALLBACK_TYPE_ISR_FUNCTION) {
		postEvent(&event, true);
	} else {
		postEvent(&event, false);
	}
	LOGD("<< event_newCallbackRequestedEvent");
}
void event_newCallbackRequestedEvent ( uint32_t callbackType , uint32_t stashKey , esp32_duktape_callback_dataprovider dataProvider , void * contextData ) { LOGD ( " " , stashKey ) ; esp32_duktape_event_t event ; event . type = ESP32_DUKTAPE_EVENT_CALLBACK_REQUESTED ; if ( callbackType != ESP32_DUKTAPE_CALLBACK_TYPE_FUNCTION && callbackType != ESP32_DUKTAPE_CALLBACK_TYPE_ISR_FUNCTION ) { LOGE ( " " , callbackType ) ; return ; } event . callbackRequested . callbackType = callbackType ; event . callbackRequested . stashKey = stashKey ; event . callbackRequested . dataProvider = dataProvider ; event . callbackRequested . context = contextData ; if ( callbackType == ESP32_DUKTAPE_CALLBACK_TYPE_ISR_FUNCTION ) { postEvent ( & event , true ) ; } else { postEvent ( & event , false ) ; } LOGD ( " " ) ; }
Build and post a new CallbackRequestedEvent.
Build and post a new CallbackRequestedEvent .