mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-21 09:12:25 +08:00
7f0b3180a4
* add PubMaster & SubMaster remove 'delete msg' remove headers * use constructor to initial all submster * modify drain sockets * fix typo in ssconscript.remove lines no checkValid in loggerd last modify handle_message:event->&event fix type remove heads event to auto * new interface * api changed * Revert "use constructor to initial all submster" This reverts commit 73be7ea46250a325ce41d3a0445e34395a2ae692. * change to new api * revert loggerd * dd * use new PubSub api * update to new interface don't modify loggerd reset panda reset opendbc remove empty lines * switch to new pubMaster * update to the new inteface change remove error code . to -> merge paramsd.cc update panda fix typo simplify fix typo * Fix build * always conflate Co-authored-by: deanlee <deanlee3@gmail.com> old-commit-hash: ab5af232b243ba8137695f68c125f922fb412d44
44 lines
817 B
C++
44 lines
817 B
C++
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <signal.h>
|
|
#include <unistd.h>
|
|
#include <sched.h>
|
|
#include <sys/time.h>
|
|
#include <sys/cdefs.h>
|
|
#include <sys/types.h>
|
|
#include <sys/time.h>
|
|
#include <assert.h>
|
|
#include <math.h>
|
|
#include <ctime>
|
|
#include <chrono>
|
|
|
|
#include "messaging.hpp"
|
|
|
|
#include "common/params.h"
|
|
#include "common/swaglog.h"
|
|
#include "common/timing.h"
|
|
|
|
#include "ublox_msg.h"
|
|
|
|
const long ZMQ_POLL_TIMEOUT = 1000; // In miliseconds
|
|
|
|
Message * poll_ubloxraw_msg(Poller * poller) {
|
|
auto p = poller->poll(ZMQ_POLL_TIMEOUT);
|
|
|
|
if (p.size()) {
|
|
return p[0]->receive();
|
|
} else {
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
|
|
int send_gps_event(PubSocket *s, const void *buf, size_t len) {
|
|
return s->send((char*)buf, len);
|
|
}
|
|
|
|
int main() {
|
|
return ubloxd_main(poll_ubloxraw_msg, send_gps_event);
|
|
}
|