# Distinguishing between DroneCAN and OpenCyphal frames?

**URL:** <https://forum.opencyphal.org/t/distinguishing-between-dronecan-and-opencyphal-frames/2201>\
**Category:** PyCyphal\
**Created:** [September 19, 2024, 12:08am UTC](https://forum.opencyphal.org/t/distinguishing-between-dronecan-and-opencyphal-frames/2201 "2024-09-19T00:08:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manforowicz](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/manforowicz/32/1620_2.png) [@manforowicz](https://forum.opencyphal.org/u/manforowicz)\
**Post date:** [September 19, 2024, 12:08am UTC](https://forum.opencyphal.org/t/distinguishing-between-dronecan-and-opencyphal-frames/2201/1 "2024-09-19T00:08:40Z")

</div>

I’m updating a product that must support receiving both DroneCAN and OpenCyphal CAN frames.

Whenever a CAN frame arrives, my code should decide whether to feed it into a DroneCAN or OpenCyphal libcanard instance.

I can already determine the protocol of the first frame of each transfer by checking the toggle bit. DroneCAN starts at 0 and the toggle bit of OpenCyphal starts at 1.

However, I want to be able to distinguish the protocol of each frame even if transfers of two different protocols are interleaved. Is there a simple way to do this?

I assume that, for example, feeding a DroneCAN frame into an OpenCyphal libcanard instance would confuse that instance (or vice versa). Am I right here?

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [September 19, 2024, 1:52pm UTC](https://forum.opencyphal.org/t/distinguishing-between-dronecan-and-opencyphal-frames/2201/2 "2024-09-19T13:52:53Z")

</div>

Such non-first frames can be fed into both protocol state machines simultaneously. The wrong instance will simply drop the frame because it will have no matching transfer reassembly state machine for it.

---

<div class="post-metadata">

**Author:** ![manforowicz](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/manforowicz/32/1620_2.png) [@manforowicz](https://forum.opencyphal.org/u/manforowicz)\
**Post date:** [September 19, 2024, 6:59pm UTC](https://forum.opencyphal.org/t/distinguishing-between-dronecan-and-opencyphal-frames/2201/3 "2024-09-19T18:59:39Z")

</div>

Thanks Pavel!
