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

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?

UserRevisionLine numberNew contents of line
mkersh3 0:e7ca326e76ee 1 /* Copyright (c) 2012 mbed.org */
mkersh3 0:e7ca326e76ee 2 #ifndef SEMAPHORE_H
mkersh3 0:e7ca326e76ee 3 #define SEMAPHORE_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 Semaphore class is used to manage and protect access to a set of shared resources. */
mkersh3 0:e7ca326e76ee 11 class Semaphore {
mkersh3 0:e7ca326e76ee 12 public:
mkersh3 0:e7ca326e76ee 13 /*! Create and Initialize a Semaphore object used for managing resources.
mkersh3 0:e7ca326e76ee 14 \param number of available resources; maximum index value is (count-1).
mkersh3 0:e7ca326e76ee 15 */
mkersh3 0:e7ca326e76ee 16 Semaphore(int32_t count);
mkersh3 0:e7ca326e76ee 17
mkersh3 0:e7ca326e76ee 18 /*! Wait until a Semaphore resource 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 number of available tokens, or -1 in case of incorrect parameters
mkersh3 0:e7ca326e76ee 21 */
mkersh3 0:e7ca326e76ee 22 int32_t wait(uint32_t millisec=osWaitForever);
mkersh3 0:e7ca326e76ee 23
mkersh3 0:e7ca326e76ee 24 /*! Release a Semaphore resource that was obtain with Semaphore::wait.
mkersh3 0:e7ca326e76ee 25 \return status code that indicates the execution status of the function.
mkersh3 0:e7ca326e76ee 26 */
mkersh3 0:e7ca326e76ee 27 osStatus release(void);
mkersh3 0:e7ca326e76ee 28
mkersh3 0:e7ca326e76ee 29 ~Semaphore();
mkersh3 0:e7ca326e76ee 30
mkersh3 0:e7ca326e76ee 31 private:
mkersh3 0:e7ca326e76ee 32 osSemaphoreId _osSemaphoreId;
mkersh3 0:e7ca326e76ee 33 osSemaphoreDef_t _osSemaphoreDef;
mkersh3 0:e7ca326e76ee 34 #ifdef CMSIS_OS_RTX
mkersh3 0:e7ca326e76ee 35 uint32_t _semaphore_data[2];
mkersh3 0:e7ca326e76ee 36 #endif
mkersh3 0:e7ca326e76ee 37 };
mkersh3 0:e7ca326e76ee 38
mkersh3 0:e7ca326e76ee 39 }
mkersh3 0:e7ca326e76ee 40 #endif