nopenpilot/cereal/messaging/messaging.cc

104 lines
2.1 KiB
C++
Raw Normal View History

2021-05-14 19:20:48 -06:00
#include "messaging.h"
#include "impl_zmq.h"
#include "impl_msgq.h"
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
#ifdef __APPLE__
const bool MUST_USE_ZMQ = true;
#else
const bool MUST_USE_ZMQ = false;
#endif
2021-02-23 17:46:22 -07:00
bool messaging_use_zmq(){
return std::getenv("ZMQ") || MUST_USE_ZMQ;
}
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
Context * Context::create(){
Context * c;
2021-02-23 17:46:22 -07:00
if (messaging_use_zmq()){
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
c = new ZMQContext();
} else {
c = new MSGQContext();
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
}
return c;
}
SubSocket * SubSocket::create(){
SubSocket * s;
2021-02-23 17:46:22 -07:00
if (messaging_use_zmq()){
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
s = new ZMQSubSocket();
} else {
s = new MSGQSubSocket();
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
}
return s;
}
2021-02-23 17:46:22 -07:00
SubSocket * SubSocket::create(Context * context, std::string endpoint, std::string address, bool conflate, bool check_endpoint){
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
SubSocket *s = SubSocket::create();
2021-02-23 17:46:22 -07:00
int r = s->connect(context, endpoint, address, conflate, check_endpoint);
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
if (r == 0) {
return s;
} else {
delete s;
return NULL;
}
}
PubSocket * PubSocket::create(){
PubSocket * s;
2021-02-23 17:46:22 -07:00
if (messaging_use_zmq()){
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
s = new ZMQPubSocket();
} else {
s = new MSGQPubSocket();
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
}
return s;
}
2021-02-23 17:46:22 -07:00
PubSocket * PubSocket::create(Context * context, std::string endpoint, bool check_endpoint){
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
PubSocket *s = PubSocket::create();
2021-02-23 17:46:22 -07:00
int r = s->connect(context, endpoint, check_endpoint);
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
if (r == 0) {
return s;
} else {
delete s;
return NULL;
}
}
Poller * Poller::create(){
Poller * p;
2021-02-23 17:46:22 -07:00
if (messaging_use_zmq()){
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
p = new ZMQPoller();
} else {
p = new MSGQPoller();
Squashed 'cereal/' changes from 90e48c54..b8382bbb b8382bbb steerLimitTimer should be car dependent 9a229687 add pa0 temp to ThermalData f6f0f60e Add stock Fcw to carState b608683f no l/r distinction for LDW 555f48d6 Add ldw alert 8e8b4a4a Remove plusFrame socket in favor of UiLayoutState 3410325c log stock AEB events 2219f2bd Add warning about not using cython version of sec_since_boot 8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail e86d9545 adding low memory event ad238340 remove TODO d0962b34 log mem available and cpu perc in thermald 3b753be9 Implement error handling and exceptions (#18) a7d5bb76 add explicit dependencies on services.h 1ba64677 fix linter c7d215b6 Added communityFeatureDisallowed event 492140a5 Added communityFeature bit detection to CarParams 266a5fed log Panda fault types 347a8661 Switch from polling on FIFOs to signal (#12) e25bba77 no need to double build the objects fe43a994 20Hz for radar time step is very standard 2aabf1ee Added radar time step to car params e8ae9086 Generate capnp for java 57126a23 cereal_shared da655cd3 Add uptime to health f6a8e394 add test with multiple subscribers 84b3af53 comment out the debugging 4b9c942a added power save state to health packet 66be3708 run python unittest in ci 52c6db87 Run scons in CI (#14) 9414615b do need it, but only for arm 2856c37c remove gnustl_shared 7f05ee64 fix apks e3a6bded Revert "no more makefiles" 487fbd06 don't rely on BASEDIR, and add zmq library 223e37a5 no more makefiles da2ed115 don't link the wrong one fe9fe2a2 scons builds the python lib now 2f81135e err, it can't build services.h 57b03f8b now we shouldn't need that yaml crap everywhere f8e53277 bridge builds with services.h 2b0cb608 noOutput safety mode is now called silent 83880d51 add msgq tests bcad1848 msgq: dont block when fifo does not exists b4b26782 Default to zmq 473e2912 fix compilation in docker 30aaaddc msgq: try again when no timeout on poll but also no message c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds 4e513a85 msgq: dont clean up uninitialized sockerts c008b630 also remove the fifo from disk ef64eb27 MSGQ stability improvements when opening and closing lots of queues e147abcc Revert "Revert "deprecate irpwr"" 932dc32e Revert "deprecate irpwr" a6844150 disengage ec27e18c capnpc also generated the header files ee52ab9e deprecate irpwr 301c74c8 Merge branch 'master' of github.com:commaai/cereal 6da7d55a add front frame a5944eb4 add conflate parameter for SubSocket::create ca8df170 Add fault status to health ef4ded06 add conflate support in SubSocket constructor 7fd314af update scons build file 93d814e4 add saturated flags to indi and lqr logs 50302fee add steeringRateLimited to car.capnp 05e3513d add msgq readme a6759a95 faster make 94b73778 Add struct to log FW version 64ce0b5f add scons build dc9ad18a add debug print statement on SIGINT 4a612698 Merge pull request #10 from commaai/msgq 4873449a use recv one or none after poll a054864b default to msgq fbc4a4cf oops bad number 5067cf4c add meta cbd02865 fix export prefix and make shared library world readable c2730541 add c exports for jni usage e77f41ef zmq already sets the errno correctly 3196cf69 Fix service list path in bridge d35515a2 add all msgq files, but dont use as default a68a38fa Don't delete context from python side only bd46c225 Revert "zmq_ctx_term is blocking" a1fc26b8 zmq_ctx_term is blocking 09021820 remote address support 21a35361 only delete subsocket when created by same object 34df7351 remove extra underscore from __dealloc__ c8748f86 fix internal refs 79b2fbf7 fixups 23ad2563 import messaging and services git-subtree-dir: cereal git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 14:02:45 -07:00
}
return p;
}
Poller * Poller::create(std::vector<SubSocket*> sockets){
Poller * p = Poller::create();
for (auto s : sockets){
p->registerSocket(s);
}
return p;
}
extern "C" Context * messaging_context_create() {
return Context::create();
}
extern "C" SubSocket * messaging_subsocket_create(Context* context, const char* endpoint) {
return SubSocket::create(context, std::string(endpoint));
}
extern "C" PubSocket * messaging_pubsocket_create(Context* context, const char* endpoint) {
return PubSocket::create(context, std::string(endpoint));
}
extern "C" Poller * messaging_poller_create(SubSocket** sockets, int size) {
std::vector<SubSocket*> socketsVec(sockets, sockets + size);
return Poller::create(socketsVec);
}