Commit ed5c5692 by Daisy Green

nerdjack packet size

parent 8bb6de6c
Showing with 9 additions and 3 deletions
...@@ -28,13 +28,16 @@ ...@@ -28,13 +28,16 @@
#define NERD_HEADER_SIZE 8 #define NERD_HEADER_SIZE 8
#define MAX_SOCKETS 32 #define MAX_SOCKETS 32
int NERDJACK_PACKET_SIZE = 1448;
int NERDJACK_NUM_SAMPLES = 720;
typedef struct __attribute__ ((__packed__)) { typedef struct __attribute__ ((__packed__)) {
unsigned char headerone; unsigned char headerone;
unsigned char headertwo; unsigned char headertwo;
unsigned short packetNumber; unsigned short packetNumber;
unsigned short adcused; unsigned short adcused;
unsigned short packetsready; unsigned short packetsready;
signed short data[NERDJACK_NUM_SAMPLES]; signed short data[720];
} dataPacket; } dataPacket;
struct discovered_socket { struct discovered_socket {
...@@ -439,6 +442,9 @@ nerd_data_stream(int data_fd, int numChannels, int *channel_list, ...@@ -439,6 +442,9 @@ nerd_data_stream(int data_fd, int numChannels, int *channel_list,
int numgroupsProcessed = 0; int numgroupsProcessed = 0;
double volts; double volts;
NERDJACK_NUM_SAMPLES = numChannelsSampled * 90;
NERDJACK_PACKET_SIZE = NERDJACK_NUM_SAMPLES * 2 + 8;
//The timeout should be the expected time plus 60 seconds //The timeout should be the expected time plus 60 seconds
//This permits slower speeds to work properly //This permits slower speeds to work properly
unsigned int expectedtimeout = unsigned int expectedtimeout =
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#define NERDJACK_UDP_RECEIVE_PORT 49156 #define NERDJACK_UDP_RECEIVE_PORT 49156
#define NERDJACK_COMMAND_PORT 49157 #define NERDJACK_COMMAND_PORT 49157
#define NERDJACK_PACKET_SIZE 1460 //#define NERDJACK_PACKET_SIZE 1460
#define NERDJACK_NUM_SAMPLES 726 //#define NERDJACK_NUM_SAMPLES 726
/* Packet structure used in message to start sampling on NerdJack */ /* Packet structure used in message to start sampling on NerdJack */
typedef struct __attribute__ ((__packed__)) { typedef struct __attribute__ ((__packed__)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment