Common operations


#define oc_activate_interrupt_handler(name)   (oc_process_start(&(name##_interrupt_x), 0))
 activate the interrupt handler More...
#define oc_define_interrupt_handler(name)
 define the interrupt handler More...
#define oc_signal_interrupt_handler(name)
 API for setting handlers for interrupts. More...


void oc_remove_delayed_callback (void *cb_data, oc_trigger_t callback)
 used to cancel a delayed callback More...
void oc_set_delayed_callback (void *cb_data, oc_trigger_t callback, uint16_t seconds)
 Schedule a callback to be invoked after a set number of seconds. More...
void oc_set_immutable_device_identifier (size_t device, oc_uuid_t *piid)
 Set the immutable device identifier. More...

Detailed Description

Macro Definition Documentation

◆ oc_activate_interrupt_handler

#define oc_activate_interrupt_handler (   name)    (oc_process_start(&(name##_interrupt_x), 0))

activate the interrupt handler

◆ oc_define_interrupt_handler

#define oc_define_interrupt_handler (   name)
void name##_interrupt_x_handler(void); \
OC_PROCESS(name##_interrupt_x, ""); \
OC_PROCESS_THREAD(name##_interrupt_x, ev, data) \
{ \
(void)data; \
OC_PROCESS_POLLHANDLER(name##_interrupt_x_handler()); \
while (oc_process_is_running(&(name##_interrupt_x))) { \
} \
} \
void name##_interrupt_x_handler(void)

define the interrupt handler

◆ oc_signal_interrupt_handler

#define oc_signal_interrupt_handler (   name)
do { \
oc_process_poll(&(name##_interrupt_x)); \
_oc_signal_event_loop(); \
} while (0)

API for setting handlers for interrupts.

Function Documentation

◆ oc_remove_delayed_callback()

void oc_remove_delayed_callback ( void *  cb_data,
oc_trigger_t  callback 

used to cancel a delayed callback

[in]cb_datathe user defined context pointer that was passed to the oc_sed_delayed_callback() function
[in]callbackthe delayed callback that is being removed

◆ oc_set_delayed_callback()

void oc_set_delayed_callback ( void *  cb_data,
oc_trigger_t  callback,
uint16_t  seconds 

Schedule a callback to be invoked after a set number of seconds.

[in]cb_datauser defined context pointer that is passed to the oc_trigger_t callback
[in]callbackthe callback invoked after the set number of seconds
[in]secondsthe number of seconds to wait till the callback is invoked

◆ oc_set_immutable_device_identifier()

void oc_set_immutable_device_identifier ( size_t  device,
oc_uuid_t *  piid 

Set the immutable device identifier.

This will set the piid device property (a.k.a Protocol Independent ID)

Unlike device id di device property the piid will remain the same even after device resets.

[in]devicethe logical device index
[in]piidthe UUID for the immutable device identifier