/// Connection status struct.
typedef struct {
- u32 event_type;
+ u32 status;
u32 unk_x4[0x28>>2];
u8 id8;
u8 pad_x2d[3];
*/
Result udsGetConnectionStatus(udsConnectionStatus *output);
+/**
+ * @brief Waits for the ConnectionStatus event to occur, or checks if the event was signalled. This event is signalled when the data from udsGetConnectionStatus() was updated internally.
+ * @return Always true. However if wait=false, this will return false if the event wasn't signalled.
+ * @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 udsWaitConnectionStatusEvent(bool nextEvent, bool wait);
+
/**
* @brief This loads a NodeInfo struct for the specified NetworkNodeID. The broadcast alias can't be used with this.
* @param NetworkNodeID Target NetworkNodeID.
return ret;
}
+bool udsWaitConnectionStatusEvent(bool nextEvent, bool wait)
+{
+ bool ret = true;
+ u64 delayvalue = U64_MAX;
+
+ if(!wait)delayvalue = 0;
+
+ if(nextEvent)svcClearEvent(__uds_connectionstatus_event);
+
+ if(svcWaitSynchronization(__uds_connectionstatus_event, delayvalue)!=0 && !wait)ret = false;
+
+ if(!nextEvent)svcClearEvent(__uds_connectionstatus_event);
+
+ return ret;
+}
+
Result udsGetNodeInformation(u16 NetworkNodeID, udsNodeInfo *output)
{
u32* cmdbuf=getThreadCommandBuffer();