Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterfacePlusHostname RdWebServer mbed-rtos mbed
cmdmsg.h@3:e5ea80fae61d, 2015-08-31 (annotated)
- Committer:
- Bobty
- Date:
- Mon Aug 31 09:03:15 2015 +0000
- Revision:
- 3:e5ea80fae61d
- Parent:
- 1:362331cec9b7
Made ShowLeds an explicit command rather than automatic; Allow hostname to be set; Made sure HTTP response has keep-alive in it; Moved http_server into main loop (was in a separate thread); Added HSV fill command
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Bobty | 1:362331cec9b7 | 1 | |
| Bobty | 1:362331cec9b7 | 2 | class ledstrip; |
| Bobty | 1:362331cec9b7 | 3 | |
| Bobty | 1:362331cec9b7 | 4 | class cmdmsg |
| Bobty | 1:362331cec9b7 | 5 | { |
| Bobty | 1:362331cec9b7 | 6 | private: |
| Bobty | 1:362331cec9b7 | 7 | // static char responseStr[50]; |
| Bobty | 1:362331cec9b7 | 8 | // unsigned char* mpMsgBuf; |
| Bobty | 1:362331cec9b7 | 9 | // int mMaxMsgLen; |
| Bobty | 1:362331cec9b7 | 10 | // int mMsgLen; |
| Bobty | 1:362331cec9b7 | 11 | int getLedNumFromSeq(const int* edgeLeds, int numLedsInSeq, int seqIdx); |
| Bobty | 1:362331cec9b7 | 12 | |
| Bobty | 1:362331cec9b7 | 13 | public: |
| Bobty | 1:362331cec9b7 | 14 | cmdmsg() |
| Bobty | 1:362331cec9b7 | 15 | { |
| Bobty | 1:362331cec9b7 | 16 | // mMsgLen = 0; |
| Bobty | 1:362331cec9b7 | 17 | // mMaxMsgLen = 5200; |
| Bobty | 1:362331cec9b7 | 18 | // mpMsgBuf = new unsigned char [mMaxMsgLen](); |
| Bobty | 1:362331cec9b7 | 19 | // responseStr[0] = 0; |
| Bobty | 1:362331cec9b7 | 20 | } |
| Bobty | 1:362331cec9b7 | 21 | |
| Bobty | 1:362331cec9b7 | 22 | // ~cmdmsg() |
| Bobty | 1:362331cec9b7 | 23 | // { |
| Bobty | 1:362331cec9b7 | 24 | // delete mpMsgBuf; |
| Bobty | 1:362331cec9b7 | 25 | // } |
| Bobty | 1:362331cec9b7 | 26 | // |
| Bobty | 1:362331cec9b7 | 27 | // char* GetBuffer() |
| Bobty | 1:362331cec9b7 | 28 | // { |
| Bobty | 1:362331cec9b7 | 29 | // return (char*)mpMsgBuf; |
| Bobty | 1:362331cec9b7 | 30 | // } |
| Bobty | 1:362331cec9b7 | 31 | // int GetMaxMsgLen() |
| Bobty | 1:362331cec9b7 | 32 | // { |
| Bobty | 1:362331cec9b7 | 33 | // return mMaxMsgLen; |
| Bobty | 1:362331cec9b7 | 34 | // } |
| Bobty | 1:362331cec9b7 | 35 | // |
| Bobty | 1:362331cec9b7 | 36 | // void SetMsgLen(int n) |
| Bobty | 1:362331cec9b7 | 37 | // { |
| Bobty | 1:362331cec9b7 | 38 | // mMsgLen = n; |
| Bobty | 1:362331cec9b7 | 39 | // } |
| Bobty | 1:362331cec9b7 | 40 | // char* Interpret(ledstrip* pLedStrip); |
| Bobty | 1:362331cec9b7 | 41 | // |
| Bobty | 1:362331cec9b7 | 42 | static char* Interpret(const unsigned char* msgBuf, int msgLen, ledstrip* pLedStrip); |
| Bobty | 1:362331cec9b7 | 43 | }; |
| Bobty | 1:362331cec9b7 | 44 |