2019-12-19 03:24:12 +00:00
|
|
|
|
2020-04-04 21:27:45 +00:00
|
|
|
|
2020-03-23 14:51:29 +00:00
|
|
|
# To Do
|
|
|
|
|
2020-04-03 20:41:11 +00:00
|
|
|
- Any socket function which takes a IP/port address should have a version which also takes a sockaddr_in*.
|
2020-04-02 18:40:26 +00:00
|
|
|
- Fix the time functions to make them more convenient and C++ish.
|
2020-03-31 17:10:45 +00:00
|
|
|
- implement floating point UI numbers
|
2020-03-25 15:35:37 +00:00
|
|
|
- UI needs a special UUID (not kInvalidId) to specify the 'root' UI element. See note in cwUi._createFromObj()
|
2020-03-23 14:51:29 +00:00
|
|
|
- Look at 'BUG' warnings in cwNumericConvert.h.
|
|
|
|
- cwObject must be able to parse without dynamic memory allocation into a fixed buffer
|
|
|
|
- cwObject must be able to be composed without dynamic memory allocation or from a fixed buffer.
|
|
|
|
|
|
|
|
- cwWebsock is allocating memory on send().
|
|
|
|
- cwWebsock: if the size of the recv and xmt buffer, as passed form the protocolArray[], is too small send() will fail without an error message.
|
|
|
|
This is easy to reproduce by simply decreasing the size of the buffers in the protocol array.
|
2019-12-19 03:24:12 +00:00
|
|
|
|
2019-12-24 15:05:24 +00:00
|
|
|
- Clean up the cwObject namespace - add an 'object' namespace inside 'cw'
|
2019-12-19 03:24:12 +00:00
|
|
|
|
2019-12-24 15:05:24 +00:00
|
|
|
- Add underscore to the member variables of object_t.
|
|
|
|
|
2019-12-19 03:24:12 +00:00
|
|
|
|
|
|
|
- logDefaultFormatter() in cwLog.cpp uses stack allocated memory in a way that could easily be exploited.
|
|
|
|
|
|
|
|
- lexIntMatcher() in cwLex.cpp doesn't handle 'e' notation correctly. See note in code.
|
|
|
|
|
2019-12-24 15:05:24 +00:00
|
|
|
- numeric_convert() in cwNumericConvert.h could be made more efficient using type_traits.
|
|
|
|
|
2020-04-28 20:38:54 +00:00
|
|
|
- numeric_convert() d_min is NOT zero, it's smallest positive number, this fails when src == 0.
|
|
|
|
min value is now set to zero.
|
|
|
|
|
|
|
|
- The UI app id map should be validated after the UI is created.
|
|
|
|
In otherwords the parent/child pairs shoud actually exists.
|
|
|
|
|
|
|
|
- Add an ui::appIdToUuId() that returns the first matching appId, and then
|
|
|
|
optionally looks for duplicates as an error checking scheme.
|
|
|
|
|
2019-12-24 15:05:24 +00:00
|
|
|
- thread needs setters and getters for internal variables
|
|
|
|
|
|
|
|
- change cwMpScNbQueue so that it does not require 'new'.
|
|
|
|
|
2019-12-27 21:52:45 +00:00
|
|
|
- cwAudioBuf.cpp - the ch->fn in update() does not have the correct memory fence.
|
|
|
|
|
|
|
|
- change file names to match object names
|
|
|
|
|
2020-03-23 14:51:29 +00:00
|
|
|
- (DONE) change all NULL's to nullptr
|
|
|
|
|
|
|
|
- (DONE) implement kTcpFl in cwTcpSocket.cpp
|
|
|
|
|
2020-03-31 17:10:45 +00:00
|
|
|
# UI Control Creation Protocol
|
2020-03-23 14:51:29 +00:00
|
|
|
|
2020-03-31 17:10:45 +00:00
|
|
|
The UI elements have four identifiers:
|
|
|
|
|
|
|
|
uuId - An integer which is unique among all identifiers for a given cwUi object.
|
|
|
|
appId - A constant (enumerated) id assigned by the application. Unique among siblings.
|
|
|
|
jsId - A string id used by Javascript to identify a control. Unique among siblings.
|
|
|
|
jsUuId - An integer which is unique among all identifers for the browser representation of a given cwUi object.
|
|
|
|
|
|
|
|
The 'jsId' is selected by the application when the object is created.
|
|
|
|
The 'jsUuId' is generated by the JS client when the UI element is created.
|
|
|
|
The 'uuId' is generated by the UI server when the JS client registers the control.
|
|
|
|
The 'appId' is assigned by the UI server when the JS client regsiters the control.
|
|
|
|
|
|
|
|
Client sends 'init' message.
|
|
|
|
Server sends 'create' messages.
|
|
|
|
Client sends 'register' messages.
|
2020-04-04 21:27:45 +00:00
|
|
|
Server send' 'id_assign' messages.
|
|
|
|
|
|
|
|
# sockaddr_in reference
|
|
|
|
|
|
|
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
|
|
|
struct sockaddr_in {
|
|
|
|
short sin_family; // e.g. AF_INET
|
|
|
|
unsigned short sin_port; // e.g. htons(3490)
|
|
|
|
struct in_addr sin_addr; // see struct in_addr, below
|
|
|
|
char sin_zero[8]; // zero this if you want to
|
|
|
|
};
|
|
|
|
|
|
|
|
struct in_addr {
|
|
|
|
unsigned long s_addr; // load with inet_aton()
|
|
|
|
};
|
|
|
|
|
2019-12-27 21:52:45 +00:00
|
|
|
|
2019-12-24 15:05:24 +00:00
|
|
|
|
2020-03-18 19:11:39 +00:00
|
|
|
# Development Setup
|
|
|
|
|
|
|
|
1) Install libwebsockets.
|
|
|
|
|
2020-03-18 19:53:11 +00:00
|
|
|
```
|
|
|
|
sudo dnf install g++ openssl-devel cmake
|
2020-03-18 19:11:39 +00:00
|
|
|
cd sdk
|
|
|
|
git clone https://libwebsockets.org/repo/libwebsockets
|
|
|
|
cd libwebsockets
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/kevin/sdk/libwebsockets/build/out ..
|
2020-03-18 19:53:11 +00:00
|
|
|
```
|
2020-03-18 19:11:39 +00:00
|
|
|
|
2020-03-18 19:53:11 +00:00
|
|
|
2) Environment setup:
|
|
|
|
|
|
|
|
export LD_LIBRARY_PATH=~/sdk/libwebsockets/build/out/lib
|
2020-03-23 14:51:29 +00:00
|
|
|
|
2020-04-04 21:27:45 +00:00
|
|
|
# Raspberry Pi Build Notes:
|
|
|
|
|
|
|
|
cd sdk
|
|
|
|
mkdir libwebsockets
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/pi/sdk/libwebsockets/build/out -DLWS_WITH_SSL=OFF ..
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
|
|
|
|
apt install libasound2-dev
|
|
|
|
|
|
|
|
|
|
|
|
|