Ai-Thinker-Open / GPRS_C_SDK

Ai-Thinker A9/A9G GPRS (with GPS(A9G)) module C development SDK
https://ai-thinker-open.github.io/GPRS_C_SDK_DOC
MIT License
449 stars 235 forks source link

How to check if resource is available using semaphore without block #474

Open ahmedwahdan opened 3 years ago

ahmedwahdan commented 3 years ago

1. SDK version(SDK 版本)

{

v 2.112

}


2. In what kind of operation problems appear, and how to reproduce the problem ?(什么样的操作步骤问题会出现,是否是稳定复现,如何复现问题?)

{

I want to check the resource availability without blocking, but it seems I got blocked using the foloowing code bool Is_Connection_Available(void) { Trace(1, "Check for connection"); bool retVal = OS_WaitForSemaphore(ConnectionAvaialbleSemaphore, 0U); Trace(1, "Connections state is %d", retVal); return retVal; }

}