Changeset ebb1489 in mainline for uspace/srv/hid/remcons/user.h
- Timestamp:
- 2024-10-13T08:23:40Z (8 weeks ago)
- Children:
- 0472cf17
- Parents:
- 2a0c827c (diff), b3b79981 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- boba-buba <120932204+boba-buba@…> (2024-10-13 08:23:40)
- git-committer:
- GitHub <noreply@…> (2024-10-13 08:23:40)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/remcons/user.h
r2a0c827c rebb1489 1 1 /* 2 * Copyright (c) 2024 Jiri Svoboda 2 3 * Copyright (c) 2012 Vojtech Horky 3 4 * All rights reserved. … … 36 37 #define TELNET_USER_H_ 37 38 38 #include <adt/prodcons.h>39 39 #include <fibril_synch.h> 40 40 #include <inet/tcp.h> 41 41 #include <inttypes.h> 42 42 #include <io/con_srv.h> 43 #include "remcons.h"44 43 45 44 #define BUFFER_SIZE 32 45 #define SEND_BUF_SIZE 512 46 47 /** Telnet callbacks */ 48 typedef struct { 49 void (*ws_update)(void *, unsigned, unsigned); 50 } telnet_cb_t; 46 51 47 52 /** Representation of a connected (human) user. */ 48 53 typedef struct { 49 /** Mutex guarding the whole structure. */ 50 fibril_mutex_t guard; 54 /** Synchronize send operations */ 55 fibril_mutex_t send_lock; 56 /** Synchronize receive operations */ 57 fibril_mutex_t recv_lock; 58 /** Callback functions */ 59 telnet_cb_t *cb; 60 /** Argument to callback functions */ 61 void *arg; 51 62 52 63 /** Internal id, used for creating locfs entries. */ … … 61 72 con_srvs_t srvs; 62 73 63 /** Producer-consumer of kbd_event_t. */64 prodcons_t in_events;65 74 link_t link; 66 75 char socket_buffer[BUFFER_SIZE]; 67 76 size_t socket_buffer_len; 68 77 size_t socket_buffer_pos; 78 char send_buf[SEND_BUF_SIZE]; 79 size_t send_buf_used; 69 80 70 81 /** Task id of the launched application. */ … … 79 90 /** X position of the cursor. */ 80 91 int cursor_x; 92 /** Y position of the cursor. */ 93 int cursor_y; 94 /** Total number of columns */ 95 unsigned cols; 96 /** Total number of rows */ 97 unsigned rows; 81 98 } telnet_user_t; 82 99 83 extern telnet_user_t *telnet_user_create(tcp_conn_t * );100 extern telnet_user_t *telnet_user_create(tcp_conn_t *, telnet_cb_t *, void *); 84 101 extern void telnet_user_add(telnet_user_t *); 85 102 extern void telnet_user_destroy(telnet_user_t *); … … 88 105 extern void telnet_user_notify_client_disconnected(telnet_user_t *); 89 106 extern errno_t telnet_user_get_next_keyboard_event(telnet_user_t *, kbd_event_t *); 90 extern errno_t telnet_user_send_data(telnet_user_t *, uint8_t *, size_t); 107 extern errno_t telnet_user_send_data(telnet_user_t *, const char *, size_t); 108 extern errno_t telnet_user_send_raw(telnet_user_t *, const char *, size_t); 109 extern errno_t telnet_user_flush(telnet_user_t *); 110 extern errno_t telnet_user_recv(telnet_user_t *, void *, size_t, size_t *); 91 111 extern void telnet_user_update_cursor_x(telnet_user_t *, int); 112 extern void telnet_user_resize(telnet_user_t *, unsigned, unsigned); 92 113 93 114 /** Print informational message about connected user. */
Note:
See TracChangeset
for help on using the changeset viewer.