nasa / cFE

The Core Flight System (cFS) Core Flight Executive (cFE)
Apache License 2.0
408 stars 200 forks source link

cFE time service should be endian-neutral #231

Closed skliper closed 4 years ago

skliper commented 4 years ago

Currently the cFE time service assumes time messages are in platform-endian format, which will cause headaches in mixed-endian environments. cFE time messages should standardize on one byte ordering (I suggest network-order, aka big-endian).

skliper commented 4 years ago

Imported from trac issue 200. Created by cdknight on 2017-07-26T16:27:04, last modified: 2019-03-05T15:19:18

skliper commented 4 years ago

Trac comment by cdknight on 2017-07-26 16:27:25:

I will begin developing a patch for this ticket...

skliper commented 4 years ago

Trac comment by cdknight on 2017-07-28 11:53:11:

Patch committed to the branch trac-200-time_endian [changeset:0358a15]. Note that I also added, in ccsds.h, a macro CFE_MAKE_BIG32() for swapping 32-bit types.

skliper commented 4 years ago

Trac comment by sstrege on 2017-08-01 11:29:20:

On behalf of cdknight: "I considered adding a function to send tone messages but decided it wouldn't simplify much. This will change the endian order for tone messages on little-endian systems even if it's not interacting with big-endian systems. It might make sense to have a compile-time switch to turn this code off and possibly make it default to being undef'd."

skliper commented 4 years ago

Trac comment by glimes on 2017-08-01 12:04:27:

Looked for other bits of code that might need changing, found that CFE_TIME_DATA_CMD_MID is used only in the CFE TIME application, aside from configuring its value. The most at-risk locations were SCH (which actually uses a callback to run at the tone), and SCH_LAB (which subscribes to CFE_TIME_1HZ_CMD_MID and only uses it as a trigger to wake up).

skliper commented 4 years ago

Trac comment by cdknight on 2017-08-09 12:19:39:

Conditional compilation ("#ifdef"), unit test changes, and documentation changes have been committed to [changeset:25552fb].

skliper commented 4 years ago

Trac comment by sstrege on 2017-08-15 12:58:32:

Looks good - approve