Lines Matching refs:size
178 void bs_bc_send_msg(uint channel_id, uint8_t *ptr, size_t size){ in bs_bc_send_msg() argument
182 char message[size+4]; in bs_bc_send_msg()
183 *(uint32_t*)message = size; in bs_bc_send_msg()
184 memcpy(&message[4], ptr, size); in bs_bc_send_msg()
188 int bytes_written = write(channels_status[channel_id].ff[Out], message, size+4); in bs_bc_send_msg()
189 if ( bytes_written != size+4 ) { in bs_bc_send_msg()
191 channel_id, bytes_written, size, errno); in bs_bc_send_msg()
236 void bs_bc_receive_msg(int channel_id , uint8_t *ptr, size_t size){ in bs_bc_receive_msg() argument
240 if ( size > channels_status[channel_id].pending_read_bytes ) in bs_bc_receive_msg()
242 channels_status[channel_id].pending_read_bytes, channel_id, size); in bs_bc_receive_msg()
244 if ( size == 0 ) in bs_bc_receive_msg()
247 int read_size = read(channels_status[channel_id].ff[In],ptr,size); //Non-blocking read in bs_bc_receive_msg()
248 if ( read_size != size ) { in bs_bc_receive_msg()
251 … channel_id, read_size, size, errno, channels_status[channel_id].pending_read_bytes); in bs_bc_receive_msg()
253 channels_status[channel_id].pending_read_bytes -= size; in bs_bc_receive_msg()