This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Makefile of v4l2-sample | |
| # | |
| TARGET = v4l2-sample | |
| CC ?= ${CROSS_COMPILE}gcc | |
| CFLAGS = -Wall -Wextra -O3 | |
| LDLIBS = -ljpeg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <csp/arch/csp_queue.h> | |
| #include <csp/csp_types.h> | |
| #include <csp/csp.h> | |
| #include <stdio.h> | |
| #include <csp/csp_debug.h> | |
| #ifdef __GNUC__ | |
| #define __packed __attribute__((__packed__)) | |
| #else | |
| #define __packed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <csp/arch/csp_queue.h> | |
| #include <csp/csp_types.h> | |
| #include <csp/csp.h> | |
| #include <stdio.h> | |
| #include <csp/csp_debug.h> | |
| #ifdef __GNUC__ | |
| #define __packed __attribute__((__packed__)) | |
| #else | |
| #define __packed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Current implemantation will return -1 if duplicate founded and 0 otherwise */ | |
| static inline int csp_rdp_rx_queue_add(csp_conn_t * conn, csp_packet_t * packet, uint16_t seq_nr) { | |
| if (csp_rdp_seq_in_rx_queue(conn, seq_nr)) | |
| /* Maybe an enum should be better in this situation, if we have to know if there is a duplicate */ | |
| /* and if we need to understand if csp_rdp_queue_rx_add fail or not */ | |
| return -1; | |
| /* Could return a 0 if everything fine and another number if fail */ | |
| return csp_rdp_queue_rx_add(conn, packet); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int csp_send(csp_conn_t * conn, csp_packet_t * packet) { | |
| if (packet == NULL) { | |
| return -1; | |
| } | |
| if ((conn == NULL) || (conn->state != CONN_OPEN)) { | |
| csp_buffer_free(packet); | |
| return -1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import zmq | |
| import random | |
| import time | |
| import signal | |
| import time | |
| import binascii | |
| frontend = None |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Initialising CSP | |
| pthread_queue_enqueu : queue state : queue->items 1, queue->in 1, queue->out 0, queue->size 15 | |
| pthread_queue_enqueu : queue state : queue->items 2, queue->in 2, queue->out 0, queue->size 15 | |
| pthread_queue_enqueu : queue state : queue->items 3, queue->in 3, queue->out 0, queue->size 15 | |
| pthread_queue_enqueu : queue state : queue->items 4, queue->in 4, queue->out 0, queue->size 15 | |
| pthread_queue_enqueu : queue state : queue->items 5, queue->in 5, queue->out 0, queue->size 15 | |
| pthread_queue_enqueu : queue state : queue->items 6, queue->in 6, queue->out 0, queue->size 15 | |
| pthread_queue_enqueu : queue state : queue->items 7, queue->in 7, queue->out 0, queue->size 15 | |
| pthread_queue_enqueu : queue state : queue->items 8, queue->in 8, queue->out 0, queue->size 15 | |
| pthread_queue_enqueu : queue state : queue->items 9, queue->in 9, queue->out 0, queue->size 15 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* If a RESET was received. */ | |
| if (rx_header->flags & RDP_RST) { | |
| if (rx_header->flags & RDP_ACK) { | |
| /* Check if RST + ACK is in sequence */ | |
| if (rx_header->seq_nr == (conn->rdp.rcv_cur + 1)){ | |
| /* Store current ack'ed sequence number */ | |
| conn->rdp.snd_una = rx_header->ack_nr + 1; | |
| }else{ | |
| /* should discard here ? */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import zmq | |
| import random | |
| import time | |
| import signal | |
| import time | |
| import binascii | |
| frontend = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import zmq | |
| import random | |
| import time | |
| import signal | |
| import time | |
| import binascii | |
| frontend = None |
NewerOlder