/* Set bit 8 in the 0th notification value of the task referenced by xTask1Handle. Store the task's previous 0th notification value (before bit 8 is set) in ulPreviousValue. */ xTaskNotifyAndQueryIndexed( xTask1Handle, 0, ( 1UL << 8UL ), eSetBits, &ulPreviousValue );
/* Send a notification to the task referenced by xTask2Handle, potentially removing the task from the Blocked state, but without updating the task's notification value. Store the tasks notification value in ulPreviousValue. */ xTaskNotifyAndQuery( xTask2Handle, 0, eNoAction, &ulPreviousValue );
/* Set the notification value of the task referenced by xTask3Handle to 0x50, even if the task had not read its previous notification value. The task's previous notification value is of no interest so the last parameter is set to NULL. */ xTaskNotifyAndQuery( xTask3Handle, 0x50, eSetValueWithOverwrite, NULL );
/* Set the notification value of the task referenced by xTask4Handle to 0xfff, but only if to do so would not overwrite the task's existing notification value before the task had obtained it (by a call to xTaskNotifyWait() or ulTaskNotifyTake()). The task's previous notification value is saved in ulPreviousValue. */ if( xTaskNotifyAndQuery( xTask4Handle, 0xfff, eSetValueWithoutOverwrite, &ulPreviousValue ) == pdPASS ) { /* The task's notification value was updated. */ } else { /* The task's notification value was not updated. */ }