119 printf(
"Err: Unable to open connection to [%s:%d]\n",
address,
port);
121 printf(
"Netperf Listen is now listening on port %d...\n\n",
port);
129 tlen = strlen(logstring);
130 for (i=1; i<tlen-j; ++
i)
132 if (logstring[i+j] ==
':')
138 }
while (i+j < tlen && logstring[i+j] !=
'{');
141 logstring[
i] = logstring[i+j];
143 logstring[i-1] =
'}';
150 received = recvfrom( chan.
cudp, (
char *)buf1,
BUFSIZE, 0, (
struct sockaddr*) &chan.
caddr, (socklen_t*) &fromlen);
160 printf(
">> %s\n",buf1);
182 int32_t hour, min, lat, lon, alt, press, etemp, btemp, atemp, fix, sec, hsec;
183 float accx, accy, accz;
185 sscanf((
char *)buf1,
"%2d%2d%2d%2d %d %d %d %d %d %d %d %d %f %f %f",
186 &hour, &min, &sec, &hsec,
187 &lat, &lon, &alt, &fix,
188 &press, &etemp, &btemp, &atemp,
189 &accx, &accy, &accz);
240 mjd = (int)
currentmjd(0.) + hour / 24. + min / 1400. + sec / 86400. + hsec / 8640000.;;
char logstring[AGENTMAXBUFFER-20]
Definition: agent_physics.cpp:49
qatt geoc
Definition: convertdef.h:828
Agent socket using Unicast UDP.
double utc
Definition: convertdef.h:261
Agent * agent
Definition: udp_listen.cpp:68
vector< uint16_t > gps
Definition: jsondef.h:3902
int i
Definition: rw_test.cpp:37
rvector a
2nd derivative: Alpha - acceleration
Definition: convertdef.h:483
int iretn
Definition: rw_test.cpp:37
uint16_t port
Definition: udp_listen.cpp:65
cartpos geoc
Definition: convertdef.h:739
vector< uint16_t > imu
Definition: jsondef.h:3904
double utc
Master time for location, in Modified Julian Day.
Definition: convertdef.h:879
#define BUFSIZE
Definition: udp_listen.cpp:61
rvector v
1st derivative: Omega - angular velocity
Definition: convertdef.h:481
vector< devicestruc > device
Vector of all general (common) information for devices (components) in node.
Definition: jsondef.h:4238
nodestruc node
Structure for summary information in node.
Definition: jsondef.h:4220
rvector s
Location.
Definition: convertdef.h:163
int32_t post(messstruc mess)
Post a Cosmos::Agent::messstruc.
Definition: agentclass.cpp:2074
std::string myjstring
Definition: agent_node.cpp:53
attstruc att
attstruc for this time.
Definition: convertdef.h:883
int32_t cudp
Definition: socketlib.h:120
gvector a
Acceleration vector.
Definition: convertdef.h:267
char name[40+1]
Node Name.
Definition: jsondef.h:3556
Definition: agentclass.h:139
char address[]
Definition: udp_listen.cpp:64
Definition: socketlib.h:115
locstruc loc
Location structure.
Definition: jsondef.h:3596
struct sockaddr_in caddr
Definition: socketlib.h:122
#define SOCKET_BLOCKING
Blocking Agent.
Definition: socketlib.h:78
double h
Height in meters.
Definition: vector.h:229
double mjd
Definition: udp_send.cpp:41
double lon
Longitude in radians.
Definition: vector.h:227
vector< uint16_t > tsen
Definition: jsondef.h:3924
int32_t pos_geod(locstruc *loc)
Set Geodetic position.
Definition: convertlib.cpp:576
rvector rv_zero()
Zero row order vector.
Definition: vector.cpp:107
static string jjstring
Definition: agent_exec-2-0.cpp:106
const char * json_of_soh(string &jstring, cosmosstruc *cinfo)
Definition: jsonlib.cpp:9828
void log_write(string node, string agent, double utc, string extra, string type, string record, string location)
Write log entry - full.
Definition: datalib.cpp:75
double currentmjd(double offset)
Current UTC in Modified Julian Days.
Definition: timelib.cpp:65
posstruc pos
posstruc for this time.
Definition: convertdef.h:881
#define REARTHM
SI Radius of Earth.
Definition: convertdef.h:60
gvector s
Position vector.
Definition: convertdef.h:263
double lat
Latitude in radians.
Definition: vector.h:225
#define DATA_LOG_TYPE_SOH
Definition: datalib.h:108
const char * json_of_list(string &jstring, string list, cosmosstruc *cinfo)
Create JSON stream from list.
Definition: jsonlib.cpp:8714
#define SOCKET_LISTEN
Listen followed by optional talk (recvfrom INADDRANY)
Definition: socketlib.h:84
quaternion s
0th derivative: Quaternion
Definition: convertdef.h:479
cosmosstruc * cinfo
Definition: agentclass.h:346
#define AGENTMAXBUFFER
Maximum AGENT transfer buffer size.
Definition: jsondef.h:438
quaternion q_eye()
Identity quaternion.
Definition: vector.cpp:1310
geoidpos geod
Definition: convertdef.h:741
devspecstruc devspec
Structure for devices (components) special data in node, by type.
Definition: jsondef.h:4241
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:269
int32_t socket_open(socket_channel *channel, NetworkType ntype, const char *address, uint16_t port, uint16_t role, bool blocking, uint32_t usectimeo, uint32_t rcvbuf, uint32_t sndbuf)
Open UDP socket.
Definition: socketlib.cpp:51
vector< uint16_t > psen
Definition: jsondef.h:3910
gvector v
Velocity vector.
Definition: convertdef.h:265
#define RADOF(deg)
Radians of a Degree value.
Definition: math/constants.h:29