nasa / CTF

This is a new repository for a new tool to be added to the cFS ecosystem called cFS Test Framework (CTF).
27 stars 6 forks source link

Sending current time in command packet #30

Closed buerge3 closed 2 years ago

buerge3 commented 2 years ago

My team would like a way to send the current time as a command parameter. The time should be in J2000 format and in nanoseconds. Also there should be a way to send an offset from the current time in the command parameter. For example:


#Convert current unix time to J2000 epoch
CURRENTEPOCTIME=`date +%s`
CURRENTJ2000TIME=`expr ${CURRENTEPOCTIME} - 946728000`
CURRENTJ2000TIMENS=`expr ${CURRENTJ2000TIME} \* 1000000000`
var=$CURRENTJ2000TIMENS
echo Current J2000 epoch time in nanoseconds is: ${var}
buerge3 commented 2 years ago

This issue is fixed. Can just get the current time from the header of one of the received tlm packets, save it to a local variable, and then send that local variable in the command