USBD_PHDC_OS_WrBulkLock
Description
Lock the write bulk pipe.
Files
usbd_phdc_os.h / usbd_phdc_os.c
Prototype
void USBD_PHDC_OS_WrBulkLock (CPU_INT08U class_nbr, CPU_INT08U prio, CPU_INT16U timeout, USBD_ERR *p_err);
Arguments
class_nbr
PHDC instance number.
prio
Priority of the transfer. This value is between 0 and 4 and is computed in function of the transfer’s QoS by the caller.
timeout
Timeout.
p_err
Pointer to variable that will receive the return error code from this function.
Returned Value
None.
Callers
Personal Healthcare Device Class.
Implementation guidelines
- Two typical implementations will be possible here. The first one consists in pending on a semaphore that locks the write bulk pipe, just as we saw previously.
- But since different QoS data can travel using a single bulk IN endpoint, you might want to prioritize them in function of the QoS. See PHDC RTOS QoS-based scheduler for more details on how a priority manager can be implemented.
p_err
argument should be assigned as described in Table - Error Code Assignment in Function of Lock Operation Result.