2021-03-07 12:46:25 +01:00
|
|
|
/**********************************************************************
|
2022-03-20 20:56:32 +01:00
|
|
|
* This file is used for testing random stuff without running the
|
2021-03-07 12:46:25 +01:00
|
|
|
* whole of SatDump, which comes in handy for debugging individual
|
|
|
|
|
* elements before putting them all together in modules...
|
2022-03-20 20:56:32 +01:00
|
|
|
*
|
|
|
|
|
* If you are an user, ignore this file which will not be built by
|
2021-05-12 21:16:53 +02:00
|
|
|
* default, and if you're a developper in need of doing stuff here...
|
2021-03-07 12:46:25 +01:00
|
|
|
* Go ahead!
|
2022-03-20 20:56:32 +01:00
|
|
|
*
|
2021-03-07 12:46:25 +01:00
|
|
|
* Don't judge the code you might see in there! :)
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
2022-03-28 11:51:13 +02:00
|
|
|
#include "logger.h"
|
2022-11-15 15:00:21 +01:00
|
|
|
#include "common/ccsds/ccsds_1_0_1024/vcdu.h"
|
|
|
|
|
#include "common/ccsds/ccsds_1_0_1024/demuxer.h"
|
|
|
|
|
#include "common/ccsds/ccsds_1_0_1024/mpdu.h"
|
2022-10-25 00:49:59 +02:00
|
|
|
#include <fstream>
|
2022-08-21 23:08:02 +02:00
|
|
|
|
2022-11-15 15:00:21 +01:00
|
|
|
#include "common/codings/randomization.h"
|
|
|
|
|
|
2022-11-07 01:26:44 +01:00
|
|
|
#include "common/image/image.h"
|
|
|
|
|
#include "common/repack.h"
|
|
|
|
|
|
2022-09-29 23:00:32 +02:00
|
|
|
int main(int /*argc*/, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
initLogger();
|
2022-10-02 20:41:25 +02:00
|
|
|
|
2022-10-28 23:00:16 +02:00
|
|
|
std::ifstream idk_file(argv[1]);
|
2022-11-01 19:47:51 +01:00
|
|
|
std::ofstream idk_file2(argv[2]);
|
|
|
|
|
|
2022-11-15 15:00:21 +01:00
|
|
|
uint8_t buffer1[1024];
|
2022-11-07 01:26:44 +01:00
|
|
|
|
2022-10-02 20:41:25 +02:00
|
|
|
|
2022-10-28 23:00:16 +02:00
|
|
|
while (!idk_file.eof())
|
2022-10-02 20:41:25 +02:00
|
|
|
{
|
2022-11-15 15:00:21 +01:00
|
|
|
idk_file.read((char *)buffer1, 1024);
|
2022-11-01 19:47:51 +01:00
|
|
|
|
2022-11-15 15:00:21 +01:00
|
|
|
derand_ccsds(&buffer1[4], 1024 - 4);
|
2022-11-08 23:28:24 +01:00
|
|
|
|
2022-11-15 15:00:21 +01:00
|
|
|
idk_file2.write((char *)&buffer1[4], 892);
|
|
|
|
|
}
|
2022-11-08 23:28:24 +01:00
|
|
|
}
|