1 #include "gtest/gtest.h" 3 #include "../com_manager.h" 4 #include "../ring_buffer.h" 5 #include "../protocol_nmea.h" 11 #include "../../../libs-int/rtklib/src/rtklib.h" 12 extern gtime_t g_gps_latest_time;
13 extern int decode_rtcm3(rtcm_t *rtcm);
14 extern int decode_ubx(raw_t* raw,
int doChecksum);
18 #define TEST_PROTO_IS 1 19 #define TEST_PROTO_ASCII 1 20 #define TEST_PROTO_UBLOX 1 21 #define TEST_PROTO_RTCM3 1 23 #define TASK_PERIOD_MS 1 // 1 KHz 25 #define DEBUG_PRINTF printf 30 #define PORT_BUFFER_SIZE 8192 93 EXPECT_TRUE(memcmp(&td.
data, dataRead->
buf, td.
size)==0);
117 switch (messageIdUInt)
146 switch (messageIdUInt)
160 uint8_t buf[30] = {};
161 memcpy(buf, msg, (msgSize<29?msgSize:29));
164 EXPECT_EQ(td.
size, msgSize);
165 EXPECT_TRUE(memcmp(&td.
data, msg, td.
size) == 0);
175 DEBUG_PRINTF(
"[%2d] ubloxMessageHandler() size: %3d, (0x%02x 0x%02x)\n", (
int)
g_testRxDeque.size(), msgSize, msg[2], msg[3]);
177 EXPECT_EQ(td.
size, msgSize);
178 EXPECT_TRUE(memcmp(&td.
data, msg, td.
size) == 0);
184 raw.
obs.nmax = raw.
obs.n = 100;
185 raw.buff = (
unsigned char*)msg;
189 switch (decode_ubx(&raw, 0))
191 case DATA_TYPE_OBSERVATION:
192 case DATA_TYPE_EPHEMERIS:
194 case DATA_TYPE_ANTENNA_POSITION:
195 case DATA_TYPE_ION_UTC_ALMANAC:
200 case DATA_TYPE_ERROR:
214 DEBUG_PRINTF(
"[%2d] rtcm3MessageHandler() size: %3d, (0x%02x 0x%02x 0x%02x 0x%02x)\n", (
int)
g_testRxDeque.size(), msgSize, msg[0], msg[1], msg[2], msg[3]);
216 EXPECT_EQ(td.
size, msgSize);
217 EXPECT_TRUE(memcmp(&td.
data, msg, td.
size) == 0);
223 raw.
obs.nmax = raw.
obs.n = 100;
224 raw.buff = (
unsigned char*)msg;
228 switch (decode_rtcm3(&raw))
230 case DATA_TYPE_OBSERVATION:
231 case DATA_TYPE_EPHEMERIS:
233 case DATA_TYPE_ANTENNA_POSITION:
234 case DATA_TYPE_ION_UTC_ALMANAC:
239 case DATA_TYPE_ERROR:
249 #define NUM_HANDLES 1 260 if (
comManagerInitInstance(&(t.
cm),
NUM_HANDLES, 0,
TASK_PERIOD_MS, 0,
portRead,
portWrite, 0,
postRxRead, 0,
disableBroadcasts, &cmInit, &s_cmPort))
294 DEBUG_PRINTF(
"=============== generateData() ===============\n");
297 for (
int i = 0; ; i++)
315 ins1.
theta[0] = i * 2.0f;
316 ins1.
theta[1] = i * 3.0f;
317 ins1.
theta[2] = i * 4.0f;
318 ins1.
uvw[0] = i * 5.0
f;
319 ins1.
uvw[1] = i * 6.0
f;
320 ins1.
uvw[2] = i * 7.0
f;
321 ins1.
lla[0] = 40.330565516;
322 ins1.
lla[1] = -111.725787806;
323 ins1.
lla[2] = 1408.565264;
324 ins1.
ned[0] = i * 1.234f;
325 ins1.
ned[1] = i * 2.345f;
326 ins1.
ned[2] = i * 3.456f;
351 gps.
ecef[0] = (double)i*1.234;
352 gps.
ecef[1] = (double)i*2.345;
353 gps.
ecef[2] = (double)i*3.456;
354 gps.
lla[0] = (double)i*1.234;
355 gps.
lla[1] = (double)i*2.345;
356 gps.
lla[2] = (double)i*3.456;
362 gps.
leapS = (uint8_t)i;
400 uint8_t buf[] = { 0xb5,0x62,0x1,0x2,0x1c,0x0,0x0,0xa1,0xad,0x10,0x6a,0xff,0x67,0xbd,0xb7,0xf4,0x9,0x18,0x35,0x7e,0x15,0x0,0xe8,0xc5,0x15,0x0,0x4f,0x1,0x0,0x0,0xa8,0x1,0x0,0x0,0x59,0xbc };
409 uint8_t buf[] = { 0xb5,0x62,0x2,0x15,0xb0,0x3,0x1b,0x2f,0xdd,0x24,0x1b,0x14,0x11,0x41,0x2b,0x8,0x12,0x1d,0x1,0x1,0x82,0x9,0x5d,0x61,0x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,0xf4,0xfb,0x2c,0x5,0x1,0x8,0xf,0x0,0x5e,0xee,0x27,0x65,0xc5,0xe7,0x6e,0x41,0xe8,0xc4,0xd,0x98,0x13,0x4d,0x94,0x41,0x33,0x7d,0x5a,0xc4,0x0,0xc,0x0,0x0,0xf4,0xfb,0x30,0x5,0x1,0x8,0xf,0x0,0x9c,0x9a };
438 uint8_t buf[] = { 0xd3,0x0,0x19,0x3e,0xfc,0x2f,0x14,0x41,0x44,0x56,0x4e,0x55,0x4c,0x4c,0x41,0x4e,0x54,0x45,0x4e,0x4e,0x41,0x20,0x20,0x4e,0x4f,0x4e,0x45,0x0,0xc4,0xe,0xe1 };
447 uint8_t buf[] = { 0xd3,0x0,0x48,0x40,0x9c,0x2f,0x14,0x41,0x44,0x56,0x4e,0x55,0x4c,0x4c,0x41,0x4e,0x54,0x45,0x4e,0x4e,0x41,0x20,0x20,0x4e,0x4f,0x4e,0x45,0x0,0x0,0xd,0x54,0x52,0x49,0x4d,0x42,0x4c,0x45,0x20,0x4e,0x45,0x54,0x52,0x39,0x14,0x4e,0x61,0x76,0x20,0x34,0x2e,0x36,0x32,0x20,0x2f,0x20,0x42,0x6f,0x6f,0x74,0x20,0x34,0x2e,0x36,0x32,0xa,0x35,0x33,0x32,0x39,0x4b,0x34,0x34,0x33,0x35,0x32,0xfc,0xca,0x3f };
456 uint8_t buf[] = { 0xd3,0x0,0x13,0x3e,0xdc,0x2f,0x3,0x7b,0xcd,0x79,0xd5,0x47,0x35,0x77,0x5f,0x93,0x4d,0x49,0x8f,0xf1,0xb3,0x1d,0xff,0x10,0x3d };
465 uint8_t buf[] = { 0xd3,0x1,0x3a,0x44,0x7c,0x2f,0x52,0x3,0x6c,0x22,0x0,0x20,0x34,0x98,0x0,0xc0,0x0,0x0,0x0,0x0,0x4,0x0,0x88,0x80,0x7f,0xff,0xff,0xff,0xac,0x2a,0xad,0x29,0xa9,0xa7,0xa6,0xa7,0x80,0x0,0x0,0x0,0x6e,0x64,0x72,0xc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,0x0,0x40,0x0,0x80,0x1,0x0,0x2,0x0,0x0,0x9d,0xc4,0x6a };
505 testDeque.push_back(td);
519 uint8_t comm_buffer[2048] = { 0 };
524 for (
int i = 0; i < testDeque.size(); i++)
556 uint8_t comm_buffer[2048] = { 0 };
569 testDeque.pop_front();
600 uint8_t *buf =
new uint8_t[len];
676 TEST(ComManager, SegmentedRxTest)
679 uint8_t buffer[8192];
696 #define TIMES_TO_DIVIDE_DATA 10 719 TEST(ComManager, RxWithGarbageTest)
728 std::deque<data_holder_t> testRxDequeWithGarbage;
740 testRxDequeWithGarbage.push_back(td);
766 TEST(ComManager, Evb2AltDecodeBufferTest)
854 TEST(ComManager, Evb2DataForwardTest)
880 int originalRingBufferUsed =
ringBufUsed(&evbRbuf);
908 testRxDequeCopy.pop_front();
935 ASSERT_TRUE(forwardRingBufferUsed == originalRingBufferUsed);
std::deque< data_holder_t > g_testRxDeque
void parseDataPortTxBuf(std::deque< data_holder_t > &testDeque, test_data_t &t)
void postRxRead(CMHANDLE cmHandle, int pHandle, p_data_t *dataRead)
void comManagerSetCallbacksInstance(CMHANDLE cmInstance, pfnComManagerAsapMsg handlerRmc, pfnComManagerGenMsgHandler handlerAscii, pfnComManagerGenMsgHandler handlerUblox, pfnComManagerGenMsgHandler handlerRtcm3)
int ringBufUsed(const ring_buf_t *rbuf)
This function returns the number of bytes currently in ring buffer.
f_t f[DEBUG_F_ARRAY_SIZE]
struct test_data_t::@42 msgs
static com_manager_port_t s_cmPort
bool initComManager(test_data_t &t)
broadcast_msg_t * broadcastMsg
obsd_t obs[MAX_OBSERVATION_COUNT_IN_RTK_MESSAGE]
bool init(test_data_t &t)
void comManagerRegisterInstance(CMHANDLE cmInstance_, uint32_t dataId, pfnComManagerPreSend txFnc, pfnComManagerPostRead pstRxFnc, const void *txDataPtr, void *rxDataPtr, int dataSize, uint8_t pktFlags)
void addDequeToRingBuf(std::deque< data_holder_t > &testDeque, ring_buf_t *rbuf)
protocol_type_t is_comm_parse_byte(is_comm_instance_t *instance, uint8_t byte)
char is_comm_copy_to_struct(void *sptr, const is_comm_instance_t *instance, const unsigned int maxsize)
uint8_t portTxBuffer[PORT_BUFFER_SIZE]
int msgHandlerAscii(CMHANDLE cmHandle, int pHandle, const uint8_t *msg, int msgSize)
int portRead(CMHANDLE cmHandle, int pHandle, unsigned char *buf, int len)
com_manager_port_t * ports
int comManagerInitInstance(CMHANDLE cmHandle, int numHandles, int maxEnsuredPackets, int stepPeriodMilliseconds, int retryCount, pfnComManagerRead readFnc, pfnComManagerSend sendFnc, pfnComManagerSendBufferAvailableBytes txFreeFnc, pfnComManagerPostRead pstRxFnc, pfnComManagerPostAck pstAckFnc, pfnComManagerDisableBroadcasts disableBcastFnc, com_manager_init_t *buffers, com_manager_port_t *cmPorts)
void ringBufInit(ring_buf_t *rbuf, unsigned char *buf, int bufSize, int wordByteSize)
Initialize ring buffer pointers.
int portWrite(CMHANDLE cmHandle, int pHandle, unsigned char *buf, int len)
void ringBuftoRingBufWrite(ring_buf_t *dst, ring_buf_t *src, int len)
void disableBroadcasts(CMHANDLE cmHandle, int pHandle)
int ins1_to_nmea_pins1(char a[], const int aSize, ins_1_t &ins1)
int is_comm_free(is_comm_instance_t *instance)
int msgHandlerRtcm3(CMHANDLE cmHandle, int pHandle, const uint8_t *msg, int msgSize)
union data_holder_t::@43 data
static is_comm_instance_t s_comm[NUM_HANDLES]
uint32_t broadcastMsgSize
uint8_t portRxBuffer[PORT_BUFFER_SIZE]
std::deque< data_holder_t > g_testTxDeque
USBInterfaceDescriptor data
int ringBufRead(ring_buf_t *rbuf, unsigned char *buf, int len)
This function reads data from the ring buffer.
int ringBufWrite(ring_buf_t *rb, unsigned char *buf, int numBytes)
This function writes data to the ring buffer.
int comManagerSendDataNoAckInstance(CMHANDLE cmInstance, int pHandle, uint32_t dataId, void *dataPtr, int dataSize, int dataOffset)
void is_comm_init(is_comm_instance_t *instance, uint8_t *buffer, int bufferSize)
TEST(ComManager, BasicTxTest)
#define MAX_NUM_BCAST_MSGS
broadcast_msg_t cmBufBcastMsg[MAX_NUM_BCAST_MSGS]
int ringBufEmpty(const ring_buf_t *rbuf)
This function returns 1 if the buffer is empty, 0 if not empty.
int gps_to_nmea_gga(char a[], const int aSize, gps_pos_t &pos)
#define ASCII_MESSAGEID_TO_UINT(c4)
#define TIMES_TO_DIVIDE_DATA
int msgHandlerUblox(CMHANDLE cmHandle, int pHandle, const uint8_t *msg, int msgSize)
protocol_type_t is_comm_parse(is_comm_instance_t *instance)
int is_comm_data(is_comm_instance_t *instance, uint32_t dataId, uint32_t offset, uint32_t size, void *data)
uint8_t buf[MAX_DATASET_SIZE]
void generateData(std::deque< data_holder_t > &testDeque)
void writeNvrUserpageFlashCfg(CMHANDLE cmHandle, int pHandle, p_data_t *data)
nvm_flash_cfg_t nvmFlashCfg
static uint8_t s_comm_buffer[NUM_HANDLES *PKT_BUF_SIZE]
uint8_t buf[PKT_BUF_SIZE]
int ringBufFree(const ring_buf_t *rbuf)
This function returns the number of bytes free in UART Rx buffer. Important: Buffer size is one less ...
void comManagerStepInstance(CMHANDLE cmInstance_)
void prepDevInfo(CMHANDLE cmHandle, int pHandle)