Ethernet test for ECE 4180 and others to find your IP address and do a simple HTTP GET request over port 80.
Dependencies: mbed Socket lwip-eth lwip-sys lwip
mbed-rtos/rtos/Mutex.h@0:e7ca326e76ee, 2013-04-04 (annotated)
- Committer:
- mkersh3
- Date:
- Thu Apr 04 05:26:09 2013 +0000
- Revision:
- 0:e7ca326e76ee
Ethernet Test for ECE4180 and others to find their IP Address and do a simple HTTP GET request over port 80.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mkersh3 | 0:e7ca326e76ee | 1 | /* Copyright (c) 2012 mbed.org */ |
mkersh3 | 0:e7ca326e76ee | 2 | #ifndef MUTEX_H |
mkersh3 | 0:e7ca326e76ee | 3 | #define MUTEX_H |
mkersh3 | 0:e7ca326e76ee | 4 | |
mkersh3 | 0:e7ca326e76ee | 5 | #include <stdint.h> |
mkersh3 | 0:e7ca326e76ee | 6 | #include "cmsis_os.h" |
mkersh3 | 0:e7ca326e76ee | 7 | |
mkersh3 | 0:e7ca326e76ee | 8 | namespace rtos { |
mkersh3 | 0:e7ca326e76ee | 9 | |
mkersh3 | 0:e7ca326e76ee | 10 | /*! The Mutex class is used to synchronise the execution of threads. |
mkersh3 | 0:e7ca326e76ee | 11 | This is for example used to protect access to a shared resource. |
mkersh3 | 0:e7ca326e76ee | 12 | */ |
mkersh3 | 0:e7ca326e76ee | 13 | class Mutex { |
mkersh3 | 0:e7ca326e76ee | 14 | public: |
mkersh3 | 0:e7ca326e76ee | 15 | /*! Create and Initialize a Mutex object */ |
mkersh3 | 0:e7ca326e76ee | 16 | Mutex(); |
mkersh3 | 0:e7ca326e76ee | 17 | |
mkersh3 | 0:e7ca326e76ee | 18 | /*! Wait until a Mutex becomes available. |
mkersh3 | 0:e7ca326e76ee | 19 | \param millisec timeout value or 0 in case of no time-out. (default: osWaitForever) |
mkersh3 | 0:e7ca326e76ee | 20 | \return status code that indicates the execution status of the function. |
mkersh3 | 0:e7ca326e76ee | 21 | */ |
mkersh3 | 0:e7ca326e76ee | 22 | osStatus lock(uint32_t millisec=osWaitForever); |
mkersh3 | 0:e7ca326e76ee | 23 | |
mkersh3 | 0:e7ca326e76ee | 24 | /*! Try to lock the mutex, and return immediately |
mkersh3 | 0:e7ca326e76ee | 25 | \return true if the mutex was acquired, false otherwise. |
mkersh3 | 0:e7ca326e76ee | 26 | */ |
mkersh3 | 0:e7ca326e76ee | 27 | bool trylock(); |
mkersh3 | 0:e7ca326e76ee | 28 | |
mkersh3 | 0:e7ca326e76ee | 29 | /*! Unlock the mutex that has previously been locked by the same thread |
mkersh3 | 0:e7ca326e76ee | 30 | \return status code that indicates the execution status of the function. |
mkersh3 | 0:e7ca326e76ee | 31 | */ |
mkersh3 | 0:e7ca326e76ee | 32 | osStatus unlock(); |
mkersh3 | 0:e7ca326e76ee | 33 | |
mkersh3 | 0:e7ca326e76ee | 34 | ~Mutex(); |
mkersh3 | 0:e7ca326e76ee | 35 | |
mkersh3 | 0:e7ca326e76ee | 36 | private: |
mkersh3 | 0:e7ca326e76ee | 37 | osMutexId _osMutexId; |
mkersh3 | 0:e7ca326e76ee | 38 | osMutexDef_t _osMutexDef; |
mkersh3 | 0:e7ca326e76ee | 39 | #ifdef CMSIS_OS_RTX |
mkersh3 | 0:e7ca326e76ee | 40 | int32_t _mutex_data[3]; |
mkersh3 | 0:e7ca326e76ee | 41 | #endif |
mkersh3 | 0:e7ca326e76ee | 42 | }; |
mkersh3 | 0:e7ca326e76ee | 43 | |
mkersh3 | 0:e7ca326e76ee | 44 | } |
mkersh3 | 0:e7ca326e76ee | 45 | #endif |