diff --git a/src/assembly/linux/main/README.md b/src/assembly/linux/main/README.md index fccf4bd..d6a0827 100644 --- a/src/assembly/linux/main/README.md +++ b/src/assembly/linux/main/README.md @@ -60,7 +60,7 @@ OpenC3 Cosmos runs inside of its own Docker containers. The Cosmos example proje $ ./openc3.sh cli generate plugin LINUX_EXAMPLE ``` -This create a new directory called `openc3-cosmos-linux-example`. Navigate to this directory and run: +This creates a new directory called `openc3-cosmos-linux-example`. Navigate to this directory and run: ``` $ ./../openc3.sh cli generate target LINUX_EXAMPLE @@ -88,19 +88,10 @@ $ cp adamant_example/src/assembly/linux/build/plugin/Config/linux_example_ccsds_ $ cp adamant_example/src/assembly/linux/build/plugin/Config/linux_example_ccsds_plugin.txt cosmos-project/openc3-cosmos-linux-example/plugin.txt ``` -The Cosmos plugin uses a default CRC protocol provided by Cosmos, but needs a modifification to apply the Adamant example's command packet checksum correctly. Navigate to the `cosmos-project/openc3-cosmos-linux-example/targets/LINUX_EXAMPLE/lib` directory, then run: +The Cosmos plugin uses a default CRC protocol provided by Cosmos, but needs a custom protocol to apply Adamant' command packet checksum correctly. Copy the protocol ruby file from `adamant/gnd/cosmos/` to the `cosmos-project/openc3-cosmos-linux-example/targets/LINUX_EXAMPLE/lib` directory: ``` -$ wget https://github.com/OpenC3/cosmos/raw/main/openc3/lib/openc3/interfaces/protocols/crc_protocol.rb -O crc_8bc_protocol.rb -``` - -Modify the following lines of this file by running: - -``` -$ sed -i 's+CrcProtocol < Protocol+Crc8bcProtocol < CrcProtocol+g' crc_8bc_protocol.rb -$ sed -i 's+write_packet(packet)+write_packet(packet, seed = 0xFF)+g' crc_8bc_protocol.rb -$ sed -i 's+end_range = packet.get_item(@write_item_name).bit_offset / 8+crc = packet.buffer.bytes.reduce(seed, :^)+g' crc_8bc_protocol.rb -$ sed -i 's+crc = @crc.calc(packet.buffer(false)\[0...end_range\])++g' crc_8bc_protocol.rb +$ cp adamant/gnd/cosmos/cmd_checksum.rb cosmos-project/openc3-cosmos-linux-example/targets/LINUX_EXAMPLE/lib/cmd_checksum.rb ``` The plugin can now be compiled. Navigate to the plugin directory at `openc3-cosmos-linux-example` and run: