Webserver only w/o any other functions, single thread. Running on STM32F013+W5500
Dependencies: NTPClient W5500Interface Watchdog device_configuration eeprom_flash mbed-rpc-nucleo mbed-rtos mbed
Fork of F103-Serial-to-Ethernet by
RequestHandler.h@47:d92d2c5b8073, 2016-08-19 (annotated)
- Committer:
- olympux
- Date:
- Fri Aug 19 20:17:00 2016 +0000
- Revision:
- 47:d92d2c5b8073
- Parent:
- 40:c966abbe2d62
forked to create a new repo for webserver on F103+W5500. No other functions
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
olympux | 40:c966abbe2d62 | 1 | #ifndef REQUEST_HANDLER |
olympux | 40:c966abbe2d62 | 2 | #define REQUEST_HANDLER |
olympux | 40:c966abbe2d62 | 3 | |
olympux | 40:c966abbe2d62 | 4 | #include "RPCCommand.h" |
olympux | 40:c966abbe2d62 | 5 | |
olympux | 40:c966abbe2d62 | 6 | class RequestHandler |
olympux | 40:c966abbe2d62 | 7 | { |
olympux | 40:c966abbe2d62 | 8 | public : |
olympux | 40:c966abbe2d62 | 9 | |
olympux | 40:c966abbe2d62 | 10 | virtual void handle(const RPCCommand& cmd, char* reply) = 0; |
olympux | 40:c966abbe2d62 | 11 | }; |
olympux | 40:c966abbe2d62 | 12 | |
olympux | 40:c966abbe2d62 | 13 | class GetRequestHandler : public RequestHandler |
olympux | 40:c966abbe2d62 | 14 | { |
olympux | 40:c966abbe2d62 | 15 | public : |
olympux | 40:c966abbe2d62 | 16 | |
olympux | 40:c966abbe2d62 | 17 | virtual void handle(const RPCCommand& cmd, char* reply); |
olympux | 40:c966abbe2d62 | 18 | }; |
olympux | 40:c966abbe2d62 | 19 | |
olympux | 40:c966abbe2d62 | 20 | class PutRequestHandler : public RequestHandler |
olympux | 40:c966abbe2d62 | 21 | { |
olympux | 40:c966abbe2d62 | 22 | public : |
olympux | 40:c966abbe2d62 | 23 | |
olympux | 40:c966abbe2d62 | 24 | virtual void handle(const RPCCommand& cmd, char* reply); |
olympux | 40:c966abbe2d62 | 25 | |
olympux | 40:c966abbe2d62 | 26 | }; |
olympux | 40:c966abbe2d62 | 27 | |
olympux | 40:c966abbe2d62 | 28 | |
olympux | 40:c966abbe2d62 | 29 | class DeleteRequestHandler : public RequestHandler |
olympux | 40:c966abbe2d62 | 30 | { |
olympux | 40:c966abbe2d62 | 31 | public : |
olympux | 40:c966abbe2d62 | 32 | |
olympux | 40:c966abbe2d62 | 33 | virtual void handle(const RPCCommand& cmd, char* reply); |
olympux | 40:c966abbe2d62 | 34 | |
olympux | 40:c966abbe2d62 | 35 | }; |
olympux | 40:c966abbe2d62 | 36 | |
olympux | 40:c966abbe2d62 | 37 | class ComplexRequestHandler : public RequestHandler |
olympux | 40:c966abbe2d62 | 38 | { |
olympux | 40:c966abbe2d62 | 39 | public : |
olympux | 40:c966abbe2d62 | 40 | |
olympux | 40:c966abbe2d62 | 41 | virtual void handle(const RPCCommand& cmd, char* reply); |
olympux | 40:c966abbe2d62 | 42 | |
olympux | 40:c966abbe2d62 | 43 | private : |
olympux | 40:c966abbe2d62 | 44 | |
olympux | 40:c966abbe2d62 | 45 | GetRequestHandler getHandler; |
olympux | 40:c966abbe2d62 | 46 | PutRequestHandler putHandler; |
olympux | 40:c966abbe2d62 | 47 | DeleteRequestHandler deleteHandler; |
olympux | 40:c966abbe2d62 | 48 | }; |
olympux | 40:c966abbe2d62 | 49 | |
olympux | 40:c966abbe2d62 | 50 | #endif |
olympux | 40:c966abbe2d62 | 51 |