Robotran C Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mbs_aux.h
Go to the documentation of this file.
1 //-------------------------------
2 // UCL-CEREM-MBS
3 //
4 // @version MBsysLab_s 1.7.a
5 //
6 // Creation : 2008 by JF Collard
7 // Last update : 01/10/2008
8 //-------------------------------
9 //
10 // Gestion via Bugzilla :
11 // 01/10/2008 : JFC : Bug n 39
12 //
13 
14 #ifndef mbs_aux_h
15 #define mbs_aux_h
16 /*--------------------*/
17 
18 #include "mbs_sensor_struct.h"
19 #include "mbs_data.h"
20 
21 typedef struct MbsAux_tag
22 {
23  double norm_h;
24  double NRerr;
27 
29  double *h;
30  double **Jac;
31  double *huserc;
32  double **Juserc;
33  double **mJv;
34  int *ind_mJv;
35  double *Qc;
36 
37  double *mJv_h;
38 
39  int nquc;
40  int *iquc;
41  double **Juct; // JFC: 15/01/2008 : changement nom
42 
43  double **Bvuc;
44 
45  double *Jvtlambda;
46  double **Jvt;
49  int *ind_Jvt;
50 
54 
55  double *jdqd;
56  double *jdqduserc;
57 
58  double *bp;
59 
60  MbsSensor *psens; // temporary sensor pointer
61 
62  double *q_save;
64 
65  double **M;
66  double *c;
67  double *F;
68 
69  double **BtMvu, **BtMB;
70  double **BtMvv;
71  double *BtFv,*MBMb;
72 
73  double **Mruc;
74  double *Fruc;
75 
76  double **Mr;
77  double *Fr;
78 
79  double *p_Mr;
81 
82  double *Qa;
83 
84  double **A;
85  int *ind_A;
86  double *b;
87 
88  double *w;
89  double **v;
91 
93  double *phi;
94  double *R;
95  double *Rruc;
96  double *Rred;
97 
98 } MbsAux;
99 
100 
101 MbsAux* initMbsAux(MbsData *mbs_data);
102 
112 int freeMbsAux(MbsAux* mbs_aux, MbsData *mbs_data);
113 
114 
115 #endif
MbsAux_tag::NRerr
double NRerr
Definition: mbs_aux.h:24
MAX_FRAME_LENGTH
#define MAX_FRAME_LENGTH
Maximum frame/message length.
Definition: ws.h:58
MbsAux_tag::bp
double * bp
Vector (index starting at 1) of size [Ncons] (or NULL if Ncons==0).
Definition: mbs_aux.h:58
MbsAux_tag::BtFv
double * BtFv
Definition: mbs_aux.h:71
ws_sendframe_txt_bcast
int ws_sendframe_txt_bcast(uint16_t port, const char *msg)
Sends a broadcast WebSocket text frame.
Definition: ws.c:828
next_byte
static int next_byte(struct ws_frame_data *wfd)
Read a chunk of bytes and return the next byte belonging to the frame.
Definition: ws.c:1127
MbsAux_tag::mJv
double ** mJv
Array (index starting at 1) of size [Ncons x nqv] (or NULL if Ncons==0).
Definition: mbs_aux.h:33
ws_get_connection_context
void * ws_get_connection_context(ws_cli_conn_t *cli)
Get connection context.
Definition: ws.c:120
shaSuccess
@ shaSuccess
Definition: sha1.h:35
TIMEOUT_MS
#define TIMEOUT_MS
Timeout in milliseconds.
Definition: ws.h:202
UTF8_REJECT
#define UTF8_REJECT
Definition: utf8.h:31
MbsAux_tag::BtMvv
double ** BtMvv
Array (index starting at 1) of size [(nqu + nqc) x nqv].
Definition: mbs_aux.h:70
ws_accept_params::ws_srv
struct ws_server ws_srv
Definition: ws.c:1765
ws_connection::ws_srv
struct ws_server ws_srv
Definition: ws.c:76
ws_establishconnection
static void * ws_establishconnection(void *vclient)
Establishes to connection with the client and trigger events when occurs one.
Definition: ws.c:1684
MAGIC_STRING
#define MAGIC_STRING
Magic string.
Definition: ws.h:74
frame_state_data::msg_data
unsigned char * msg_data
Definition: ws.c:1180
timeout
static uint32_t timeout
Timeout to a single send().
Definition: ws.c:133
MbsAux_tag::norm_h
double norm_h
Definition: mbs_aux.h:23
MbsAux_tag::Qc
double * Qc
Vector (index starting at 1) of size [nqc].
Definition: mbs_aux.h:35
ws_frame_data::cur_pos
size_t cur_pos
Current byte position.
Definition: ws.c:163
MbsAux_tag::Mr
double ** Mr
Array (index starting at 1) of size [nqu x nqu].
Definition: mbs_aux.h:76
is_utf8_len
int is_utf8_len(uint8_t *s, size_t len)
Definition: utf8.c:70
sha1.h
MbsAux_tag::MAX_NR_ITER
int MAX_NR_ITER
max number of iteration for NR procedure
Definition: mbs_aux.h:25
set_client_address
static void set_client_address(ws_cli_conn_t *client)
Sets the IP address relative to a client connection opened by the server and save inside the client s...
Definition: ws.c:445
MbsAux_tag::ind_Jvt
int * ind_Jvt
Definition: mbs_aux.h:49
MbsAux_tag::ind_mJv
int * ind_mJv
Vector (index starting at 1) of size [Ncons] (or NULL if Ncons==0).
Definition: mbs_aux.h:34
ws_sendframe_bin_bcast
int ws_sendframe_bin_bcast(uint16_t port, const char *msg, uint64_t size)
Sends a broadcast WebSocket binary frame.
Definition: ws.c:856
ws_sendframe_internal
static int ws_sendframe_internal(ws_cli_conn_t *client, const char *msg, uint64_t size, int type, uint16_t port)
Creates and send an WebSocket frame with some payload data.
Definition: ws.c:522
MbsAux_tag::jdqduserc
double * jdqduserc
Definition: mbs_aux.h:56
mbs_data.h
get_handshake_response
int get_handshake_response(char *hsrequest, char **hsresponse)
Gets the complete response to accomplish a succesfully handshake.
Definition: handshake.c:87
ws_connection::thrd_tout
pthread_t thrd_tout
Definition: ws.c:81
SHA1CircularShift
#define SHA1CircularShift(bits, word)
Definition: sha1.c:37
SHA1Context::Computed
int Computed
Definition: sha1.h:58
frame_state_data::masks_ctrl
uint8_t masks_ctrl[4]
Definition: ws.c:1183
frame_state_data::msg_idx_data
uint64_t msg_idx_data
Definition: ws.c:1184
frame_state_data::msg_ctrl
unsigned char * msg_ctrl
Definition: ws.c:1181
ws_connection::connection_context
void * connection_context
Definition: ws.c:97
MS_TO_NS
#define MS_TO_NS(x)
Nanoseconds macro converter.
Definition: ws.h:198
RECV
#define RECV(fd, buf, len)
Definition: ws.h:221
MbsAux_tag::qrot_qv_indvec
int * qrot_qv_indvec
vec [ivec_1, njoint] containing 1 or 0, depending on the nature of the joint : if rotational AND qv =...
Definition: mbs_aux.h:53
ws_frame_data::msg_ctrl
unsigned char msg_ctrl[125]
Control frame payload.
Definition: ws.c:159
frame_state_data::masks_data
uint8_t masks_data[4]
Definition: ws.c:1182
WS_FR_OP_PING
#define WS_FR_OP_PING
Ping frame.
Definition: ws.h:138
do_pong
static int do_pong(struct ws_frame_data *wfd, uint64_t frame_size)
Send a pong frame in response to a ping frame.
Definition: ws.c:1104
ws_connection::state
int state
WebSocket current state.
Definition: ws.c:73
MbsAux_tag::iquc
int * iquc
Definition: mbs_aux.h:40
is_utf8_len_state
uint32_t is_utf8_len_state(uint8_t *s, size_t len, uint32_t state)
Definition: utf8.c:80
utf8d
static const uint8_t utf8d[]
Copyright (c) 2008-2009 Bjoern Hoehrmann bjoern@hoehrmann.de
Definition: utf8.c:32
client
static ws_cli_conn_t * client
Definition: visu_websocket.cc:49
WS_STATE_CONNECTING
#define WS_STATE_CONNECTING
Connection not established yet.
Definition: ws.h:176
MESSAGE_LENGTH
#define MESSAGE_LENGTH
Message buffer length.
Definition: ws.h:54
ws_accept
static void * ws_accept(void *data)
Main loop that keeps accepting new connections.
Definition: ws.c:1780
ws_accept_params
Accept parameters.
Definition: ws.c:1762
ws_get_server_context
void * ws_get_server_context(ws_cli_conn_t *cli)
Get server context.
Definition: ws.c:104
MbsAux_tag::nquc
int nquc
store nqu+nqc
Definition: mbs_aux.h:39
int32_to_ping_msg
static void int32_to_ping_msg(int32_t ping_id, uint8_t *msg)
Given a PING id, encodes the content to be sent as payload of a PING frame.
Definition: ws.c:711
WS_STATE_CLOSING
#define WS_STATE_CLOSING
Closing state.
Definition: ws.h:184
SHA1Input
int SHA1Input(SHA1Context *, const uint8_t *, unsigned int)
client_socks
static struct ws_connection client_socks[MAX_CLIENTS]
Clients list.
Definition: ws.c:128
MbsAux_tag::BtMvu
double ** BtMvu
Definition: mbs_aux.h:69
frame_state_data::frame_length
uint64_t frame_length
Definition: ws.c:1186
MbsAux_tag::MBMb
double * MBMb
Vectors (index starting at 1) of size [nqu].
Definition: mbs_aux.h:71
frame_state_data::frame_size
uint64_t frame_size
Definition: ws.c:1187
pong_msg_to_int32
static int32_t pong_msg_to_int32(uint8_t *msg)
Given a PONG message, decodes the content as a int32_t number that corresponds to our PONG id.
Definition: ws.c:696
ws_server::thread_loop
int thread_loop
Whether if the ws_socket() should create a new thread and be non-blocking (1) or not (0).
Definition: ws.h:287
skip_frame
static int skip_frame(struct ws_frame_data *wfd, uint64_t frame_size)
Skips frame_size bytes of the current frame.
Definition: ws.c:1158
ws_connection::port
char port[32]
Definition: ws.c:89
read_single_frame
static int read_single_frame(struct ws_frame_data *wfd, struct frame_state_data *fsd)
Reads the current frame isolating data from control frames.
Definition: ws.c:1359
close_socket
static void close_socket(int fd)
Shutdown and close a given socket.
Definition: ws.c:211
do_handshake
static int do_handshake(struct ws_frame_data *wfd)
Do the handshake process.
Definition: ws.c:972
ws_set_connection_context
void ws_set_connection_context(ws_cli_conn_t *cli, void *ptr)
Set connection context.
Definition: ws.c:112
MbsAux_tag
Definition: mbs_aux.h:21
MbsAux_tag::ind_A
int * ind_A
Vector (index starting at 1) of size [njoint].
Definition: mbs_aux.h:85
ws_connection::ip
char ip[1025]
Definition: ws.c:88
frame_state_data::opcode
uint8_t opcode
Definition: ws.c:1192
SHA1Input
int SHA1Input(SHA1Context *context, const uint8_t *message_array, unsigned length)
Definition: sha1.c:159
ws_getaddress
char * ws_getaddress(ws_cli_conn_t *client)
Gets the IP address relative to a client connection opened by the server.
Definition: ws.c:475
SHA1Reset
int SHA1Reset(SHA1Context *)
Definition: sha1.c:59
WS_HS_REQ
#define WS_HS_REQ
Alias for 'Sec-WebSocket-Key'.
Definition: ws.h:84
ws_getport
char * ws_getport(ws_cli_conn_t *client)
Gets the IP port relative to a client connection opened by the server.
Definition: ws.c:493
close_timeout
static void * close_timeout(void *p)
Close time-out thread.
Definition: ws.c:367
MbsAux_tag::Qa
double * Qa
Vector (index starting at 1) of size [njoint].
Definition: mbs_aux.h:82
mbs_sensor_struct.h
ws_frame_data::frame_size
uint64_t frame_size
Frame size.
Definition: ws.c:175
handle_pong_frame
static int handle_pong_frame(struct ws_frame_data *wfd, struct frame_state_data *fsd)
Handle PONG frames in response to our PING (or not, unsolicited is possible too).
Definition: ws.c:1261
ws_connection::client_sock
int client_sock
Client socket FD.
Definition: ws.c:72
MbsAux_tag::Rruc
double * Rruc
vector of size [nqu+nqc x 1] that contains the reduced residue for the equations of motions after the...
Definition: mbs_aux.h:95
SHA1ProcessMessageBlock
void SHA1ProcessMessageBlock(SHA1Context *)
Definition: sha1.c:232
MbsAux_tag::p_Mr
double * p_Mr
Vector (index starting at 1) of size [nqu].
Definition: mbs_aux.h:79
is_utf8_len_state
uint32_t is_utf8_len_state(uint8_t *s, size_t len, uint32_t state)
Definition: utf8.c:80
MbsAux_tag::psens
MbsSensor * psens
Definition: mbs_aux.h:60
WS_HS_ACCEPT
#define WS_HS_ACCEPT
Handshake accept message.
Definition: ws.h:94
WS_FIN
#define WS_FIN
Frame FIN.
Definition: ws.h:108
validate_utf8_txt
static int validate_utf8_txt(struct ws_frame_data *wfd, struct frame_state_data *fsd)
Validates TXT frames if UTF8 validation is enabled.
Definition: ws.c:1210
frame_state_data::msg_idx_ctrl
uint64_t msg_idx_ctrl
Definition: ws.c:1185
UTF8_ACCEPT
#define UTF8_ACCEPT
Copyright (c) 2008-2009 Bjoern Hoehrmann bjoern@hoehrmann.de
Definition: utf8.h:30
do_close
static int do_close(struct ws_frame_data *wfd, int close_code)
Sends a close frame, accordingly with the close_code or the message inside wfd.
Definition: ws.c:1035
SHA1Context::Corrupted
int Corrupted
Definition: sha1.h:59
MbsAux_tag::Juserc
double ** Juserc
Array (index starting at 1) of size [Nuserc x njoint] (or NULL if Nuserc==0).
Definition: mbs_aux.h:32
DEBUG
#define DEBUG(...)
Debug.
Definition: ws.h:215
ws_sendframe_bin
int ws_sendframe_bin(ws_cli_conn_t *client, const char *msg, uint64_t size)
Sends a WebSocket binary frame.
Definition: ws.c:842
MbsAux_tag::M
double ** M
Array (index starting at 1) of size [njoint x njoint].
Definition: mbs_aux.h:65
WS_HS_ACCLEN
#define WS_HS_ACCLEN
Handshake accept message length.
Definition: ws.h:89
SHA1HashSize
#define SHA1HashSize
Definition: sha1.h:41
send_ping_close
static void send_ping_close(ws_cli_conn_t *cli, int threshold, int lock)
Send a ping message and close if the client surpasses the threshold imposed.
Definition: ws.c:731
MbsAux_tag::h
double * h
Vector (index starting at 1) of size [Ncons] (or NULL if Ncons==0).
Definition: mbs_aux.h:29
frame_state_data::mask
uint8_t mask
Definition: ws.c:1194
ws_frame_data::frm
unsigned char frm[MESSAGE_LENGTH]
Frame read.
Definition: ws.c:151
WS_FR_OP_CONT
#define WS_FR_OP_CONT
Continuation frame.
Definition: ws.h:118
ws_server::port
uint16_t port
Listening port.
Definition: ws.h:282
MbsAux_tag::A
double ** A
Array (index starting at 1) of size [nqu x njoint].
Definition: mbs_aux.h:84
is_utf8
int is_utf8(uint8_t *s)
Definition: utf8.c:61
decode
static uint32_t decode(uint32_t *state, uint32_t *codep, uint32_t byte)
Definition: utf8.c:50
SHA1PadMessage
void SHA1PadMessage(SHA1Context *)
Definition: sha1.c:343
is_valid_frame
static int is_valid_frame(int opcode)
Checks is a given opcode opcode is valid or not.
Definition: ws.c:953
MbsAux_tag::BtMB
double ** BtMB
Arrays (index starting at 1) of size [(nqu + nqc) x (nqu + nqc)].
Definition: mbs_aux.h:69
base64_table
static const unsigned char base64_table[65]
Definition: base64.c:14
freeMbsAux
int freeMbsAux(MbsAux *mbs_aux, MbsData *mbs_data)
Free the structure and its content.
Definition: mbs_aux.c:178
MbsAux_tag::huserc
double * huserc
Vector (index starting at 1) of size [Nuserc] (or NULL if Nuserc==0).
Definition: mbs_aux.h:31
ws_get_state
int ws_get_state(ws_cli_conn_t *client)
For a given client, gets the current state for the connection, or -1 if invalid.
Definition: ws.c:875
MbsAux_tag::Fruc
double * Fruc
Vector (index starting at 1) of size [nqu + nqc].
Definition: mbs_aux.h:74
base64.h
MbsAux_tag::Jvtlambda
double * Jvtlambda
Intermediate array to store and compute lambda.
Definition: mbs_aux.h:45
close_client
static void close_client(ws_cli_conn_t *client, int lock)
Close client connection (no close handshake, this should be done earlier), set appropriate state and ...
Definition: ws.c:330
shaNull
@ shaNull
Definition: sha1.h:36
handle_ping_frame
static int handle_ping_frame(struct ws_frame_data *wfd, struct frame_state_data *fsd)
Handle PING frames sending a PONG response.
Definition: ws.c:1300
MbsAux_tag::qrot_qc_indvec
int * qrot_qc_indvec
vec [ivec_1, njoint] containing 1 or 0, depending on the nature of the joint : if rotational AND qc =...
Definition: mbs_aux.h:52
MbsAux_tag::Jac
double ** Jac
Array (index starting at 1) of size [Ncons x njoint] (or NULL if Ncons==0).
Definition: mbs_aux.h:30
MbsAux_tag::Mruc
double ** Mruc
Array (index starting at 1) of size [(nqu + nqc) x (nqu + nqc)].
Definition: mbs_aux.h:73
ws_close_client
int ws_close_client(ws_cli_conn_t *client)
Close the client connection for the given client with normal close code (1000) and no reason string.
Definition: ws.c:893
ws_accept_params::sock
int sock
Definition: ws.c:1764
WS_FR_OP_CLSE
#define WS_FR_OP_CLSE
Close frame.
Definition: ws.h:133
ws_frame_data::msg
unsigned char * msg
Processed message at the moment.
Definition: ws.c:155
MbsAux_tag::w
double * w
Vector (index starting at 1) of size [njoint].
Definition: mbs_aux.h:88
ws_socket
int ws_socket(struct ws_server *ws_srv)
Main loop for the server.
Definition: ws.c:1940
ws_frame_data::frame_type
int frame_type
Frame type, like text or binary.
Definition: ws.c:171
MbsAux_tag::Rred
double * Rred
vector of size [nqu x 1] that contains the reduced residue of the equations of motion after the secon...
Definition: mbs_aux.h:96
SHA1Result
int SHA1Result(SHA1Context *context, uint8_t Message_Digest[SHA1HashSize])
Definition: sha1.c:101
send_all
static ssize_t send_all(ws_cli_conn_t *client, const void *buf, size_t len, int flags)
Send a given message buf on a socket sockfd.
Definition: ws.c:287
ws_connection
Client socks.
Definition: ws.c:70
MbsAux_tag::jdqd
double * jdqd
Vector (index starting at 1) of size [Ncons].
Definition: mbs_aux.h:55
WS_STATE_OPEN
#define WS_STATE_OPEN
Communicating.
Definition: ws.h:180
MbsAux_tag::Juct
double ** Juct
Definition: mbs_aux.h:41
CLIENT_VALID
#define CLIENT_VALID(cli)
Client validity macro.
Definition: ws.c:138
SHA1Context::Length_Low
uint32_t Length_Low
Definition: sha1.h:51
MbsAux_tag::n_iter_close_loop
int n_iter_close_loop
number of iterations after closing loop procedure in mbs_close_geo
Definition: mbs_aux.h:26
MbsAux_tag::close_anim
int close_anim
Definition: mbs_aux.h:63
MbsAux_tag::Jvt
double ** Jvt
Definition: mbs_aux.h:48
WS_CLSE_NORMAL
#define WS_CLSE_NORMAL
Normal close.
Definition: ws.h:158
ws_sendframe_bcast
int ws_sendframe_bcast(uint16_t port, const char *msg, uint64_t size, int type)
Send an WebSocket frame with some payload data to all clients connected into the same port.
Definition: ws.c:682
initMbsAux
MbsAux * initMbsAux(MbsData *mbs_data)
Definition: mbs_aux.c:22
ws_sendframe_txt
int ws_sendframe_txt(ws_cli_conn_t *client, const char *msg)
Sends a WebSocket text frame.
Definition: ws.c:815
WS_KEYMS_LEN
#define WS_KEYMS_LEN
Accept message response length.
Definition: ws.h:70
MbsAux_tag::R
double * R
vector of size [njoint x 1] that contains R=phi-c; (unconstrained equations of motion for the mbs on ...
Definition: mbs_aux.h:94
ws_frame_data::client
ws_cli_conn_t * client
Client connection structure.
Definition: ws.c:183
ws_frame_data::error
int error
Error flag, set when a read was not possible.
Definition: ws.c:179
get_handshake_response
int get_handshake_response(char *hsrequest, char **hsresponse)
Gets the complete response to accomplish a succesfully handshake.
Definition: handshake.c:87
ws_connection::last_pong_id
int32_t last_pong_id
Definition: ws.c:92
frame_state_data::pong_id
int32_t pong_id
Definition: ws.c:1191
MbsAux_tag::Fr
double * Fr
Vector (index starting at 1) of size [nqu].
Definition: mbs_aux.h:77
SHA1Reset
int SHA1Reset(SHA1Context *context)
Definition: sha1.c:59
WS_MS_LEN
#define WS_MS_LEN
Magic string length.
Definition: ws.h:66
MAX_CLIENTS
#define MAX_CLIENTS
Max clients connected simultaneously.
Definition: ws.h:44
ws_sendframe
int ws_sendframe(ws_cli_conn_t *client, const char *msg, uint64_t size, int type)
Send an WebSocket frame with some payload data.
Definition: ws.c:663
get_handshake_accept
int get_handshake_accept(char *wsKey, unsigned char **dest)
Gets the field Sec-WebSocket-Accept on response, by an previously informed key.
Definition: handshake.c:47
SHA1Context::Message_Block
uint8_t Message_Block[64]
Definition: sha1.h:56
utf8.h
WS_KEY_LEN
#define WS_KEY_LEN
WebSocket key length.
Definition: ws.h:62
MbsAux_tag::Bvuc
double ** Bvuc
Array (index starting at 1) of size [nqv x nquc] (or NULL if Nuserc==0).
Definition: mbs_aux.h:43
shaStateError
@ shaStateError
Definition: sha1.h:38
start_close_timeout
static int start_close_timeout(ws_cli_conn_t *client)
For a valid client index client, starts the timeout thread and set the current state to 'CLOSING'.
Definition: ws.c:416
ws_connection::mtx_ping
pthread_mutex_t mtx_ping
Definition: ws.c:94
MbsData
Definition: mbs_data.h:247
SHA1Context::Intermediate_Hash
uint32_t Intermediate_Hash[SHA1HashSize/4]
Definition: sha1.h:49
is_control_frame
static int is_control_frame(int frame)
Checks is a given opcode frame belongs to a control frame or not.
Definition: ws.c:937
get_client_state
static int get_client_state(ws_cli_conn_t *client)
Returns the current client state for a given client client.
Definition: ws.c:232
SEND
#define SEND(client, buf, len)
Definition: ws.h:220
SHA1Context::Message_Block_Index
int_least16_t Message_Block_Index
Definition: sha1.h:55
ws.h
wsServer constants and functions.
MbsAux_tag::mJv_h
double * mJv_h
Value of the independant constraints ( )
Definition: mbs_aux.h:37
MbsSensor
Definition: mbs_sensor_struct.h:18
ws_server::timeout_ms
uint32_t timeout_ms
Ping timeout in milliseconds.
Definition: ws.h:291
base64_decode
unsigned char * base64_decode(const unsigned char *src, size_t len, size_t *out_len)
base64_decode - Base64 decode @src: Data to be decoded @len: Length of the data to be decoded @out_le...
Definition: base64.c:97
MbsAux_tag::c
double * c
Vector (index starting at 1) of size [njoint].
Definition: mbs_aux.h:66
WS_STATE_CLOSED
#define WS_STATE_CLOSED
Closed.
Definition: ws.h:188
MbsAux_tag::phi
double * phi
vector of size [njoint x 1] that contains the results of symbolic file invdyna.
Definition: mbs_aux.h:93
ws_frame_data
WebSocket frame data.
Definition: ws.c:146
MbsAux_tag::compute_Qc_vec
int * compute_Qc_vec
Vector (index starting at 1) of size [njoint].
Definition: mbs_aux.h:80
WS_FR_OP_BIN
#define WS_FR_OP_BIN
Binary frame.
Definition: ws.h:128
ws_connection::close_thrd
bool close_thrd
Definition: ws.c:82
MbsAux_tag::q_save
double * q_save
Vector (index starting at 1) of size [njoint].
Definition: mbs_aux.h:62
MbsAux_tag::qrot_qu_indvec
int * qrot_qu_indvec
vec [ivec_1, njoint] containing 1 or 0, depending on the nature of the joint : if rotational AND qu =...
Definition: mbs_aux.h:51
WS_FIN_SHIFT
#define WS_FIN_SHIFT
Frame FIN shift.
Definition: ws.h:113
WS_FR_OP_TXT
#define WS_FR_OP_TXT
Text frame.
Definition: ws.h:123
set_client_state
static int set_client_state(ws_cli_conn_t *client, int state)
Set a state state to the client index client.
Definition: ws.c:257
MbsAux_tag::v
double ** v
Array (index starting at 1) of size [njoint x njoint].
Definition: mbs_aux.h:90
ws_events
events Web Socket events types.
Definition: ws.h:252
ws_connection::current_ping_id
int32_t current_ping_id
Definition: ws.c:93
MbsAux_tag::F
double * F
vector of size [njoint] that containts c(q,qd)-Q(q,qd)
Definition: mbs_aux.h:67
WS_FR_OP_PONG
#define WS_FR_OP_PONG
Pong frame.
Definition: ws.h:143
handle_close_frame
static int handle_close_frame(struct ws_frame_data *wfd, struct frame_state_data *fsd)
Handle close frames while checking for UTF8 in the close reason.
Definition: ws.c:1323
WS_CLSE_PROTERR
#define WS_CLSE_PROTERR
Protocol error.
Definition: ws.h:162
frame_state_data::is_fin
uint8_t is_fin
Definition: ws.c:1193
next_complete_frame
static int next_complete_frame(struct ws_frame_data *wfd)
Reads the next frame, whether if a TXT/BIN/CLOSE of arbitrary size.
Definition: ws.c:1514
ws_ping
void ws_ping(ws_cli_conn_t *cli, int threshold)
Sends a PING frame to the client cli with threshold threshold.
Definition: ws.c:783
ws_connection::cnd_state_close
pthread_cond_t cnd_state_close
Definition: ws.c:80
panic
#define panic(s)
Issues an error message and aborts the program.
Definition: ws.c:196
ws_connection::mtx_state
pthread_mutex_t mtx_state
Definition: ws.c:79
SHA1Context
Definition: sha1.h:47
base64_encode
unsigned char * base64_encode(const unsigned char *src, size_t len, size_t *out_len)
base64_encode - Base64 encode @src: Data to be encoded @len: Length of the data to be encoded @out_le...
Definition: base64.c:29
frame_state_data::cur_byte
int cur_byte
Definition: ws.c:1195
frame_state_data
Frame state data.
Definition: ws.c:1178
SHA1Context::Length_High
uint32_t Length_High
Definition: sha1.h:52
ws_server
server Web Socket server parameters
Definition: ws.h:273
ws_server::host
const char * host
Required hostname that the wsServer will bind to.
Definition: ws.h:278
ws_frame_data::amt_read
size_t amt_read
Amount of read bytes.
Definition: ws.c:167
do_bind_socket
static int do_bind_socket(struct ws_server *ws_srv)
By using the server parameters provided in ws_srv, create a socket and bind it accordingly with the s...
Definition: ws.c:1877
MbsAux_tag::b
double * b
Vector (index starting at 1) of size [njoint].
Definition: mbs_aux.h:86
WS_CLSE_INVUTF8
#define WS_CLSE_INVUTF8
Inconsistent message (invalid utf-8)
Definition: ws.h:167
is_utf8_len
int is_utf8_len(uint8_t *s, size_t len)
Definition: utf8.c:70
ws_connection::mtx_snd
pthread_mutex_t mtx_snd
Definition: ws.c:85
base64_encode
unsigned char * base64_encode(const unsigned char *src, size_t len, size_t *out_len)
base64_encode - Base64 encode @src: Data to be encoded @len: Length of the data to be encoded @out_le...
Definition: base64.c:29
mutex
static pthread_mutex_t mutex
Global mutex.
Definition: ws.c:189
SHA1Result
int SHA1Result(SHA1Context *, uint8_t Message_Digest[SHA1HashSize])
Definition: sha1.c:101