Set a single application callback resource
#define PtAppSetResource( type, value, len ) ...
ph
This function sets a resource for the application. The type argument contains the resource manifest and value contains the value of the argument being passed. The way the len argument is used depends on the resource type. For a list of application callbacks, see PtAppSetResources().
For more information, see the Manipulating Resources in Application Code chapter of the Photon Programmer's Guide.
int exit_cb(void *data, PtCallbackInfo_t *cbinfo) { printf( "I\'m exiting\n" ); return( Pt_CONTINUE ); }; ... PtAppCallback_t exit_callback = {exit_cb, NULL}}; PtAppSetResource(Pt_CB_APP_EXIT, &exit_callback, 0);
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PtAppAddCallback(), PtAppGetResources(), PtAppGetResource(), PtAppRemoveCallback(), PtAppSetResources(), PtSetArg().