PtAppSetResource()

Set a single application callback resource

Synopsis:

#define PtAppSetResource( type, value, len ) ...

Arguments:

type
The resource manifest.
value
The value of the argument being passed.
len
Depends on the type of resource.

Library:

ph

Description:

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.

Returns:

0
Success.
-1
An error occurred.

Examples:

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);

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtAppAddCallback(), PtAppGetResources(), PtAppGetResource(), PtAppRemoveCallback(), PtAppSetResources(), PtSetArg().