45 #ifndef __BASE_VNC_VNC_SERVER_HH__
46 #define __BASE_VNC_VNC_SERVER_HH__
55 #include "params/VncServer.hh"
75 const static uint32_t
VncOK = 0;
102 return "RFB 003.008\n";
221 bool read(uint8_t *buf,
size_t len);
231 bool read1(uint8_t *buf,
size_t len);
238 template <
typename T>
bool read(T*
val);
246 bool write(
const uint8_t *buf,
size_t len);
252 template <
typename T>
bool write(T*
val);
257 bool write(
const char* str);
static const uint32_t AuthInvalid
Authentication modes.
DataEvent to read data from vnc.
PixelFormat pixelFormat
The one and only pixel format we support.
void requestFbUpdate()
Receive message from client asking for updated frame buffer.
void sendFrameBufferResized()
Tell the client that the frame buffer resized.
VncServer(const Params *p)
VncServer.
ConnectionState curState
The rfb prototol state the connection is in.
EncodingTypes
Encoding types.
void setEncodings()
Receive encodings message from client and process it.
void sendError(const char *error_msg)
vnc client Interface
void checkSecurity()
Check that the security exchange was successful.
ListenEvent(VncServer *vs, int fd, int e)
Poll event for the listen socket.
ServerMessages
Server -> Client message IDs.
void setPixelFormat()
Receive pixel foramt message from client and process it.
bool read1(uint8_t *buf, size_t len)
Read len -1 bytes from the client into the buffer provided + 1 assert that we read enough bytes...
void recvPointerInput()
Recv message from client providing new mouse movement or button click.
void frameBufferResized() override
static const PixelConverter pixelConverter
ListenEvent * listenEvent
bool supportsRawEnc
If the vnc client supports receiving raw data.
void setDirty() override
The frame buffer uses this call to notify the vnc server that the frame buffer has been updated and a...
void sendServerInit()
Send client our idea about what the frame buffer looks like.
struct VncServer::ServerInitMsg M5_ATTR_PACKED
const char * vncVersion() const
bool read(uint8_t *buf, size_t len)
Read some data from the client.
void recvKeyboardInput()
Receive message from client providing new keyboard input.
void sendFrameBufferUpdate()
Send a updated frame buffer to the client.
static const uint32_t AuthNone
ListenEvent to accept a vnc client connection.
void checkProtocolVersion()
Check the client's protocol verion for compatibility and send the security types we support...
MouseEvents
keyboard/mouse support
bool sendUpdate
An update needs to be sent to the client.
DataEvent(VncServer *vs, int fd, int e)
Poll event for the data socket.
void recvCutText()
Receive message from client that there is text in it's paste buffer.
Configurable RGB pixel converter.
bool write(const uint8_t *buf, size_t len)
Write a buffer to the client.
static const uint32_t VncOK
Error conditions.
bool supportsResizeEnc
If the vnc client supports the desktop resize command.