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 #include "Semaphore.h"
mkersh3 0:e7ca326e76ee 2
mkersh3 0:e7ca326e76ee 3 #include <string.h>
mkersh3 0:e7ca326e76ee 4 #include "error.h"
mkersh3 0:e7ca326e76ee 5
mkersh3 0:e7ca326e76ee 6 namespace rtos {
mkersh3 0:e7ca326e76ee 7
mkersh3 0:e7ca326e76ee 8 Semaphore::Semaphore(int32_t count) {
mkersh3 0:e7ca326e76ee 9 #ifdef CMSIS_OS_RTX
mkersh3 0:e7ca326e76ee 10 memset(_semaphore_data, 0, sizeof(_semaphore_data));
mkersh3 0:e7ca326e76ee 11 _osSemaphoreDef.semaphore = _semaphore_data;
mkersh3 0:e7ca326e76ee 12 #endif
mkersh3 0:e7ca326e76ee 13 _osSemaphoreId = osSemaphoreCreate(&_osSemaphoreDef, count);
mkersh3 0:e7ca326e76ee 14 }
mkersh3 0:e7ca326e76ee 15
mkersh3 0:e7ca326e76ee 16 int32_t Semaphore::wait(uint32_t millisec) {
mkersh3 0:e7ca326e76ee 17 return osSemaphoreWait(_osSemaphoreId, millisec);
mkersh3 0:e7ca326e76ee 18 }
mkersh3 0:e7ca326e76ee 19
mkersh3 0:e7ca326e76ee 20 osStatus Semaphore::release(void) {
mkersh3 0:e7ca326e76ee 21 return osSemaphoreRelease(_osSemaphoreId);
mkersh3 0:e7ca326e76ee 22 }
mkersh3 0:e7ca326e76ee 23
mkersh3 0:e7ca326e76ee 24 Semaphore::~Semaphore() {
mkersh3 0:e7ca326e76ee 25 osSemaphoreDelete(_osSemaphoreId);
mkersh3 0:e7ca326e76ee 26 }
mkersh3 0:e7ca326e76ee 27
mkersh3 0:e7ca326e76ee 28 }