Added udsWaitDataAvailable(), based on gspWaitForEvent().
This commit is contained in:
parent
4123baba50
commit
d2f9655d8a
@ -182,6 +182,15 @@ Result udsBind(udsBindContext *bindcontext, u16 NetworkNodeID);
|
||||
*/
|
||||
Result udsUnbind(udsBindContext *bindcontext);
|
||||
|
||||
/**
|
||||
* @brief Waits for the bind event to occur, or checks if the event was signalled. This event is signalled every time new data is available via udsPullPacket().
|
||||
* @return Always true. However if wait=false, this will return false if the event wasn't signalled.
|
||||
* @param bindcontext The bind context.
|
||||
* @param nextEvent Whether to discard the current event and wait for the next event.
|
||||
* @param wait When true this will not return until the event is signalled. When false this checks if the event was signalled without waiting for it.
|
||||
*/
|
||||
bool udsWaitDataAvailable(udsBindContext *bindcontext, bool nextEvent, bool wait);
|
||||
|
||||
/**
|
||||
* @brief Receives data over the network.
|
||||
* @param bindcontext Bind context.
|
||||
|
@ -458,6 +458,22 @@ Result udsUnbind(udsBindContext *bindcontext)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool udsWaitDataAvailable(udsBindContext *bindcontext, bool nextEvent, bool wait)
|
||||
{
|
||||
bool ret = true;
|
||||
u64 delayvalue = U64_MAX;
|
||||
|
||||
if(!wait)delayvalue = 0;
|
||||
|
||||
if(nextEvent)svcClearEvent(bindcontext->event);
|
||||
|
||||
if(svcWaitSynchronization(bindcontext->event, delayvalue)!=0 && !wait)ret = false;
|
||||
|
||||
if(!nextEvent)svcClearEvent(bindcontext->event);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static Result usd_parsebeacon(u8 *buf, u32 size, udsNetworkScanInfo *networkscan)
|
||||
{
|
||||
Result ret=0;
|
||||
|
Loading…
Reference in New Issue
Block a user