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 TIMER_H
mkersh3 0:e7ca326e76ee 3 #define TIMER_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 RtosTimer class allow creating and and controlling of timer functions in the system.
mkersh3 0:e7ca326e76ee 11 A timer function is called when a time period expires whereby both on-shot and
mkersh3 0:e7ca326e76ee 12 periodic timers are possible. A timer can be started, restarted, or stopped.
mkersh3 0:e7ca326e76ee 13
mkersh3 0:e7ca326e76ee 14 Timers are handled in the thread osTimerThread.
mkersh3 0:e7ca326e76ee 15 Callback functions run under control of this thread and may use CMSIS-RTOS API calls.
mkersh3 0:e7ca326e76ee 16 */
mkersh3 0:e7ca326e76ee 17 class RtosTimer {
mkersh3 0:e7ca326e76ee 18 public:
mkersh3 0:e7ca326e76ee 19 /*! Create and Start timer.
mkersh3 0:e7ca326e76ee 20 \param task name of the timer call back function.
mkersh3 0:e7ca326e76ee 21 \param type osTimerOnce for one-shot or osTimerPeriodic for periodic behaviour. (default: osTimerPeriodic)
mkersh3 0:e7ca326e76ee 22 \param argument argument to the timer call back function. (default: NULL)
mkersh3 0:e7ca326e76ee 23 */
mkersh3 0:e7ca326e76ee 24 RtosTimer(void (*task)(void const *argument),
mkersh3 0:e7ca326e76ee 25 os_timer_type type=osTimerPeriodic,
mkersh3 0:e7ca326e76ee 26 void *argument=NULL);
mkersh3 0:e7ca326e76ee 27
mkersh3 0:e7ca326e76ee 28 /*! Stop the timer.
mkersh3 0:e7ca326e76ee 29 \return status code that indicates the execution status of the function.
mkersh3 0:e7ca326e76ee 30 */
mkersh3 0:e7ca326e76ee 31 osStatus stop(void);
mkersh3 0:e7ca326e76ee 32
mkersh3 0:e7ca326e76ee 33 /*! start a timer.
mkersh3 0:e7ca326e76ee 34 \param millisec time delay value of the timer.
mkersh3 0:e7ca326e76ee 35 \return status code that indicates the execution status of the function.
mkersh3 0:e7ca326e76ee 36 */
mkersh3 0:e7ca326e76ee 37 osStatus start(uint32_t millisec);
mkersh3 0:e7ca326e76ee 38
mkersh3 0:e7ca326e76ee 39 ~RtosTimer();
mkersh3 0:e7ca326e76ee 40
mkersh3 0:e7ca326e76ee 41 private:
mkersh3 0:e7ca326e76ee 42 osTimerId _timer_id;
mkersh3 0:e7ca326e76ee 43 osTimerDef_t _timer;
mkersh3 0:e7ca326e76ee 44 #ifdef CMSIS_OS_RTX
mkersh3 0:e7ca326e76ee 45 uint32_t _timer_data[5];
mkersh3 0:e7ca326e76ee 46 #endif
mkersh3 0:e7ca326e76ee 47 };
mkersh3 0:e7ca326e76ee 48
mkersh3 0:e7ca326e76ee 49 }
mkersh3 0:e7ca326e76ee 50
mkersh3 0:e7ca326e76ee 51 #endif